Changeset 1cbb1f4 in git


Ignore:
Timestamp:
Jan 6, 2012, 9:13:51 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
79020f1e7903b16af027b1e0a1240dd1b386a87a
Parents:
0a3fa32bcd8b202183dc9d54b4f82cb6d069f087
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-01-06 21:13:51+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-01-06 21:59:37+01:00
Message:
(Trac Ticket #389) transfer denominator() and numerator() from poly.lib to the Singular kernel

ADD: new kernel functions denominator& numerator: number -> number
CHG: removed denominator& numerator from poly.lib
ADD: added documentation for these new kernel functions
FIX: updated tests (Manual/listvar.tst)
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/poly.lib

    r0a3fa3 r1cbb1f4  
    2121 rad_con(p,I);          check radical containment of polynomial p in ideal I
    2222 content(f);            content of polynomial/vector f
    23  numerator(n);          numerator of number n
    24  denominator(n)         denominator of number n
    2523 mod2id(M,iv);          conversion of a module M to an ideal
    2624 id2mod(i,iv);          conversion inverse to mod2id
     
    904902///////////////////////////////////////////////////////////////////////////////
    905903
    906 proc numerator(number n)
    907 "USAGE:    numerator(n); n number
    908 RETURN:   number, the numerator of n
    909 SEE ALSO: denominator, content, cleardenom
    910 EXAMPLE:  example numerator; shows an example
    911 "
    912 {
    913   poly p = cleardenom(n+var(1));
    914   return (number(coeffs(p,var(1))[1,1]));
    915 }
    916 example
    917 {
    918   "EXAMPLE:"; echo = 2;
    919   ring r = 0,x, dp;
    920   number n = 3/2;
    921   numerator(n);
    922 }
    923 ///////////////////////////////////////////////////////////////////////////////
    924 
    925 proc denominator(number n)
    926 "USAGE:    denominator(n); n number
    927 RETURN:   number, the denominator of n
    928 SEE ALSO: numerator, content, cleardenom
    929 EXAMPLE:  example denominator; shows an example
    930 "
    931 {
    932   poly p = cleardenom(n+var(1));
    933   return (number(coeffs(p,var(1))[2,1]));
    934 }
    935 example
    936 {
    937   "EXAMPLE:"; echo = 2;
    938   ring r = 0,x, dp;
    939   number n = 3/2;
    940   denominator(n);
    941 }
    942 ////////////////////////////////////////////////////////////////////////
    943 
    944904////////////////////////////////////////////////////////////////////////
    945905// The idea of the procedures mod2id, id2mod and subrInterred is, to
  • Singular/iparith.cc

    r0a3fa3 r1cbb1f4  
    8181#include <kernel/timer.h>
    8282
     83#include <polys/coeffrings.h>
    8384
    8485lists rDecompose(const ring r); ring rCompose(const lists  L);
     
    37033704  return FALSE;
    37043705}
     3706
     3707/// Return the denominator of the input number
     3708/// NOTE: the input number is normalized as a side effect
     3709static BOOLEAN jjDENOMINATOR(leftv res, leftv v)
     3710{
     3711  number n = reinterpret_cast<number>(v->Data());
     3712  res->data = reinterpret_cast<void*>(n_GetDenom(n, currRing));
     3713  return FALSE;
     3714}
     3715
     3716/// Return the numerator of the input number
     3717/// NOTE: the input number is normalized as a side effect
     3718static BOOLEAN jjNUMERATOR(leftv res, leftv v)
     3719{
     3720  number n = reinterpret_cast<number>(v->Data());
     3721  res->data = reinterpret_cast<void*>(n_GetNumerator(n, currRing));
     3722  return FALSE;
     3723}
     3724
     3725
     3726
     3727
    37053728#ifdef HAVE_FACTORY
    37063729static BOOLEAN jjDET(leftv res, leftv v)
  • Singular/table.h

    r0a3fa3 r1cbb1f4  
    7878,{D(jjDEGREE),     DEGREE_CMD,      STRING_CMD,     MODUL_CMD     , NO_PLURAL |ALLOW_RING | NO_ZERODIVISOR}
    7979,{D(jjDEFINED),    DEFINED_CMD,     INT_CMD,        DEF_CMD       , ALLOW_PLURAL |ALLOW_RING}
     80,{D(jjDENOMINATOR),DENOMINATOR_CMD, NUMBER_CMD,     NUMBER_CMD    , ALLOW_PLURAL |ALLOW_RING}
     81,{D(jjNUMERATOR),  NUMERATOR_CMD,   NUMBER_CMD,     NUMBER_CMD    , ALLOW_PLURAL |ALLOW_RING}
    8082#ifdef HAVE_FACTORY
    8183,{D(jjDET_I),      DET_CMD,         INT_CMD,        INTMAT_CMD    , ALLOW_PLURAL |ALLOW_RING}
     
    845847  { "degree",      0, DEGREE_CMD ,        CMD_1},
    846848  { "delete",      0, DELETE_CMD ,        CMD_2},
     849  { "denominator", 0, DENOMINATOR_CMD ,   CMD_1}, 
    847850  { "det",         0, DET_CMD ,           CMD_1},
    848851  { "diff",        0, DIFF_CMD ,          CMD_2},
     
    958961  { "nrows",       0, ROWS_CMD ,          CMD_1},
    959962  { "number",      0, NUMBER_CMD ,        RING_DECL},
     963  { "numerator",   0, NUMERATOR_CMD ,     CMD_1},
    960964  { "nvars",       0, NVARS_CMD ,         CMD_1},
    961965  { "open",        0, OPEN_CMD ,          CMD_1},
  • Singular/tok.h

    r0a3fa3 r1cbb1f4  
    5959  DEFINED_CMD,
    6060  DELETE_CMD,
     61  DENOMINATOR_CMD,
    6162  DET_CMD,
    6263  DUMP_CMD,
     
    111112  NEWTONPOLY_CMD,
    112113  NPARS_CMD,
     114  NUMERATOR_CMD,
    113115  NVARS_CMD,
    114116  OPEN_CMD,
  • Tst/Manual/listvar.res.gz.uu

    r0a3fa3 r1cbb1f4  
    1 begin 640 listvar.res.gz
    2 M'XL("`PJ<DX``VQI<W1V87(N<F5S`+67WT_;,!#'W_DK++2',BJ@X=<&HM(0
    3 MVQ2-;8CR-DV1FUR"A6,7^S):IOWOLY,F3;NF<2HM#VV5^WPO=_;Y<AT]W/C?
    4 M""&#(;GUK\DN:CS@;+Q[2<RO@`F&O;W+'?M-AD/"F<9?5!T(>#G02'%G-)=[
    5 M0_,Q43(D.""_R9_*<+PP>$N&$VM03"1$7U8W3W-:\AG1M;MG%:H6-\\K-+Z:
    6 M[L_V7Q>F=];$!!)V=;ZX^SZ_&P'EQ+^*^]/^K+(-CJQMGIS-]_"0,++F^G'T
    7 ML_!\;A'5B+RUT5HDO_QF5S:</CDF"0A0%*7JZ;U*%S?J;-X6TXU$&8#=1;M3
    8 MF0YBQJ%&:,R7M&E+!X/ZFJAB41PRWB+9ECS+@+QZ0#@H(C+EUJ0U15=IC^M:
    9 M:YFKO8WJ=O_S%;XSV>/(K)Y>)4BL9$KFIZK$'T#CARA:X[`1_YIQ=,0?91J$
    10 MLY"ST`E?0MOQ3QGG?GZ*G'`!4PSR0G/"E:F-O.MTP.?E!,%$=<+'_#_@-O8@
    11 MI>9L39WQ%V#)([;@"%8#VG&;-$8?G[/%+K7@B9(P-HG:4G/`OV?XP%)0CM[O
    12 M82)57;$9_PR=O(]03I;XS;AOEKP#7B]&IW6WO=899XF0"MR]SS1"ZH1'IF;1
    13 MI+DI=A.LB*B*2DU1B%^NNVCBB>U]*RV\1;-.TJ;16SSG.9/(0.#)%IK3+33'
    14 M6VB\+32#CAJR>K5HZFW&55-VD$[[HSE+DW&GYSPR/KZOO4]<-!.J///B7Y8Y
    15 MKO4MTXTOWG]J%",;7J=\C"9.>.JN*4>:?(#.9W8[)15#>V4\K<\[=\9>S#OV
    16 M5\/&TO"))D!ZHW[I+I_-+B[,8(A2W#":-(57"@I>9V/E"P2E('+A6>2E,EH3
    17 M40-O8(]UX",0,F7"SIM.O,C28CIU]!]*DZQ`YWAXN++9+;RB46">X<R;%TI*
    18 M.7L%1]ZL303)II:RCN^P7W3:S7_.=_(?2HB=>::#5U#2F8\5F'H03Z[\$\7`
    19 MG#IG_X;7F:+./'!(1[,T]:-N?.WL;Z[GU?\#[>==(\,,P8VW'7*E#VWDQTPL
    20 @;58S3WIV^F+A7M4&SX:UH:QG_C*^V?D+0_^')?$0````
     1begin 644 listvar.res.gz
     2M'XL("%X^!T\``VQI<W1V87(N<F5S`+6744_;,!#'W_D4UK2',BJ@*8P-1*4A
     3MMBD:VQ#E;9HB-[D$"\<N]F6T3/ONL],F3;LF<2HM#VV5^_TO=_;Y<AW?7_O?
     4M""&#$;GQK\@KU'C(V>35!3&_`B88]O8O]NPW&8T(9QI_474HX/E0(\6]\5+N
     5MC<S'5,F0X(#\)G]*PW!E\-8,)]:@F$B(OBAOGN:TY'.B*W??EJA:W3PKT?AR
     6M=C`_>%F9WED3$TC8Y=GJ[OO\;@24$_\R[L_Z\](V.+:V97(VWZ,CPLB6Z\?Q
     7MSX7G,XNH6N2-C=8B^>77N[+A],F0)"!`492JI_=+75RKLWE;3-<210!V%^U.
     8M93J(&8<*H3%?TKHM'0RJ:Z(6B^*0\0[)MN19!.15`\+!(B)3;G5:4W2E=EC5
     9M6LM2[36JV_TO5_C69(]CLWIZDR"QDBE9GJH"OP>-'Z)HB\-:_&O&T1%_D&D0
     10MSD/.0B=\#6W'/V6<^_DI<L(%S##("\T)5Z8V\J[3`5^6$P13U0F?\/^`V]B#
     11ME)JS-7/&GX$E#]B"(U@-:,=MTAA]?,I6N]2")TK"Q"1J2\T!_Y[A/4M!.7J_
     12M@ZE4544S_ADZ>1^CG*[QS;AOEKP#7BU&IW6WO=899XF0"MR]SS5"ZH1'IF;1
     13MI-D4NPE61%1%A691B%^NNFCBJ>U]&RV\1;--TJ;1.SSG*9/(0.#)#IK3'33#
     14M'33>#II!1PW9O%HTU3;CJBDZ2*?]T9RER:33<QX8G]Q5WB<NFBE5GGGQK\L<
     15MU_J&Z=H7[S\UBI$-KU,^1A,G/'77%"--/D#G,[N=DA9#>VD\K<X[M\:^F'?L
     16MKYJ-I>$C38#TQOW"73Z;G9^;P1"EN&8TJ0NO$"QXG4V4+Q"4@LB%9Y&7RFA+
     17M1#6\@3W6@0^E"4:@,\_#C<UHX16-`O,,9]XT_)1R]@*.?,I$!$G3D=_&=UA/
     18M.NOF/^<[^0\EQ,X\T\$+*.G,QPK,@"8>7?E'BH$Y%<[^#:\S19UYX)".YVGJ
     19M1]WXRMELKN?->;W]/&IDF"&X\;:#;?2)1G["Q-IFU?.D9Z<C%NZ7;<K\LU\-
     20033WSE^[UWE\/&CEJD1``````
    2121`
    2222end
  • Tst/Manual/listvar.stat

    r0a3fa3 r1cbb1f4  
    1 1 >> tst_memory_0 :: 1316104113:3132- exportiert :3-1-3:ix86-Linux:mamawutz:348228
    2 1 >> tst_memory_1 :: 1316104113:3132- exportiert :3-1-3:ix86-Linux:mamawutz:794356
    3 1 >> tst_memory_2 :: 1316104113:3132- exportiert :3-1-3:ix86-Linux:mamawutz:827140
    4 1 >> tst_timer_1 :: 1316104113:3132- exportiert :3-1-3:ix86-Linux:mamawutz:13
     11 >> tst_memory_0 :: 1325874782:0- 0815 :spielwiese:version:dilbert:331480
     21 >> tst_memory_1 :: 1325874782:0- 0815 :spielwiese:version:dilbert:754392
     31 >> tst_memory_2 :: 1325874782:0- 0815 :spielwiese:version:dilbert:787192
     41 >> tst_timer_1 :: 1325874782:0- 0815 :spielwiese:version:dilbert:6
Note: See TracChangeset for help on using the changeset viewer.