Changeset 72382c2 in git


Ignore:
Timestamp:
Dec 12, 2008, 6:27:01 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
73b186d5bc4b455e4e5d630d447f6d74c3cb0f80
Parents:
148455ccfcf8b41197478663486901ebf24ab661
Message:
*hannes: dupl. proc: num_of_vars->surf.lib


git-svn-id: file:///usr/local/Singular/svn/trunk@11248 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/surf.lib

    r148455 r72382c2  
    11// last modified 21.07.2005, Oliver Wienand
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: surf.lib,v 1.28 2007-07-13 12:31:06 Singular Exp $";
     3version="$Id: surf.lib,v 1.29 2008-12-12 17:27:01 Singular Exp $";
    44category="Visualization";
    55info="
     
    2424
    2525///////////////////////////////////////////////////////////////////////////////
    26 static proc num_of_vars(ideal I)
     26proc num_of_vars(ideal I)
     27"USAGE: num_of_vars(ideal I)
     28
     29RETURN: an intvec containing one entry for each ring variable.
     30each contains the sums of all degrees in this variable of all monomials
     31occuring in the ideal.
     32An entry is zero iff the corresponding variable does not occur in the ideal.
     33"
    2734{
    2835  intvec v;
    2936  int i;
    3037  poly p;
    31   for(i=size(I);i>0;i--)
     38  for(i=ncols(I);i>0;i--)
    3239  {
    3340    p=I[i];
     
    3946  }
    4047  return(v);
     48}
     49example
     50{
     51  "EXAMPLE:"; echo = 2;
     52  ring r = 0, (x,y,z),dp;
     53  ideal j0 = x^2-x*y;
     54  num_of_vars(j0);
     55  ideal j1 = x^2-x*y-y;
     56  num_of_vars(j1);
     57  ideal j2 = x^2-x*y-y, x^3-2*y;
     58  num_of_vars(j2);
    4159}
    4260
  • Singular/LIB/surfex.lib

    r148455 r72382c2  
    11//last change: 2007/07/06 (Oliver Labs)
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: surfex.lib,v 1.7 2008-10-13 21:32:53 keilen Exp $";
     3version="$Id: surfex.lib,v 1.8 2008-12-12 17:27:01 Singular Exp $";
    44category="Visualization";
    55info="
     
    3636LIB "primdec.lib";
    3737LIB "sing.lib";
     38LIB "surf.lib";
    3839
    3940///////////////////////////////////////////////////////////
     
    11001101
    11011102
    1102 proc num_of_vars(ideal I)
    1103 "
    1104 USAGE: num_of_vars(ideal I)
    1105 
    1106 RETURN: an intvec containing one entry for each ring variable.
    1107 each contains the sums of all degrees in this variable of all monomials
    1108 occuring in the ideal.
    1109 An entry is zero iff the corresponding variable does not occur in the ideal.
    1110 "
    1111 {
    1112   intvec v;
    1113   int i;
    1114   poly p;
    1115   for(i=size(I);i>0;i--)
    1116   {
    1117     p=I[i];
    1118     while(p!=0)
    1119     {
    1120         v=v+leadexp(p);
    1121         p=p-lead(p);
    1122     }
    1123   }
    1124   return(v);
    1125 }
    1126 example {
    1127     "EXAMPLE:"; echo = 2;
    1128     ring r = 0, (x,y,z),dp;
    1129     ideal j0 = x^2-x*y;
    1130     num_of_vars(j0);
    1131     ideal j1 = x^2-x*y-y;
    1132     num_of_vars(j1);
    1133     ideal j2 = x^2-x*y-y, x^3-2*y;
    1134     num_of_vars(j2);
    1135 }
    1136 
    1137 
    11381103proc num_vars_id(ideal I)
    11391104"
Note: See TracChangeset for help on using the changeset viewer.