Changeset 8907a4 in git


Ignore:
Timestamp:
Jan 12, 2015, 2:33:50 PM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
37c2b35026800c66eeabc04e5cdb28d10ddb012b
Parents:
237b18fd2b55f9e94a90732997e9dfe365995f97eb3c5f137de23b81a3905cbe0c556cc5a7f069e1
Message:
Merge pull request #686 from csoeger/normaliz

normaliz.lib support for gradings for normaliz 2.8 and above
Location:
Singular
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/normaliz.lib

    r237b18f r8907a4  
    11//// Singular library normaliz.lib
    22
    3 version="version normaliz.lib 4.0.0.0 Jun_2013 "; // $Id$
     3version="version normaliz.lib 4.1.0.0 Jan_2015 "; // $Id$
    44category="Commutative Algebra";
    55info="
    6 LIBRARY: normaliz.lib  Provides an interface for the use of Normaliz 2.7
    7          within SINGULAR.
    8 AUTHORS:  Winfried Bruns, Winfried.Bruns@Uni-Osnabrueck.de
    9           Christof Soeger, Christof.Soeger@Uni-Osnabrueck.de
     6LIBRARY: normaliz.lib  Provides an interface for the use of Normaliz 2.8 or
     7         newer within SINGULAR.
     8AUTHORS: Winfried Bruns, Winfried.Bruns@Uni-Osnabrueck.de
     9         Christof Soeger, Christof.Soeger@Uni-Osnabrueck.de
    1010
    1111OVERVIEW:
    12 The library normaliz.lib provides an interface for the use of Normaliz 2.7
    13 within SINGULAR. The exchange of data is via files.
     12@texinfo
     13The library normaliz.lib provides an interface for the use of Normaliz 2.8 or
     14newer within SINGULAR. The exchange of data is via files.
    1415In addition to the top level
    1516functions that aim at objects of type ideal or ring, several other auxiliary
    1617functions allow the user to apply Normaliz to data of type intmat. Therefore
    1718SINGULAR can be used as a comfortable environment for the work with Normaliz.
    18 @* Please see the @code{Normaliz2.7Documentation.pdf} (included in the Normaliz
     19@* Please see the @code{Normaliz.pdf} (included in the Normaliz
    1920distribution) for a more extensive documentation of Normaliz.
    20 @code{nmz_sing.pdf} describes this library version 2.2, but most points are
    21 still valid.
    22 
    23 @*Singular and Normaliz exchange data via files. These files are automatically
     21
     22Normaliz allows the use of a grading. In the Singular functions that access
     23Normaliz the parameter grading is an intvec that assigns a (not necessarily
     24positive) degree to every variable of the ambient polynomial ring.
     25But it must give positive degrees to the generators given to function.
     26
     27Singular and Normaliz exchange data via files. These files are automatically
    2428created and erased behind the scenes. As long as one wants to use only the
    2529ring-theoretic functions there is no need for file management.
    26 
    2730@*Note that the numerical invariants computed by Normaliz can be
    2831accessed in this \"automatic file mode\".
    29 
    3032@*However, if Singular is used as a frontend for Normaliz or the user
    3133wants to inspect data not automatically returned to Singular, then
     
    3436Deletion of the files is left to the user.
    3537
    36 @* Use of this library requires the program Normaliz to be installed.
     38Use of this library requires the program Normaliz to be installed.
    3739You can download it from
    3840@uref{http://www.mathematik.uni-osnabrueck.de/normaliz/}. Please make sure
    3941that the executables are in the search path or use setNmzExecPath
    4042(@ref{setNmzExecPath}).
    41 
    42 KEYWORDS: integral closure; normalization
     43@end texinfo
     44
     45KEYWORDS: integral closure; normalization; toric ring
    4346
    4447PROCEDURES:
     
    5053                              elements of I
    5154 normalToricRingFromBinomials(ideal I)  computes the normalization of the
    52                               polynomial ring modulo the unique minimal prime
    53                               ideal of the binomial ideal I
    54  ehrhartRing(ideal I)         computes the monomials representing the lattice
    55                               points of the polytop generated leading monomials
    56                               of the elements of I
    57  intclMonIdeal(ideal I)       the exponent vectors of the leading monomials of
    58                               the elements of I are considered as generators of
    59                               a monomial ideal whose Rees algebra is computed
    60 
     55                              polynomial ring modulo the unique minimal binomial
     56                              prime ideal of the binomial ideal I
     57 ehrhartRing(ideal I)         considers the exponent vectors of the elements of I
     58                              as points of a lattice polytope and computes the
     59                              integral cloure of the polytopal algebra
     60 intclMonIdeal(ideal I)       Computes the integral closure of the Rees algebra
     61                              of the ideal generated by the leading monomials of
     62                              the elements of I
    6163 torusInvariants(intmat T)    computes the ring of invariants of a torus action
    6264 finiteDiagInvariants(intmat C)  computes the ring of invariants of a finite
     
    7072 intersectionValRingIdeals(intmat V)       computes ideals of monomial valuations
    7173
    72  showNuminvs()                prints the numerical invariants
    73  exportNuminvs()              exports the numerical invariants
     74 showNuminvs()                prints the numerical invariants found by Normaliz
     75 exportNuminvs()              exports the numerical invariants found by Normaliz
    7476
    7577 setNmzOption(string s, int onoff) sets the option s to onoff
     
    237239    desString("nmz_data_path",nmz_data_path_name);
    238240    nmz_data_path=appendSlash(nmz_data_path);
    239 }example
     241}
     242example
    240243{ "EXAMPLE:";echo = 2;
    241244  setNmzDataPath("examples/");
     
    395398    {
    396399        f=getNmzFile()+"."+suffixes[i];
    397         if (fileExists(f)) { dummy=system("sh","rm "+f+ "&> /dev/null"); }
     400        if (fileExists(f))
     401        {
     402            dummy=system("sh","rm "+f+ "&> /dev/null");
     403        }
    398404    }
    399405}
     
    580586    for (int k=1; k+1<=size(#); k=k+2) {
    581587    //get data from the parameter list
    582       sgr   = #[k];
    583       num_rows = nrows(sgr);
    584       num_cols = ncols(sgr);
    585                 n_mode   = #[k+1];
    586 
    587       write(outf,num_rows);
    588       write(outf,num_cols);
    589 
    590       for(i=1;i<=nrows(sgr);i++)
    591       {
    592         s="";
    593         for(j=1;j<=num_cols;j++)
    594         {
    595            s=s+string(sgr[i,j])+" ";
    596         }
    597         write(outf,s);
    598       }
    599       write(outf,n_mode);
    600       write(outf,"");
     588        n_mode   = #[k+1];
     589        if (n_mode != -1) { //skip -1 mode
     590            sgr = #[k];
     591            num_rows = nrows(sgr);
     592            num_cols = ncols(sgr);
     593
     594            write(outf,num_rows);
     595            write(outf,num_cols);
     596
     597            for(i=1;i<=nrows(sgr);i++)
     598            {
     599                s="";
     600                for(j=1;j<=num_cols;j++)
     601                {
     602                    s=s+string(sgr[i,j])+" ";
     603                }
     604                write(outf,s);
     605            }
     606            if (n_mode == 20) {
     607                write(outf,"grading");
     608            } else {
     609                write(outf,n_mode);
     610            }
     611            write(outf,"");
     612        }
    601613    }
    602614    close(outf);
     615}
     616
     617
     618static proc prepareGrading(list #)
     619{
     620    if (size(#)==0) {
     621        return(0,-1); // mode -1 specifies discard the matrix
     622    }
     623    if (size(#)>1) {
     624        print(#);
     625        ERROR("To many parameters!");
     626    }
     627    intmat g = intmat(#[1],1,size(#[1]));
     628    return (g,20);
    603629}
    604630
     
    611637          mode. See the Normaliz documentation for more information.
    612638
    613                          It is also possible to give more than one pair of matrix and mode. In
    614                          this case all matrices and modes are written. This can be used to
    615                          combine modes 4,5,6.
     639          It is also possible to give more than one pair of matrix and mode. In
     640          this case all matrices and modes are written. This can be used to
     641          combine modes 4,5,6.
     642          Use mode=20 to specify a grading.
    616643NOTE:     Needs an explicit filename set. The filename is created from the
    617644          current filename.
     
    677704    (n_cols,p)=getInt(s,p);
    678705    if (n_rows <= 0 || n_cols <= 0) {
    679              intmat empty;
    680              return(empty);
    681     }
    682          intmat nmz_gen[n_rows][n_cols];
     706         intmat empty;
     707         return(empty);
     708    }
     709    intmat nmz_gen[n_rows][n_cols];
    683710    for(i=1;i<=n_rows;i++)
    684711    {
     
    696723  intmat sgrnormal=normaliz(sgr,0);
    697724  readNmzData("cst");
    698   readNmzData("typ");
    699725}
    700726
     
    714740        list nmz_options=
    715741        list("supp",0,"-s",0),
    716         list("triang",0,"-v",0),
    717         list("volume",0,"-V",0),
     742        list("triang",0,"-tT",0),
     743        list("volume",0,"-v",0),
    718744        list("hvect",0,"-p",0),
    719         list("hvect_l",0,"-P",0),
    720745        list("height1",0,"-1",0),
    721746        list("normal",0,"-n",1),
    722747        list("normal_l",0,"-N",1),
    723748        list("hilb",0,"-h",1),
    724         list("hilb_l",0,"-H",1),
    725749        list("dual",0,"-d",1),
    726750        list("control",0,"-c",2),
     
    739763The Normaliz options are accessible via the following names:
    740764@* @code{-s:  supp}
    741 @* @code{-v:  triang}
    742 @* @code{-V:  volume}
     765@* @code{-t:  triang}
     766@* @code{-v:  volume}
    743767@* @code{-p:  hvect}
    744 @* @code{-P:  hvect_l}
    745768@* @code{-1:  height1}
    746769@* @code{-n:  normal}
    747770@* @code{-N:  normal_l}
    748771@* @code{-h:  hilb}
    749 @* @code{-H:  hilb_l}
    750772@* @code{-d:  dual}
    751773@* @code{-a:  allf}
     
    788810        {
    789811            run_options=run_options+nmz_options[i][3];
    790                                 if (nmz_options[i][1]=="threads") {
    791                                         run_options=run_options+string(nmz_options[i][2]);
    792                                 }
    793                                 run_options=run_options+" ";
     812                if (nmz_options[i][1]=="threads") {
     813                    run_options=run_options+string(nmz_options[i][2]);
     814                }
     815                run_options=run_options+" ";
    794816            if(nmz_options[i][4]!=2)
    795817            {
     
    818840
    819841
    820 static proc runNormaliz(intmat sgr,def nmz_mode, list #)
     842static proc runNormaliz(intmat sgr, int nmz_mode, list #)
    821843{
    822844    if(!queryInt("nmz_files_keep_switch"))
     
    876898
    877899          It is also possible to give more than one pair of matrix and mode. In
    878                          this case all matrices and modes are used. This can be used to
    879                          combine modes 4,5,6.
     900          this case all matrices and modes are used. This can be used to
     901          combine modes 4,5,6.
     902          Use nmz_mode=20 to specify a grading.
    880903NOTE:     You will find procedures for many applications of Normaliz in this
    881904          library, so the explicit call of this procedure may not be necessary.
    882905SEE ALSO: intclToricRing, normalToricRing, ehrhartRing, intclMonIdeal,
    883906          torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRings,
    884                          intersectionValRingIdeals
     907             intersectionValRingIdeals
    885908EXAMPLE:  example normaliz; shows an example
    886909"
     
    935958                name_inv="h_vector";
    936959            }
    937             if(name_inv!="hilbert_polynomial")
     960            if(name_inv!="hilbert_polynomial"
     961              && name_inv!="hilbert_quasipolynomial")
    938962            {
    939963                for(i=1;i<=v_length;i++)
     
    961985            (sw,p)=nextWord(s,p);
    962986            name_inv=s[sw..p-1];
    963             (dummy_int,p)=getInt(s,p);
    964             num_invs=num_invs+list(list(name_inv,dummy_int,"int"));
     987            if (name_inv!="hilbert_quasipolynomial_denom") {
     988              (dummy_int,p)=getInt(s,p);
     989              num_invs=num_invs+list(list(name_inv,dummy_int,"int"));
     990            }
    965991        }
    966992        if(type_inv=="boolean")
     
    10001026{ "EXAMPLE:"; echo=2;
    10011027  ring R=0,(x,y,z,t),dp;
    1002   ideal I=x^2,y^2,z^3;
     1028  ideal I=x3,x2y,y3;
    10031029  list l=intclMonIdeal(I);
    10041030  showNuminvs();
     
    10291055{ "EXAMPLE:"; echo=2;
    10301056  ring R=0,(x,y,z,t),dp;
    1031   ideal I=x^2,y^2,z^3;
     1057  ideal I=x3,x2y,y3;
    10321058  list l=intclMonIdeal(I);
    10331059  exportNuminvs();
     
    10381064  nmz_index;
    10391065  nmz_number_support_hyperplanes;
    1040   nmz_homogeneous;
     1066  nmz_size_triangulation;
     1067  nmz_sum_dets;
     1068  nmz_graded;
     1069  nmz_degree_1_elements;
     1070  nmz_grading;
     1071  nmz_grading_denom;
     1072  nmz_multiplicity;
     1073  nmz_multiplicity_denom;
     1074  nmz_hilbert_series_num;
     1075  nmz_hilbert_series_denom;
    10411076  nmz_primary;
    1042   nmz_ideal_multiplicity;
    10431077}
    10441078
     
    11371171        if(expo_vecs[i,ncols(expo_vecs)]==d)
    11381172        {
    1139 
    11401173            m=1;
    11411174            for(j=1;j<=ncols(expo_vecs)-1;j++)
     
    11461179        }
    11471180    }
    1148      mons=simplify(mons,2);    // get rid of starting 0
    1149      return(mons);
     1181    mons=simplify(mons,2);    // get rid of starting 0
     1182    return(mons);
    11501183}
    11511184
     
    11551188RETURN:   Returns the intmat whose rows represent the exponents of the
    11561189          (non-zero) elements of I which have to be binomials.
    1157                          The length of each row is nvars(basering).
     1190          The length of each row is nvars(basering).
    11581191SEE ALSO: mons2intmat, intmat2mons
    11591192EXAMPLE:  example binomials2intmat; shows an example"
    11601193{
    1161   int i,j,k;
    1162   intmat expo_vecs[size(I)][nvars(basering)];
    1163   intvec expo_v;
    1164 
    1165   k=0;
    1166   poly f;
    1167 
    1168   for(i=1; i<=ncols(I); i++)
    1169   {
    1170     if( I[i] != 0 )
    1171     {
    1172       k++;
    1173       f = I[i];
    1174       if (leadcoef(f) != 1) {f = -f};  //works in all characteristics
    1175       if (size(f)!=2 || leadcoef(f)!=1 || leadcoef(f[2])!=-1)
    1176       {
    1177         ERROR(string("normalToricRing: binomial ideal expected: generator ",i,": ",I[i]));
    1178       }
    1179       expo_v = leadexp(f)-leadexp(f[2]);
    1180       for(j=1;j<=nvars(basering);j++)
    1181       {
    1182         expo_vecs[k,j]=expo_v[j];
    1183       }
    1184     }
    1185   }
    1186   return(expo_vecs);
     1194    int i,j,k;
     1195    intmat expo_vecs[size(I)][nvars(basering)];
     1196    intvec expo_v;
     1197
     1198    k=0;
     1199    poly f;
     1200
     1201    for(i=1; i<=ncols(I); i++)
     1202    {
     1203        if( I[i] != 0 )
     1204        {
     1205            k++;
     1206            f = I[i];
     1207            if (leadcoef(f) != 1) {f = -f};  //works in all characteristics
     1208            if (size(f)!=2 || leadcoef(f)!=1 || leadcoef(f[2])!=-1)
     1209            {
     1210                ERROR(string("normalToricRing: binomial ideal expected: generator ",i,": ",I[i]));
     1211            }
     1212
     1213            expo_v = leadexp(f)-leadexp(f[2]);
     1214            for(j=1;j<=nvars(basering);j++)
     1215            {
     1216                expo_vecs[k,j]=expo_v[j];
     1217            }
     1218        }
     1219    }
     1220    return(expo_vecs);
    11871221}
    11881222example
     
    11961230// integral closure of rings and ideals
    11971231
    1198 static proc runIntclToricRing(ideal I, int nmz_mode)
     1232static proc runIntclToricRing(ideal I, int nmz_mode, list #)
    11991233{
    12001234    intmat expo_vecs=mons2intmat(I);
    12011235
    12021236    string dummy=collectNmzOptions(); // only to set GenGen
    1203 
    1204     return( intmat2mons( runNormaliz(expo_vecs,nmz_mode) ) );
    1205 }
    1206 
    1207 proc intclToricRing(ideal I)
     1237    return( intmat2mons( runNormaliz(expo_vecs,nmz_mode, prepareGrading(#)) ) );
     1238}
     1239
     1240proc intclToricRing(ideal I, list #)
    12081241"USAGE:   intclToricRing(ideal I);
    1209 RETURN:   The toric ring S is the subalgebra of the basering generated by the
    1210           leading monomials of the elements of I. The function computes the
    1211           integral closure T of S in the basering and returns an ideal listing
     1242          intclToricRing(ideal I, intvec grading);
     1243RETURN:   The toric ring S is the subalgebra of the basering generated by
     1244          the leading monomials of the elements of I (considered as a list
     1245          of polynomials). The function computes the integral
     1246          closure T of S in the basering and returns an ideal listing
    12121247          the algebra generators of T over the coefficient field.
    12131248@*        The function returns the input ideal I if one of the options
    1214           @code{supp}, @code{triang}, or @code{hvect} has been activated.
     1249          @code{supp}, @code{triang}, @code{volume}, or @code{hseries}
     1250          has been activated.
    12151251          However, in this case some numerical invariants are computed, and
    12161252          some other data may be contained in files that you can read into
     
    12221258"
    12231259{
    1224     return(runIntclToricRing(I,0));
     1260    return(runIntclToricRing(I,0,#));
    12251261}
    12261262example
     
    12291265  ideal I=x3,x2y,y3;
    12301266  intclToricRing(I);
    1231 }
    1232 
    1233 proc normalToricRing(ideal I)
     1267  showNuminvs();
     1268  //now the same example with another grading
     1269  intvec grading = 2,3,1;
     1270  intclToricRing(I,grading);
     1271  showNuminvs();
     1272
     1273}
     1274
     1275proc normalToricRing(ideal I, list #)
    12341276"USAGE:   normalToricRing(ideal I);
     1277          normalToricRing(ideal I, intvec grading);
    12351278RETURN:   The toric ring S is the subalgebra of the basering generated by the
    1236           leading monomials of the elements of I. The function computes the
     1279          leading monomials of the elements of I (considered as a list of
     1280          polynomials). The function computes the
    12371281          normalisation T of S and returns an ideal listing the algebra
    12381282          generators of T over the coefficient field.
    12391283@*        The function returns the input ideal I if one of the options
    1240           @code{supp}, @code{triang}, or @code{hvect} has been activated.
     1284          @code{supp}, @code{triang}, @code{volume}, or @code{hseries}
     1285          has been activated.
    12411286          However, in this case some numerical invariants are computed, and
    12421287          some other data may be contained in files that you can read into
     
    12481293"
    12491294{
    1250     return(runIntclToricRing(I,1));
     1295    return(runIntclToricRing(I,1,#));
    12511296}
    12521297example
     
    12581303
    12591304
    1260 proc normalToricRingFromBinomials(ideal I)
     1305proc normalToricRingFromBinomials(ideal I, list #)
    12611306"USAGE:   normalToricRingFromBinomials(ideal I);
    1262 RETURN:
     1307          normalToricRingFromBinomials(ideal I, intvec grading);
     1308RETURN:   @texinfo
    12631309@tex
    12641310The ideal $I$ is generated by binomials of type $X^a-X^b$ (multiindex notation)
     
    12781324generators of the normalization of $K[N]$.
    12791325@end tex
     1326@end texinfo
    12801327@*        The function returns the input ideal I if one of the options
    1281           @code{supp}, @code{triang}, or @code{hvect} has been activated.
     1328          @code{supp}, @code{triang}, @code{volume}, or @code{hseries}
     1329          has been activated.
    12821330          However, in this case some numerical invariants are computed, and
    12831331          some other data may be contained in files that you can read into
    1284           Singular.
     1332          Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
    12851333SEE ALSO: intclToricRing, normalToricRing, ehrhartRing, intclMonIdeal
    12861334EXAMPLE:  example normalToricRing; shows an example
    12871335"
    12881336{
    1289         intmat expo_vecs = binomials2intmat(I);
    1290         string dummy=collectNmzOptions(); // only to set GenGen
    1291         intmat result = runNormaliz(expo_vecs,10);
    1292 
    1293         list baseringlist = ringlist(basering);
    1294         ring S = (baseringlist[1]),(x(1..ncols(result))),dp;
    1295         ideal I = intmat2mons(result);
    1296         export(I);
    1297         return (S);
     1337    intmat expo_vecs = binomials2intmat(I);
     1338    string dummy=collectNmzOptions(); // only to set GenGen
     1339    intmat result = runNormaliz(expo_vecs,10,prepareGrading(#));
     1340
     1341    list baseringlist = ringlist(basering);
     1342    ring S = (baseringlist[1]),(x(1..ncols(result))),dp;
     1343    ideal I = intmat2mons(result);
     1344    export(I);
     1345    return (S);
    12981346}
    12991347example
     
    13061354}
    13071355
    1308 static proc runIntclMonIdeal(ideal I, int nmz_mode)
     1356static proc runIntclMonIdeal(ideal I, int nmz_mode, list #)
    13091357{
    13101358    intmat expo_vecs=mons2intmat(I);
     
    13241372
    13251373    //adjust size of input matrix
    1326          if (!last_comp) { // remove last component
    1327              intmat tmp[nrows(expo_vecs)][ncols(expo_vecs)-1] = expo_vecs[1..nrows(expo_vecs),1..(ncols(expo_vecs)-1)];
    1328                   expo_vecs = tmp;
    1329          }
    1330     intmat nmz_data=runNormaliz(expo_vecs,nmz_mode);
     1374    if (!last_comp) { // remove last component
     1375        intmat tmp[nrows(expo_vecs)][ncols(expo_vecs)-1]
     1376               = expo_vecs[1..nrows(expo_vecs),1..(ncols(expo_vecs)-1)];
     1377        expo_vecs = tmp;
     1378    }
     1379    intmat nmz_data=runNormaliz(expo_vecs,nmz_mode,prepareGrading(#));
    13311380
    13321381    if(last_comp)
     
    13461395"USAGE:    ehrhartRing(ideal I);
    13471396RETURN:    The exponent vectors of the leading monomials of the elements of I
    1348            are considered as vertices of a lattice polytope P.
     1397           are considered as points of a lattice polytope P.
    13491398           The Ehrhart ring of a (lattice) polytope P is the monoid algebra
    13501399           defined by the monoid of lattice points in the cone over the
     
    13551404               treated as the auxiliary variable of the Ehrhart ring. The
    13561405               function returns two ideals, the first containing the monomials
    1357                representing the lattice points of the polytope, the second
     1406               representing all the lattice points of the polytope, the second
    13581407               containing the algebra generators of the Ehrhart ring over the
    1359                     coefficient field.
     1408               coefficient field.
    13601409@*         (ii) If the last ring variable is used by the monomials, the list
    13611410                returned contains only one ideal, namely the monomials
     
    13631412@*
    13641413@*        The function returns the a list containing the input ideal I if one
    1365           of the options @code{supp}, @code{triang}, or @code{hvect} has been
    1366                         activated.
     1414          of the options @code{supp}, @code{triang}, @code{volume}, or
     1415          @code{hseries} has been activated.
    13671416          However, in this case some numerical invariants are computed, and
    13681417          some other data may be contained in files that you can read into
    1369           Singular.
     1418          Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
    13701419NOTE:      A mathematical remark: the Ehrhart ring depends on the list of
    13711420           monomials given, and not only on the ideal they generate!
     
    13831432}
    13841433
    1385 proc intclMonIdeal(ideal I)
     1434proc intclMonIdeal(ideal I, list #)
    13861435"USAGE:   intclMonIdeal(ideal I);
     1436          intclMonIdeal(ideal I, intvec grading);
    13871437RETURN:   The exponent vectors of the leading monomials of the elements of I
    13881438          are considered as generators of a monomial ideal for which the
     
    14001450        closure of the ideal.
    14011451@*        The function returns the a list containing the input ideal I if one
    1402           of the options @code{supp}, @code{triang}, or @code{hvect} has been
    1403                         activated.
     1452          of the options @code{supp}, @code{triang}, @code{volume}, or
     1453          @code{hseries} has been activated.
    14041454          However, in this case some numerical invariants are computed, and
    14051455          some other data may be contained in files that you can read into
     
    14091459"
    14101460{
    1411     return(runIntclMonIdeal(I,3));
     1461    return(runIntclMonIdeal(I,3,#));
    14121462}
    14131463example
     
    14221472// torus invariants and valuation rings and ideals
    14231473
    1424 proc torusInvariants(intmat E)
     1474proc torusInvariants(intmat E, list #)
    14251475"USAGE:   torusInvariants(intmat A);
    1426 RETURN:
     1476          torusInvariants(intmat A, intvec grading);
     1477RETURN:   @texinfo
    14271478Returns an ideal representing the list of monomials generating the ring of
    14281479invariants as an algebra over the coefficient field.
     
    14301481$R^T$.
    14311482@end tex
    1432 @*The function returns the ideal given by the input matrix A if one of
    1433 the options @code{supp}, @code{triang}, or @code{hvect} has been
    1434 activated.
    1435 However, in this case some numerical invariants are computed, and
    1436 some other data may be contained in files that you can read into
    1437 Singular.
    1438 BACKGROUND:
     1483@*        The function returns the ideal given by the input matrix A if one of
     1484          the options @code{supp}, @code{triang}, @code{volume}, or
     1485          @code{hseries} has been activated.
     1486          However, in this case some numerical invariants are computed, and
     1487          some other data may be contained in files that you can read into
     1488          Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
     1489@end texinfo
     1490BACKGROUND: @texinfo
    14391491@tex
    14401492 Let $T = (K^*)^r$ be the $r$-dimensional torus acting on the polynomial ring
     
    14471499$A=(a_{i,j})$.
    14481500@end tex
     1501@end texinfo
    14491502SEE ALSO: diagInvariants, finiteDiagInvariants, intersectionValRings,
    14501503          intersectionValRingIdeals
     
    14591512    string dummy=collectNmzOptions();  // only to set GenGen
    14601513
    1461     return( intmat2mons( runNormaliz(E,5) ) );
     1514    return( intmat2mons( runNormaliz(E,5,prepareGrading(#)) ) );
    14621515}
    14631516example
     
    14681521}
    14691522
    1470 proc finiteDiagInvariants(intmat C)
     1523proc finiteDiagInvariants(intmat C, list #)
    14711524"USAGE:   finiteDiagInvariants(intmat U);
    1472 RETURN:
     1525          finiteDiagInvariants(intmat U, intvec grading);
     1526RETURN:   @texinfo
    14731527@tex
    14741528This function computes the ring of invariants of a finite abelian group $G$
     
    14851539{$R^G=\{f\in R : g_i f = f$ for all $i=1,\ldots,w\}$}.
    14861540@end tex
    1487 @*The function returns the ideal given by the input matrix C if one of
    1488 the options @code{supp}, @code{triang}, or @code{hvect} has been
    1489 activated.
    1490 However, in this case some numerical invariants are computed, and
    1491 some other data may be contained in files that you can read into
    1492 Singular.
     1541@end texinfo
     1542@*        The function returns the ideal given by the input matrix C if one of
     1543          the options @code{supp}, @code{triang}, @code{volume}, or
     1544          @code{hseries} has been activated.
     1545          However, in this case some numerical invariants are computed, and
     1546          some other data may be contained in files that you can read into
     1547          Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
    14931548NOTE:
    14941549SEE ALSO: torusInvariants, diagInvariants, intersectionValRings,
    1495           intersectionValRingIdeals,showNuminvs,exportNuminvs
     1550          intersectionValRingIdeals
    14961551EXAMPLE:  example finiteDiagInvariants; shows an example
    14971552"
     
    15041559    string dummy=collectNmzOptions();  // only to set GenGen
    15051560
    1506     return( intmat2mons( runNormaliz(C,6) ) );
     1561    return( intmat2mons( runNormaliz(C,6,prepareGrading(#)) ) );
    15071562}
    15081563example
     
    15131568}
    15141569
    1515 proc diagInvariants(intmat E, intmat C)
     1570proc diagInvariants(intmat E, intmat C, list #)
    15161571"USAGE:   diagInvariants(intmat A, intmat U);
    1517 RETURN:
     1572          diagInvariants(intmat A, intmat U, intvec grading);
     1573RETURN:   @texinfo
    15181574@tex
    15191575This function computes the ring of invariants of a diagonalizable group
     
    15251581monomial ideal listing the algebra generators of the subalgebra of invariants.
    15261582@end tex
    1527 @*The function returns the ideal given by the input matrix A if one of
    1528 the options @code{supp}, @code{triang}, or @code{hvect} has been
    1529 activated.
    1530 However, in this case some numerical invariants are computed, and
    1531 some other data may be contained in files that you can read into
    1532 Singular.
    1533 SEE ALSO: torusInvariants, finiteDiagInvariants, intersectionValRings, intersectionValRingIdeals,showNuminvs,exportNuminvs
     1583@end texinfo
     1584@*        The function returns the ideal given by the input matrix A if one of
     1585          the options @code{supp}, @code{triang}, @code{volume}, or
     1586          @code{hseries} has been activated.
     1587          However, in this case some numerical invariants are computed, and
     1588          some other data may be contained in files that you can read into
     1589          Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
     1590SEE ALSO: torusInvariants, finiteDiagInvariants, intersectionValRings, intersectionValRingIdeals
    15341591EXAMPLE:  example diagInvariants; shows an example
    15351592"
     
    15421599    string dummy=collectNmzOptions();  // only to set GenGen
    15431600
    1544     return( intmat2mons( runNormaliz(E,5,C,6) ) );
     1601    return( intmat2mons( runNormaliz(E,5,C,6,prepareGrading(#)) ) );
    15451602}
    15461603example
     
    15521609}
    15531610
    1554 proc intersectionValRings(intmat V)
    1555 "USAGE:   intersectionValRings(intmat V);
     1611proc intersectionValRings(intmat V, list #)
     1612"USAGE:   intersectionValRings(intmat V, intvec grading);
    15561613RETURN:   The function returns a monomial ideal, to be considered as the list
    15571614          of monomials generating @math{S} as an algebra over the coefficient
    15581615          field.
    1559 BACKGROUND:
     1616BACKGROUND: @texinfo
    15601617@tex
    15611618A discrete monomial valuation $v$ on $R = K[X_1 ,\ldots,X_n]$ is determined by
     
    15651622its input.
    15661623@end tex
    1567 @*The function returns the ideal given by the input matrix V if one of
    1568 the options @code{supp}, @code{triang}, or @code{hvect} has been
    1569 activated.
    1570 However, in this case some numerical invariants are computed, and
    1571 some other data may be contained in files that you can read into
    1572 Singular.
    1573 SEE ALSO: torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRingIdeals,showNuminvs,exportNuminvs
     1624@end texinfo
     1625@*        The function returns the ideal given by the input matrix V if one of
     1626          the options @code{supp}, @code{triang}, @code{volume}, or
     1627          @code{hseries} has been activated.
     1628          However, in this case some numerical invariants are computed, and
     1629          some other data may be contained in files that you can read into
     1630          Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
     1631SEE ALSO: torusInvariants, diagInvariants, finiteDiagInvariants, intersectionValRingIdeals
    15741632EXAMPLE:  example intersectionValRings; shows an example
    15751633"
     
    16011659/*    if(!GenGen) // return V
    16021660    {
    1603         runNormaliz(V1,4);
     1661        runNormaliz(V1,4,prepareGrading(#));
    16041662        return(V);
    16051663    }
    16061664*/
    1607     return(intmat2mons(runNormaliz(V1,4)));
     1665    return(intmat2mons(runNormaliz(V1,4,prepareGrading(#))));
    16081666}
    16091667example
     
    16141672}
    16151673
    1616 proc intersectionValRingIdeals(intmat V)
     1674proc intersectionValRingIdeals(intmat V, list #)
    16171675"USAGE:   intersectionValRingIdeals(intmat V);
     1676          intersectionValRingIdeals(intmat V, intvec grading);
    16181677RETURN:   The function returns two ideals, both to be considered as lists of
    1619           monomials which generate an algebra over the coefficient field. The
     1678          monomials. The
    16201679          first is the system of monomial generators of @math{S}, the second
    16211680          the system of generators of @math{M}.
     
    16261685          some other data may be contained in files that you can read into
    16271686          Singular (see @ref{showNuminvs}, @ref{exportNuminvs}).
    1628 BACKGROUND:
     1687BACKGROUND: @texinfo
    16291688@tex
    16301689A discrete monomial valuation $v$ on $R = K[X_1 ,\ldots,X_n]$ is determined by
     
    16391698The numbers $w_i$ form the $(n+1)$th column of the input matrix.
    16401699@end tex
     1700@end texinfo
    16411701NOTE:   The function also gives an error message if the matrix V has the
    16421702        wrong number of columns.
     
    16711731    string dummy=collectNmzOptions();  // only to set GenGen
    16721732
    1673     intmat nmz_data=runNormaliz(V1,4);
     1733    intmat nmz_data=runNormaliz(V1,4,prepareGrading(#));
    16741734
    16751735    ideal I1=intmat2monsSel(nmz_data,0);
  • Singular/LIB/primdec.lib

    reb3c5f1 r8907a4  
    39353935   ideal F=imap(R,F);
    39363936
    3937    string nR1="ring @S1="+string(p)+",("+varstr(R)+","+parstr(R)+",@y(1..m)),dp;";
    3938    execute(nR1);
    3939    list lR=ringlist(@S1)[2];
    3940    lR=lR[(size(lR)-m+1)..(size(lR))];
    3941 
    3942    string nR="ring @S="+string(p)+",("+string(lR)+","+varstr(R)+","+parstr(R)+"),dp;";
     3937   string nR="ring @S="+string(p)+",(@y(1..m),"+varstr(R)+","+parstr(R)+"),dp;";
    39433938   execute(nR);
    39443939
  • Singular/emacs.cc

    reb3c5f1 r8907a4  
    99
    1010
     11#include <kernel/mod2.h>
     12#include <omalloc/omalloc.h>
     13#include <resources/feResource.h>
     14#include <Singular/feOpt.h>
     15
    1116#ifdef __CYGWIN__
    1217#define BOOLEAN boolean
    1318#endif
    14 #include <kernel/mod2.h>
    15 
    1619
    1720#include <stdio.h>
     
    3033#endif
    3134
    32 #include <omalloc/omalloc.h>
    33 #include <resources/feResource.h>
    34 #include <Singular/feOpt.h>
    3535
    3636#if !defined(TSINGULAR) && !defined(ESINGULAR)
     
    6363}
    6464#else
    65 void error(char* fmt, ...)
     65void error(const char* fmt, ...)
    6666{
    6767   char buf[4096];
  • Singular/ipshell.cc

    reb3c5f1 r8907a4  
    12191219    //Print("branchTo: %s\n",h->Name());
    12201220    iiCurrProc=(idhdl)h->data;
    1221     err=iiAllStart(IDPROC(iiCurrProc),IDPROC(iiCurrProc)->data.s.body,BT_proc,IDPROC(iiCurrProc)->data.s.body_lineno-(iiCurrArgs==NULL));
     1221    procinfo * pi=IDPROC(iiCurrProc);
     1222    if( pi->data.s.body==NULL )
     1223    {
     1224      iiGetLibProcBuffer(pi);
     1225      if (pi->data.s.body==NULL) return TRUE;
     1226    }
     1227    err=iiAllStart(pi,pi->data.s.body,BT_proc,pi->data.s.body_lineno-(iiCurrArgs==NULL));
    12221228    exitBuffer(BT_proc);
    12231229    if (iiCurrArgs!=NULL)
Note: See TracChangeset for help on using the changeset viewer.