Changeset 5f24ec in git


Ignore:
Timestamp:
May 15, 2015, 3:29:47 PM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
Children:
794d7ba210aeabf2fc6caef7b75934cab4be8acf
Parents:
7fc7218d475bdaf643d2aa7e73ce714d3cd81101
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-05-15 15:29:47+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-05-27 17:34:53+02:00
Message:
Reviewing 0-size ideals/modules

ADD: added assume's, esp. concerning corner cases
ADD: doxygen documentation for id* functions and sip_sideal structure
CHG: minor improvements
CHG: moved id_IsModule back to where it came from

NOTE: id_Delete will also be used for dense matrices
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/syzextra/mod_main.cc

    r7fc721 r5f24ec  
    6767BEGIN_NAMESPACE_NONAME
    6868
     69// returns TRUE, if idRankFreeModule(m) > 0 ???
     70/// test whether this input has vectors among entries or no enties
     71/// result must be FALSE for only 0-entries
     72static BOOLEAN id_IsModule(ideal id, ring r)
     73{
     74  id_Test(id, r);
     75
     76  if( id->rank != 1 ) return TRUE;
     77
     78  if (rRing_has_Comp(r))
     79  {
     80    const int l = IDELEMS(id);
     81
     82    for (int j=0; j<l; j++)
     83      if (id->m[j] != NULL && p_GetComp(id->m[j], r) > 0)
     84        return TRUE;   
     85
     86    return FALSE; // rank: 1, only zero or no entries? can be an ideal OR module... BUT in the use-case should better be an ideal!
     87  }
     88
     89  return FALSE;
     90}
     91
     92
     93   
    6994
    7095static inline void NoReturn(leftv& res)
     
    15251550  const int iLimit = r->typ[pos].data.is.limit;
    15261551  const ideal F = r->typ[pos].data.is.F;
     1552 
    15271553  ideal FF = id_Copy(F, r);
    1528 
    1529 
    15301554
    15311555  lists l=(lists)omAllocBin(slists_bin);
     
    15381562  //        l->m[1].rtyp = MODUL_CMD;
    15391563
    1540   if( idIsModule(FF, r) )
     1564  if( id_IsModule(FF, r) ) // ???
    15411565  {
    15421566    l->m[1].rtyp = MODUL_CMD;
  • kernel/ideals.h

    r7fc721 r5f24ec  
    104104BOOLEAN idIs0 (ideal h);
    105105
    106 // returns TRUE, if idRankFreeModule(m) > 0
    107 BOOLEAN idIsModule(ideal m, const ring r);
    108 
    109106inline BOOLEAN idHomIdeal (ideal id, ideal Q=NULL)
    110107{
  • libpolys/polys/simpleideals.cc

    r7fc721 r5f24ec  
    3535/*index of the actual monomial in idpower*/
    3636
    37 /*2
    38 * initialise an ideal
    39 */
     37/// initialise an ideal / module
    4038ideal idInit(int idsize, int rank)
    4139{
    42   /*- initialise an ideal/module -*/
    43   ideal hh = (ideal )omAllocBin(sip_sideal_bin);
    44   hh->nrows = 1;
    45   hh->rank = rank;
    46   IDELEMS(hh) = idsize;
     40  assume( idsize >= 0 && rank >= 0 );
     41 
     42  ideal hh = (ideal)omAllocBin(sip_sideal_bin);
     43
     44  IDELEMS(hh) = idsize; // ncols
     45  hh->nrows = 1; // ideal/module!
     46
     47  hh->rank = rank; // ideal: 1, module: >= 0!
     48 
    4749  if (idsize>0)
    48   {
    4950    hh->m = (poly *)omAlloc0(idsize*sizeof(poly));
    50   }
    5151  else
    52     hh->m=NULL;
     52    hh->m = NULL;
     53 
    5354  return hh;
    5455}
     
    9798}
    9899
    99 /*2
    100 * initialise the maximal ideal (at 0)
    101 */
     100/// initialise the maximal ideal (at 0)
    102101ideal id_MaxIdeal (const ring r)
    103102{
    104   int l;
    105   ideal hh=NULL;
    106 
    107   hh=idInit(rVar(r),1);
    108   for (l=0; l<rVar(r); l++)
     103  const int N = rVar(r);
     104  ideal hh = idInit(N, 1);
     105  for (int l=0; l < N; l++)
    109106  {
    110107    hh->m[l] = p_One(r);
     
    112109    p_Setm(hh->m[l],r);
    113110  }
     111  id_Test(hh, r);
    114112  return hh;
    115113}
    116114
    117 /*2
    118 * deletes an ideal/matrix
    119 */
     115/// deletes an ideal/module/matrix
    120116void id_Delete (ideal * h, ring r)
    121117{
    122   int j,elems;
    123118  if (*h == NULL)
    124119    return;
    125   elems=j=(*h)->nrows*(*h)->ncols;
    126   if (j>0)
    127   {
     120
     121  id_Test(*h, r);
     122 
     123  const int elems = (*h)->nrows * (*h)->ncols;
     124
     125  if ( elems > 0 )
     126  {
     127    assume( (*h)->m != NULL );
     128   
     129    int j = elems;
    128130    do
    129131    {
     
    132134      if (pp!=NULL) p_Delete(&pp, r);
    133135    }
     136    while (j>0);   
     137   
     138    omFreeSize((ADDRESS)((*h)->m),sizeof(poly)*elems);
     139  }
     140 
     141  omFreeBin((ADDRESS)*h, sip_sideal_bin);
     142  *h=NULL;
     143}
     144
     145
     146/// Shallowdeletes an ideal/matrix
     147void id_ShallowDelete (ideal *h, ring r)
     148{
     149  id_Test(*h, r);
     150 
     151  if (*h == NULL)
     152    return;
     153 
     154  int j,elems;
     155  elems=j=(*h)->nrows*(*h)->ncols;
     156  if (j>0)
     157  {
     158    assume( (*h)->m != NULL );
     159    do
     160    {
     161      p_ShallowDelete(&((*h)->m[--j]), r);
     162    }
    134163    while (j>0);
    135164    omFreeSize((ADDRESS)((*h)->m),sizeof(poly)*elems);
     
    139168}
    140169
    141 
    142 /*2
    143 * Shallowdeletes an ideal/matrix
    144 */
    145 void id_ShallowDelete (ideal *h, ring r)
    146 {
    147   int j,elems;
    148   if (*h == NULL)
    149     return;
    150   elems=j=(*h)->nrows*(*h)->ncols;
    151   if (j>0)
    152   {
    153     do
    154     {
    155       p_ShallowDelete(&((*h)->m[--j]), r);
    156     }
    157     while (j>0);
    158     omFreeSize((ADDRESS)((*h)->m),sizeof(poly)*elems);
    159   }
    160   omFreeBin((ADDRESS)*h, sip_sideal_bin);
    161   *h=NULL;
    162 }
    163 
    164 /*2
    165 *gives an ideal the minimal possible size
    166 */
     170/// gives an ideal/module the minimal possible size
    167171void idSkipZeroes (ideal ide)
    168172{
     173  assume (ide != NULL);
     174 
    169175  int k;
    170176  int j = -1;
    171   BOOLEAN change=FALSE;
     177  BOOLEAN change=FALSE; 
     178 
    172179  for (k=0; k<IDELEMS(ide); k++)
    173180  {
     
    199206}
    200207
     208/// count non-zero elements
    201209int idElem(const ideal F)
    202210{
     211  assume (F != NULL);
     212 
    203213  int i=0,j=IDELEMS(F)-1;
    204214
     
    211221}
    212222
    213 /*2
    214 * copies the first k (>= 1) entries of the given ideal
    215 * and returns these as a new ideal
    216 * (Note that the copied polynomials may be zero.)
    217 */
     223/// copies the first k (>= 1) entries of the given ideal/module
     224/// and returns these as a new ideal/module
     225/// (Note that the copied entries may be zero.)
    218226ideal id_CopyFirstK (const ideal ide, const int k,const ring r)
    219227{
    220   ideal newI = idInit(k, 0);
     228  id_Test(ide, r);
     229 
     230  assume( ide != NULL );
     231  assume( k <= IDELEMS(ide) );
     232 
     233  ideal newI = idInit(k, ide->rank);
     234 
    221235  for (int i = 0; i < k; i++)
    222236    newI->m[i] = p_Copy(ide->m[i],r);
     237 
    223238  return newI;
    224239}
    225240
    226 /*2
    227 * ideal id = (id[i])
    228 * result is leadcoeff(id[i]) = 1
    229 */
     241/// ideal id = (id[i]), result is leadcoeff(id[i]) = 1
    230242void id_Norm(ideal id, const ring r)
    231243{
     244  id_Test(id, r);
    232245  for (int i=IDELEMS(id)-1; i>=0; i--)
    233246  {
     
    239252}
    240253
    241 /*2
    242 * ideal id = (id[i]), c any unit
    243 * if id[i] = c*id[j] then id[j] is deleted for j > i
    244 */
     254/// ideal id = (id[i]), c any unit
     255/// if id[i] = c*id[j] then id[j] is deleted for j > i
    245256void id_DelMultiples(ideal id, const ring r)
    246257{
     258  id_Test(id, r);
     259
    247260  int i, j;
    248261  int k = IDELEMS(id)-1;
     
    278291}
    279292
    280 /*2
    281 * ideal id = (id[i])
    282 * if id[i] = id[j] then id[j] is deleted for j > i
    283 */
     293/// ideal id = (id[i])
     294/// if id[i] = id[j] then id[j] is deleted for j > i
    284295void id_DelEquals(ideal id, const ring r)
    285296{
     297  id_Test(id, r);
     298
    286299  int i, j;
    287300  int k = IDELEMS(id)-1;
     
    302315}
    303316
    304 //
    305 // Delete id[j], if Lm(j) == Lm(i) and both LC(j), LC(i) are units and j > i
    306 //
     317/// Delete id[j], if Lm(j) == Lm(i) and both LC(j), LC(i) are units and j > i
    307318void id_DelLmEquals(ideal id, const ring r)
    308319{
     320  id_Test(id, r);
     321
    309322  int i, j;
    310323  int k = IDELEMS(id)-1;
     
    329342}
    330343
    331 //
    332 // delete id[j], if LT(j) == coeff*mon*LT(i) and vice versa, i.e.,
    333 // delete id[i], if LT(i) == coeff*mon*LT(j)
    334 //
     344/// delete id[j], if LT(j) == coeff*mon*LT(i) and vice versa, i.e.,
     345/// delete id[i], if LT(i) == coeff*mon*LT(j)
    335346void id_DelDiv(ideal id, const ring r)
    336347{
     348  id_Test(id, r);
     349 
    337350  int i, j;
    338351  int k = IDELEMS(id)-1;
     
    380393}
    381394
    382 /*2
    383 *test if the ideal has only constant polynomials
    384 */
     395/// test if the ideal has only constant polynomials
     396/// NOTE: zero ideal/module is also constant
    385397BOOLEAN id_IsConstant(ideal id, const ring r)
    386398{
    387   int k;
    388   for (k = IDELEMS(id)-1; k>=0; k--)
     399  id_Test(id, r);
     400 
     401  for (int k = IDELEMS(id)-1; k>=0; k--)
    389402  {
    390403    if (!p_IsConstantPoly(id->m[k],r))
     
    394407}
    395408
    396 /*2
    397 * copy an ideal
    398 */
     409/// copy an ideal
    399410ideal id_Copy(ideal h1, const ring r)
    400411{
    401   int i;
    402   ideal h2 =idInit(IDELEMS(h1),h1->rank);
    403   for (i=IDELEMS(h1)-1; i>=0; i--)
     412  id_Test(h1, r);
     413
     414  ideal h2 = idInit(IDELEMS(h1), h1->rank);
     415  for (int i=IDELEMS(h1)-1; i>=0; i--)
    404416    h2->m[i] = p_Copy(h1->m[i],r);
    405417  return h2;
     
    407419
    408420#ifdef PDEBUG
     421/// Internal verification for ideals/modules and dense matrices!
    409422void id_DBTest(ideal h1, int level, const char *f,const int l, const ring r, const ring tailRing)
    410423{
    411   int i;
    412 
    413424  if (h1 != NULL)
    414   {
     425  { 
    415426    // assume(IDELEMS(h1) > 0); for ideal/module, does not apply to matrix
    416427    omCheckAddrSize(h1,sizeof(*h1));
    417     omdebugAddrSize(h1->m,h1->ncols*h1->nrows*sizeof(poly));
     428
     429    assume( h1->ncols >= 0 );
     430    assume( h1->nrows >= 0 ); // matrix case!
     431   
     432    assume( h1->rank >= 0 );
     433
     434    const int n = (h1->ncols * h1->nrows);
     435
     436    assume( !( n > 0 && h1->m == NULL) );
     437
     438    if( h1->m != NULL && n > 0 )
     439      omdebugAddrSize(h1->m, n * sizeof(poly));
     440   
     441    long new_rk = 0; // inlining id_RankFreeModule(h1, r, tailRing);
    418442
    419443    /* to be able to test matrices: */
    420     for (i=(h1->ncols*h1->nrows)-1; i>=0; i--)
     444    for (int i=n - 1; i >= 0; i--)
     445    {
    421446      _pp_Test(h1->m[i], r, tailRing, level);
    422 
    423     int new_rk=id_RankFreeModule(h1, r, tailRing);
     447      const long k = p_MaxComp(h1->m[i], r, tailRing);
     448      if (k > new_rk) new_rk = k;
     449    }
     450
     451    // dense matrices only contain polynomials:
     452    // h1->nrows == h1->rank > 1 && new_rk == 0!
     453    assume( !( h1->nrows == h1->rank && h1->nrows > 1 && new_rk > 0 ) ); //
     454   
    424455    if(new_rk > h1->rank)
    425456    {
     
    427458                   h1->rank, new_rk, f,l);
    428459      omPrintAddrInfo(stderr, h1, " for ideal");
    429       h1->rank=new_rk;
     460      h1->rank = new_rk;
    430461    }
    431462  }
    432463  else
     464  {
    433465    Print("error: ideal==NULL in %s:%d\n",f,l);
     466    assume( h1 != NULL );
     467  }
    434468}
    435469#endif
    436470
    437 ///3 for idSort: compare a and b revlex inclusive module comp.
     471/// for idSort: compare a and b revlex inclusive module comp.
    438472static int p_Comp_RevLex(poly a, poly b,BOOLEAN nolex, const ring R)
    439473{
     
    472506intvec *id_Sort(const ideal id, const BOOLEAN nolex, const ring r)
    473507{
     508  id_Test(id, r);
     509
    474510  intvec * result = new intvec(IDELEMS(id));
    475511  int i, j, actpos=0, newpos;
     
    562598}
    563599
    564 /*2
    565 * concat the lists h1 and h2 without zeros
    566 */
     600/// concat the lists h1 and h2 without zeros
    567601ideal id_SimpleAdd (ideal h1,ideal h2, const ring R)
    568602{
    569   int i,j,r,l;
    570   ideal result;
    571 
    572   j = IDELEMS(h1)-1;
     603  id_Test(h1, R);
     604  id_Test(h2, R);
     605 
     606  if ( idIs0(h1) ) return id_Copy(h2,R);
     607  if ( idIs0(h2) ) return id_Copy(h1,R);
     608
     609  int j = IDELEMS(h1)-1;
    573610  while ((j >= 0) && (h1->m[j] == NULL)) j--;
    574   i = IDELEMS(h2)-1;
     611 
     612  int i = IDELEMS(h2)-1;
    575613  while ((i >= 0) && (h2->m[i] == NULL)) i--;
    576   r = si_max(h1->rank,h2->rank);
    577   if (i+j==(-2))
    578     return idInit(1,r);
    579   else
    580     result=idInit(i+j+2,r);
     614 
     615  const int r = si_max(h1->rank, h2->rank);
     616 
     617  ideal result = idInit(i+j+2,r);
     618
     619  int l;
     620 
    581621  for (l=j; l>=0; l--)
    582   {
    583622    result->m[l] = p_Copy(h1->m[l],R);
    584   }
    585   r = i+j+1;
    586   for (l=i; l>=0; l--, r--)
    587   {
    588     result->m[r] = p_Copy(h2->m[l],R);
    589   }
     623 
     624  j = i+j+1;
     625  for (l=i; l>=0; l--, j--)
     626    result->m[j] = p_Copy(h2->m[l],R);
     627 
    590628  return result;
    591629}
    592630
    593 /*2
    594 * insert h2 into h1 (if h2 is not the zero polynomial)
    595 * return TRUE iff h2 was indeed inserted
    596 */
     631/// insert h2 into h1 (if h2 is not the zero polynomial)
     632/// return TRUE iff h2 was indeed inserted
    597633BOOLEAN idInsertPoly (ideal h1, poly h2)
    598634{
    599635  if (h2==NULL) return FALSE;
    600   int j = IDELEMS(h1)-1;
     636  assume (h1 != NULL);
     637 
     638  int j = IDELEMS(h1) - 1;
     639 
    601640  while ((j >= 0) && (h1->m[j] == NULL)) j--;
    602641  j++;
     
    610649}
    611650
    612 /*2
    613 * insert h2 into h1 depending on the two boolean parameters:
    614 * - if zeroOk is true, then h2 will also be inserted when it is zero
    615 * - if duplicateOk is true, then h2 will also be inserted when it is
    616 *   already present in h1
    617 * return TRUE iff h2 was indeed inserted
    618 */
     651
     652/*! insert h2 into h1 depending on the two boolean parameters:
     653 * - if zeroOk is true, then h2 will also be inserted when it is zero
     654 * - if duplicateOk is true, then h2 will also be inserted when it is
     655 *   already present in h1
     656 * return TRUE iff h2 was indeed inserted
     657 */
    619658BOOLEAN id_InsertPolyWithTests (ideal h1, const int validEntries,
    620659  const poly h2, const bool zeroOk, const bool duplicateOk, const ring r)
    621660{
     661  id_Test(h1, r);
     662  p_Test(h2, r);
     663
    622664  if ((!zeroOk) && (h2 == NULL)) return FALSE;
    623665  if (!duplicateOk)
     
    641683}
    642684
    643 /*2
    644 * h1 + h2
    645 */
     685/// h1 + h2
    646686ideal id_Add (ideal h1,ideal h2, const ring r)
    647687{
     688  id_Test(h1, r);
     689  id_Test(h2, r);
     690
    648691  ideal result = id_SimpleAdd(h1,h2,r);
    649692  id_Compactify(result,r);
     
    651694}
    652695
    653 /*2
    654 * h1 * h2
    655 */
     696/// h1 * h2
     697/// h1 must be an ideal (with at least one column)
     698/// h2 may be a module (with no columns at all)
    656699ideal  id_Mult (ideal h1,ideal  h2, const ring r)
    657700{
    658   int i,j,k;
    659   ideal  hh;
    660 
    661   j = IDELEMS(h1);
     701  id_Test(h1, r);
     702  id_Test(h2, r);
     703
     704  assume( h1->rank == 1 );
     705
     706  int j = IDELEMS(h1);
    662707  while ((j > 0) && (h1->m[j-1] == NULL)) j--;
    663   i = IDELEMS(h2);
     708 
     709  int i = IDELEMS(h2);
    664710  while ((i > 0) && (h2->m[i-1] == NULL)) i--;
     711
    665712  j = j * i;
    666   if (j == 0)
    667     hh = idInit(1,1);
    668   else
    669     hh=idInit(j,1);
    670   if (h1->rank<h2->rank)
    671     hh->rank = h2->rank;
    672   else
    673     hh->rank = h1->rank;
     713 
     714  ideal  hh = idInit(j, si_max( h2->rank, h1->rank ));
     715 
    674716  if (j==0) return hh;
    675   k = 0;
     717 
     718  int k = 0;
    676719  for (i=0; i<IDELEMS(h1); i++)
    677720  {
     
    688731    }
    689732  }
    690   {
    691     id_Compactify(hh,r);
    692     return hh;
    693   }
    694 }
    695 
    696 /*2
    697 *returns true if h is the zero ideal
    698 */
     733 
     734  id_Compactify(hh,r);
     735  return hh;
     736}
     737
     738/// returns true if h is the zero ideal
    699739BOOLEAN idIs0 (ideal h)
    700740{
    701   int i;
    702 
    703   i = IDELEMS(h)-1;
    704   while ((i >= 0) && (h->m[i] == NULL))
    705   {
    706     i--;
    707   }
    708   if (i < 0)
    709     return TRUE;
    710   else
    711     return FALSE;
    712 }
    713 
    714 /*2
    715 * return the maximal component number found in any polynomial in s
    716 */
     741  assume (h != NULL); // will fail :(
     742//  if (h == NULL) return TRUE;
     743 
     744  for( int i = IDELEMS(h)-1; i >= 0; i-- )   
     745    if(h->m[i] != NULL)
     746      return FALSE;
     747
     748  return TRUE;
     749
     750}
     751
     752/// return the maximal component number found in any polynomial in s
    717753long id_RankFreeModule (ideal s, ring lmRing, ring tailRing)
    718754{
    719   long  j=0;
     755  id_TestTail(s, lmRing, tailRing);
     756 
     757  long j = 0;
    720758
    721759  if (rRing_has_Comp(tailRing) && rRing_has_Comp(lmRing))
     
    723761    poly *p=s->m;
    724762    for (unsigned int l=IDELEMS(s); l > 0; --l, ++p)
    725     {
    726       if (*p!=NULL)
     763      if (*p != NULL)
    727764      {
    728765        pp_Test(*p, lmRing, tailRing);
     
    730767        if (k>j) j = k;
    731768      }
    732     }
    733   }
    734   return j;
    735 }
    736 
    737 BOOLEAN idIsModule(ideal id, ring r)
    738 {
    739   if (rRing_has_Comp(r))
    740   {
    741     int j, l = IDELEMS(id);
    742     for (j=0; j<l; j++)
    743     {
    744       if (id->m[j] != NULL && p_GetComp(id->m[j], r) > 0) return TRUE;
    745     }
    746   }
    747   return FALSE;
    748 }
    749 
     769  }
     770 
     771  return j; //  return -1;
     772}
    750773
    751774/*2
     
    879902}
    880903
    881 /*2
    882 *the free module of rank i
    883 */
     904
     905/// the free module of rank i
    884906ideal id_FreeModule (int i, const ring r)
    885907{
    886   int j;
    887   ideal h;
    888 
    889   h=idInit(i,i);
    890   for (j=0; j<i; j++)
     908  assume(i >= 0);
     909  ideal h = idInit(i, i);
     910 
     911  for (int j=0; j<i; j++)
    891912  {
    892913    h->m[j] = p_One(r);
     
    894915    p_SetmComp(h->m[j],r);
    895916  }
     917 
    896918  return h;
    897919}
     
    10571079}
    10581080
    1059 /*2
    1060 * returns the ideals of initial terms
    1061 */
     1081/// returns the ideals of initial terms
    10621082ideal id_Head(ideal h,const ring r)
    10631083{
    10641084  ideal m = idInit(IDELEMS(h),h->rank);
    1065   int i;
    1066 
    1067   for (i=IDELEMS(h)-1;i>=0; i--)
    1068   {
    1069     if (h->m[i]!=NULL) m->m[i]=p_Head(h->m[i],r);
    1070   }
     1085
     1086  for (int i=IDELEMS(h)-1;i>=0; i--)
     1087    if (h->m[i]!=NULL)
     1088      m->m[i]=p_Head(h->m[i],r);
     1089 
    10711090  return m;
    10721091}
     
    13561375  r->ncols = i-> ncols;
    13571376  //r->rank = i-> rank;
    1358   int k;
    1359   for(k=(i->nrows)*(i->ncols)-1;k>=0; k--)
    1360   {
     1377 
     1378  for(int k=(i->nrows)*(i->ncols)-1;k>=0; k--)
    13611379    r->m[k]=pp_Jet(i->m[k],d,R);
    1362   }
     1380 
    13631381  return r;
    13641382}
     
    17221740void id_Shift(ideal M, int s, const ring r)
    17231741{
     1742//  id_Test( M, r );
     1743
     1744//  assume( s >= 0 ); // negative is also possible // TODO: verify input ideal in such a case!?
     1745 
    17241746  for(int i=IDELEMS(M)-1; i>=0;i--)
    1725   {
    17261747    p_Shift(&(M->m[i]),s,r);
    1727   }
     1748 
    17281749  M->rank += s;
    1729 }
     1750 
     1751//  id_Test( M, r );
     1752}
  • libpolys/polys/simpleideals.h

    r7fc721 r5f24ec  
    1111#include <polys/matpol.h>
    1212
     13/// The following sip_sideal structure has many different uses
     14/// thoughout Singular. Basic use-cases for it are:
     15/// * ideal/module: nrows = 1, ncols >=0 and rank:1 for ideals, rank>=0 for modules
     16/// * matrix: nrows, ncols >=0, rank == nrows! see mp_* procedures
     17/// NOTE: the m member point to memory chunk of size (ncols*nrows*sizeof(poly)) or is NULL
    1318struct sip_sideal
    1419{
     
    5257extern omBin sip_sideal_bin;
    5358
    54 /*- creates an ideal -*/
     59/// creates an ideal / module
    5560ideal idInit (int size, int rank=1);
    5661
     
    9196static inline long id_RankFreeModule(ideal m, ring r)
    9297{return id_RankFreeModule(m, r, r);}
    93 // returns TRUE, if idRankFreeModule(m) > 0
    94 BOOLEAN id_IsModule(ideal m, ring r);
     98
    9599ideal   id_FreeModule (int i, const ring r);
    96100int     idElem(const ideal F);
Note: See TracChangeset for help on using the changeset viewer.