Macros | Functions
mod_main.cc File Reference
#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <misc/intvec.h>
#include <misc/options.h>
#include <coeffs/coeffs.h>
#include <polys/PolyEnumerator.h>
#include <polys/monomials/p_polys.h>
#include <polys/monomials/ring.h>
#include <polys/simpleideals.h>
#include <kernel/GBEngine/kstd1.h>
#include <kernel/polys.h>
#include <kernel/GBEngine/syz.h>
#include <Singular/tok.h>
#include <Singular/ipid.h>
#include <Singular/lists.h>
#include <Singular/attrib.h>
#include <Singular/ipshell.h>
#include "singularxx_defs.h"
#include "DebugPrint.h"
#include "myNF.h"
#include "syzextra.h"
#include <Singular/mod_lib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define PRINT_pINTVECTOR(s, v)
 
#define PRINT_RESOLUTION(s, v)
 
#define PRINT_POINTER(s, v)   Print("pointer '%17s': %p", #v, reinterpret_cast<const void*>((s)->v)); PrintLn();
 
#define ADD(C, D, E)   psModulFunctions->iiAddCproc((currPack->libname? currPack->libname: ""), (char*)C, D, E);
 

Functions

void pISUpdateComponents (ideal F, const intvec *const V, const int MIN, const ring r)
 
ring rAssure_InducedSchreyerOrdering (const ring r, BOOLEAN complete, int sign)
 
int rGetISPos (const int p, const ring r)
 Finds p^th IS ordering, and returns its position in r->typ[] returns -1 if something went wrong! p - starts with 0! More...
 
 USING_NAMESPACE (SINGULARXXNAME::DEBUG) USING_NAMESPACE(SINGULARXXNAME
 
static void NoReturn (leftv &res)
 
static BOOLEAN _ClearContent (leftv res, leftv h)
 wrapper around n_ClearContent More...
 
static BOOLEAN _ClearDenominators (leftv res, leftv h)
 wrapper around n_ClearDenominators More...
 
static int getOptionalInteger (const leftv &h, const int _n)
 try to get an optional (simple) integer argument out of h or return the default value More...
 
static BOOLEAN noop (leftv __res, leftv)
 
static BOOLEAN _ProfilerStart (leftv __res, leftv h)
 
static BOOLEAN _ProfilerStop (leftv __res, leftv)
 
static number jjLONG2N (long d)
 
static void view (const intvec *v)
 
static BOOLEAN DetailedPrint (leftv __res, leftv h)
 
static BOOLEAN Tail (leftv res, leftv h)
 wrapper around p_Tail and id_Tail More...
 
static BOOLEAN _ComputeLeadingSyzygyTerms (leftv res, leftv h)
 
static BOOLEAN _Sort_c_ds (leftv res, leftv h)
 sorting wrt <c,ds> & reversing... change the input inplace!!! More...
 
static BOOLEAN _Compute2LeadingSyzygyTerms (leftv res, leftv h)
 
static BOOLEAN _FindReducer (leftv res, leftv h)
 proc SSFindReducer(def product, def syzterm, def L, def T, list #) More...
 
static BOOLEAN _SchreyerSyzygyNF (leftv res, leftv h)
 
static BOOLEAN _ReduceTerm (leftv res, leftv h)
 proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #) More...
 
static BOOLEAN _TraverseTail (leftv res, leftv h)
 
static BOOLEAN _ComputeResolution (leftv res, leftv h)
 
static BOOLEAN _ComputeSyzygy (leftv res, leftv h)
 module (LL, TT) = SSComputeSyzygy(L, T); Compute Syz(L ++ T) = N = LL ++ TT More...
 
static BOOLEAN _leadmonom (leftv res, leftv h)
 Get leading term without a module component. More...
 
static BOOLEAN leadcomp (leftv res, leftv h)
 Get leading component. More...
 
static BOOLEAN leadrawexp (leftv res, leftv h)
 Get raw leading exponent vector. More...
 
static BOOLEAN MakeSyzCompOrdering (leftv res, leftv)
 Endowe the current ring with additional (leading) Syz-component ordering. More...
 
static BOOLEAN MakeInducedSchreyerOrdering (leftv res, leftv h)
 Same for Induced Schreyer ordering (ordering on components is defined by sign!) More...
 
static BOOLEAN SetSyzComp (leftv res, leftv h)
 Returns old SyzCompLimit, can set new limit. More...
 
static BOOLEAN GetInducedData (leftv res, leftv h)
 ? More...
 
static BOOLEAN SetInducedReferrence (leftv res, leftv h)
 Returns old SyzCompLimit, can set new limit. More...
 
static BOOLEAN ISUpdateComponents (leftv res, leftv h)
 
static BOOLEAN reduce_syz (leftv res, leftv h)
 NF using length. More...
 
static BOOLEAN idPrepare (leftv res, leftv h)
 Get raw syzygies (idPrepare) More...
 
static BOOLEAN _p_Content (leftv res, leftv h)
 Get raw syzygies (idPrepare) More...
 
static BOOLEAN _m2_end (leftv res, leftv h)
 
static BOOLEAN _NumberStatsInit (leftv res, leftv h)
 
static BOOLEAN _NumberStatsPrint (leftv res, leftv h)
 
END_NAMESPACE int SI_MOD_INIT() syzextra (SModulFunctions *psModulFunctions)
 

Macro Definition Documentation

#define ADD (   C,
  D,
  E 
)    psModulFunctions->iiAddCproc((currPack->libname? currPack->libname: ""), (char*)C, D, E);
#define PRINT_pINTVECTOR (   s,
  v 
)
Value:
Print("intvec '%10s'(%p)", #v, reinterpret_cast<const void*>((s)->v)); \
if( (s)->v != NULL ){ PrintS(": "); view((s)->v); }; \
const CanonicalForm int s
Definition: facAbsFact.cc:55
static void view(const intvec *v)
Definition: mod_main.cc:252
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
if(0 > strat->sl)
Definition: myNF.cc:73
void PrintS(const char *s)
Definition: reporter.cc:294
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
#define PRINT_POINTER (   s,
  v 
)    Print("pointer '%17s': %p", #v, reinterpret_cast<const void*>((s)->v)); PrintLn();
#define PRINT_RESOLUTION (   s,
  v 
)
Value:
Print("resolution '%12s': %p", #v, reinterpret_cast<const void*>((s)->v)); PrintLn(); \
if ((s)->v != NULL) \
for (int iLevel = 0; (iLevel < iLength) && ( ((s)->v)[iLevel] != NULL ); iLevel++) \
{ \
/* const ring rrr = (iLevel > 0) ? save : save; */ \
Print("id '%10s'[%d]: (%p) ncols = %d / size: %d; nrows = %d, rank = %ld / rk: %ld", #v, iLevel, reinterpret_cast<const void*>(((s)->v)[iLevel]), ((s)->v)[iLevel]->ncols, idSize(((s)->v)[iLevel]), ((s)->v)[iLevel]->nrows, ((s)->v)[iLevel]->rank, -1L/*id_RankFreeModule(((s)->v)[iLevel], rrr)*/ ); \
} \
const CanonicalForm int s
Definition: facAbsFact.cc:55
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
if(0 > strat->sl)
Definition: myNF.cc:73
for(int i=0;i< R->ExpL_Size;i++) Print("%09lx "
Definition: cfEzgcd.cc:66
int nrows
Definition: cf_linsys.cc:32
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int int ncols
Definition: cf_linsys.cc:32
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43

Function Documentation

static BOOLEAN _ClearContent ( leftv  res,
leftv  h 
)
static

wrapper around n_ClearContent

Definition at line 102 of file mod_main.cc.

103 {
104  NoReturn(res);
105 
106  const char *usage = "'ClearContent' needs a (non-zero!) poly or vector argument...";
107 
108  if( h == NULL )
109  {
110  WarnS(usage);
111  return TRUE;
112  }
113 
114  assume( h != NULL );
115 
116  if( !( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD) )
117  {
118  WarnS(usage);
119  return TRUE;
120  }
121 
122  assume (h->Next() == NULL);
123 
124  poly ph = reinterpret_cast<poly>(h->Data());
125 
126  if( ph == NULL )
127  {
128  WarnS(usage);
129  return TRUE;
130  }
131 
132  const ring r = currRing;
133  assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf;
134 
135  number n;
136 
137  // experimentall (recursive enumerator treatment) of alg. ext
138  CPolyCoeffsEnumerator itr(ph);
139  n_ClearContent(itr, n, C);
140 
141  res->data = n;
142  res->rtyp = NUMBER_CMD;
143 
144  return FALSE;
145 }
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
static FORCE_INLINE void n_ClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Computes the content and (inplace) divides it out on a collection of numbers number c is the content ...
Definition: coeffs.h:931
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
polyrec * poly
Definition: hilb.h:10
static BOOLEAN _ClearDenominators ( leftv  res,
leftv  h 
)
static

wrapper around n_ClearDenominators

Definition at line 148 of file mod_main.cc.

149 {
150  NoReturn(res);
151 
152  const char *usage = "'ClearDenominators' needs a (non-zero!) poly or vector argument...";
153 
154  if( h == NULL )
155  {
156  WarnS(usage);
157  return TRUE;
158  }
159 
160  assume( h != NULL );
161 
162  if( !( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD) )
163  {
164  WarnS(usage);
165  return TRUE;
166  }
167 
168  assume (h->Next() == NULL);
169 
170  poly ph = reinterpret_cast<poly>(h->Data());
171 
172  if( ph == NULL )
173  {
174  WarnS(usage);
175  return TRUE;
176  }
177 
178  const ring r = currRing;
179  assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf;
180 
181  number n;
182 
183  // experimentall (recursive enumerator treatment) of alg. ext.
184  CPolyCoeffsEnumerator itr(ph);
185  n_ClearDenominators(itr, n, C);
186 
187  res->data = n;
188  res->rtyp = NUMBER_CMD;
189 
190  return FALSE;
191 }
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
polyrec * poly
Definition: hilb.h:10
static FORCE_INLINE void n_ClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &d, const coeffs r)
(inplace) Clears denominators on a collection of numbers number d is the LCM of all the coefficient d...
Definition: coeffs.h:938
static BOOLEAN _Compute2LeadingSyzygyTerms ( leftv  res,
leftv  h 
)
static

Definition at line 642 of file mod_main.cc.

643 {
645 
646  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
647 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
648  const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
649 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
650 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
651 
652  const ring r = attributes.m_rBaseRing;
653  NoReturn(res);
654 
655  if( h == NULL )
656  {
657  WarnS("Compute2LeadingSyzygyTerms needs an argument...");
658  return TRUE;
659  }
660 
661  assume( h != NULL );
662 
663  assume( OPT__LEAD2SYZ ); // ???
664 
665  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
666  {
667  const ideal id = (const ideal)h->Data();
668 
669  assume(id != NULL);
670 
671  if( UNLIKELY( OPT__DEBUG ) )
672  {
673  PrintS("Compute2LeadingSyzygyTerms::Input: \n");
674  dPrint(id, r, r, 0);
675  }
676 
677  h = h->Next(); assume (h == NULL);
678 
679  res->data = Compute2LeadingSyzygyTerms(id, attributes);
680  res->rtyp = MODUL_CMD;
681 
682  return FALSE;
683  }
684 
685  WarnS("Compute2LeadingSyzygyTerms needs a single ideal/module argument...");
686  return TRUE;
687 }
Computation attribute storage.
Definition: syzextra.h:189
static ideal Compute2LeadingSyzygyTerms(const ideal &L, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:592
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:65
void PrintS(const char *s)
Definition: reporter.cc:294
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
int BOOLEAN
Definition: auxiliary.h:131
static BOOLEAN _ComputeLeadingSyzygyTerms ( leftv  res,
leftv  h 
)
static

Definition at line 530 of file mod_main.cc.

531 {
533 
534  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
535 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
536  const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
537 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
538 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
539 
540  const ring r = attributes.m_rBaseRing;
541  NoReturn(res);
542 
543  if( h == NULL )
544  {
545  WarnS("ComputeLeadingSyzygyTerms needs an argument...");
546  return TRUE;
547  }
548 
549  assume( h != NULL );
550 
551  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
552  {
553  const ideal id = (const ideal)h->Data();
554 
555  assume(id != NULL);
556 
557  if( UNLIKELY( OPT__DEBUG ) )
558  {
559  PrintS("ComputeLeadingSyzygyTerms::Input: \n");
560  dPrint(id, r, r, 0);
561  }
562 
563  assume( !OPT__LEAD2SYZ );
564 
565  h = h->Next(); assume (h == NULL);
566 
567  const ideal newid = ComputeLeadingSyzygyTerms(id, attributes);
568 
569  res->data = newid; res->rtyp = MODUL_CMD;
570  return FALSE;
571  }
572 
573  WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument...");
574  return TRUE;
575 }
Computation attribute storage.
Definition: syzextra.h:189
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:65
void PrintS(const char *s)
Definition: reporter.cc:294
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
int BOOLEAN
Definition: auxiliary.h:131
static ideal ComputeLeadingSyzygyTerms(const ideal &L, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:583
static BOOLEAN _ComputeResolution ( leftv  res,
leftv  h 
)
static

Definition at line 1148 of file mod_main.cc.

1149 {
1150  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
1151 
1152  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
1153 
1154  const char* usage = "`ComputeResolution(<ideal/module>, <same as before>, <same as before>[,int])` expected";
1155  const ring r = attributes.m_rBaseRing;
1156 
1157  NoReturn(res);
1158 
1159  // input
1160  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1161  {
1162  WerrorS(usage);
1163  return TRUE;
1164  }
1165 
1166  const int type = h->Typ();
1167  ideal M = (ideal)(h->CopyD()); // copy for resolution...!???
1168  int size = IDELEMS(M);
1169 
1170  assume( size >= 0 );
1171 
1172  h = h->Next();
1173 
1174  // lead
1175  if ((h==NULL) || (h->Typ()!=type) || (h->Data() == NULL))
1176  {
1177  WerrorS(usage);
1178  return TRUE;
1179  }
1180 
1181  ideal L = (ideal)(h->CopyD()); // no copy!
1182  assume( IDELEMS(L) == size );
1183 
1184  h = h->Next();
1185  if ((h==NULL) || (h->Typ()!=type) || (h->Data() == NULL))
1186  {
1187  WerrorS(usage);
1188  return TRUE;
1189  }
1190 
1191  ideal T = (ideal)(h->CopyD()); // no copy!
1192  assume( IDELEMS(T) == size );
1193 
1194  h = h->Next();
1195 
1196  // length..?
1197  long length = 0;
1198 
1199  if ((h!=NULL) && (h->Typ()==INT_CMD))
1200  {
1201  length = (long)(h->Data());
1202  h = h->Next();
1203  }
1204 
1205  assume( h == NULL );
1206 
1207  if( length <= 0 )
1208  length = 1 + rVar(r);
1209 
1210  if( UNLIKELY( OPT__DEBUG ) )
1211  {
1212  PrintS("ComputeResolution(M, length)::Input: \n");
1213  Print( "starting length: %ld\n", length);
1214  PrintS("M: \n"); dPrint(M, r, r, 0);
1215  PrintS("L=LEAD(M): \n"); dPrint(L, r, r, 0);
1216  PrintS("T=TAIL(M): \n"); dPrint(T, r, r, 0);
1217  }
1218 
1219 
1220  syStrategy _res=(syStrategy)omAlloc0(sizeof(ssyStrategy));
1221 
1222 // class ssyStrategy; typedef ssyStrategy * syStrategy;
1223 // typedef ideal * resolvente;
1224 
1225  _res->length = length + 1; // index + 1;
1226  _res->fullres = (resolvente)omAlloc0((_res->length+1)*sizeof(ideal));
1227  int index = 0;
1228  _res->fullres[index++] = M;
1229 
1230 // if (UNLIKELY(attributes.OPT__TREEOUTPUT))
1231 // Print("{ \"RESOLUTION: HYBRIDNF:%d, TAILREDSYZ: %d, LEAD2SYZ: %d, IGNORETAILS: %d\": [\n", attributes.OPT__HYBRIDNF, attributes.OPT__TAILREDSYZ, attributes.OPT__LEAD2SYZ, attributes.OPT__IGNORETAILS);
1232 
1233  while( (!idIs0(L)) && (index < length))
1234  {
1235  attributes.nextSyzygyLayer();
1236  ideal LL, TT;
1237 
1238  ComputeSyzygy(L, T, LL, TT, attributes);
1239 
1240  if( UNLIKELY( OPT__DEBUG ) )
1241  {
1242  Print("ComputeResolution()::Separated Syzygy[%d]: \n", index);
1243 // PrintS("LL: \n"); dPrint(LL, r, r, 0);
1244 // PrintS("TT: \n"); dPrint(TT, r, r, 0);
1245  }
1246  size = IDELEMS(LL);
1247 
1248  assume( size == IDELEMS(TT) );
1249 
1250  id_Delete(&L, r); id_Delete(&T, r);
1251 
1252  L = LL; T = TT;
1253 
1254  // id_Add(T, L, r);
1255  M = idInit(size, 0);
1256  for( int i = size-1; i >= 0; i-- )
1257  {
1258  M->m[i] = p_Add_q(p_Copy(T->m[i], r), p_Copy(L->m[i], r), r); // TODO: :(((
1259  }
1260  M->rank = id_RankFreeModule(M, r);
1261 
1262  if( UNLIKELY( OPT__DEBUG ) )
1263  {
1264  Print("ComputeResolution()::Restored Syzygy[%d]: \n", index);
1265  PrintS("M = LL + TT: \n"); dPrint(M, r, r, 0);
1266  }
1267 
1268  _res->fullres[index++] = M; // ???
1269  }
1270 // if ( UNLIKELY(attributes.OPT__TREEOUTPUT) )
1271 // PrintS("] }\n");
1272 
1273  id_Delete(&L, r); id_Delete(&T, r);
1274 
1275  res->data = _res;
1276  res->rtyp = RESOLUTION_CMD;
1277 
1278  if( UNLIKELY(OPT__DEBUG) )
1279  {
1280  Print("ComputeResolution::Output (index: %d): ", index);
1281 // class sleftv; typedef sleftv * leftv;
1282  sleftv _h;
1283  DetailedPrint(&_h, res);
1284  }
1285 
1286 // omFreeSize(_res, sizeof(ssyStrategy));
1287 
1288  return FALSE;
1289 
1290 }
int length
Definition: syz.h:60
Computation attribute storage.
Definition: syzextra.h:189
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
Definition: tok.h:98
static void ComputeSyzygy(const ideal L, const ideal T, ideal &LL, ideal &TT, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:576
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:537
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:144
static BOOLEAN DetailedPrint(leftv __res, leftv h)
Definition: mod_main.cc:274
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
int Typ()
Definition: subexpr.cc:976
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:810
void * data
Definition: subexpr.h:89
#define M
Definition: sirandom.c:24
const ring r
Definition: syzextra.cc:208
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:65
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:24
resolvente fullres
Definition: syz.h:57
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
ideal * resolvente
Definition: ideals.h:20
static jList * T
Definition: janet.cc:37
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:883
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void * CopyD(int t)
Definition: subexpr.cc:676
#define omAlloc0(size)
Definition: omAllocDecl.h:211
ssyStrategy * syStrategy
Definition: syz.h:35
static BOOLEAN _ComputeSyzygy ( leftv  res,
leftv  h 
)
static

module (LL, TT) = SSComputeSyzygy(L, T); Compute Syz(L ++ T) = N = LL ++ TT

Definition at line 1296 of file mod_main.cc.

1297 {
1298  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
1299 
1300  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
1301 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
1302 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
1303 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
1304 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
1305 
1306  const char* usage = "`ComputeSyzygy(<ideal/module>, <ideal/module>)` expected";
1307  const ring r = attributes.m_rBaseRing;
1308 
1309  NoReturn(res);
1310 
1311  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1312  {
1313  WerrorS(usage);
1314  return TRUE;
1315  }
1316 
1317  const ideal L = (ideal) h->Data();
1318 
1319  assume( IDELEMS(L) > 0 );
1320 
1321  h = h->Next();
1322  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1323  {
1324  WerrorS(usage);
1325  return TRUE;
1326  }
1327 
1328  const ideal T = (ideal) h->Data();
1329  assume( IDELEMS(L) == IDELEMS(T) );
1330 
1331 
1332  h = h->Next(); assume( h == NULL );
1333 
1334  if( UNLIKELY( OPT__DEBUG ) )
1335  {
1336  PrintS("ComputeSyzygy(L, T)::Input: \n");
1337 // PrintS("L: "); dPrint(L, r, r, 0);
1338 // PrintS("T: "); dPrint(T, r, r, 0);
1339  }
1340 
1341  ideal LL, TT;
1342 
1343  ComputeSyzygy(L, T, LL, TT, attributes);
1344 
1345  lists l = (lists)omAllocBin(slists_bin); l->Init(2);
1346 
1347  l->m[0].rtyp = MODUL_CMD; l->m[0].data = reinterpret_cast<void *>(LL);
1348 
1349  l->m[1].rtyp = MODUL_CMD; l->m[1].data = reinterpret_cast<void *>(TT);
1350 
1351  res->data = l; res->rtyp = LIST_CMD;
1352 
1353  if( UNLIKELY( OPT__DEBUG ) )
1354  {
1355  PrintS("ComputeSyzygy::Output: \nLL: \n");
1356  dPrint(LL, r, r, 0);
1357  PrintS("\nTT: \n");
1358  dPrint(TT, r, r, 0);
1359  }
1360 
1361  return FALSE;
1362 
1363 }
Computation attribute storage.
Definition: syzextra.h:189
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
static void ComputeSyzygy(const ideal L, const ideal T, ideal &LL, ideal &TT, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:576
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:65
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:24
INLINE_THIS void Init(int l=0)
Definition: lists.h:66
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
Definition: tok.h:120
omBin slists_bin
Definition: lists.cc:23
static jList * T
Definition: janet.cc:37
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
int BOOLEAN
Definition: auxiliary.h:131
int l
Definition: cfEzgcd.cc:94
static BOOLEAN _FindReducer ( leftv  res,
leftv  h 
)
static

proc SSFindReducer(def product, def syzterm, def L, def T, list #)

Definition at line 692 of file mod_main.cc.

693 {
695 
696  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
697 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
698 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
699 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
700  const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
701 
702  const char* usage = "`FindReducer(<poly/vector>, <vector/0>, <ideal/module>[,<module>])` expected";
703  const ring r = attributes.m_rBaseRing;
704 
705  NoReturn(res);
706 
707 
708  if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL))
709  {
710  WerrorS(usage);
711  return TRUE;
712  }
713 
714  const poly product = (poly) h->Data(); assume (product != NULL);
715 
716 
717  h = h->Next();
718  if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) )
719  {
720  WerrorS(usage);
721  return TRUE;
722  }
723 
724  poly syzterm = NULL;
725 
726  if(h->Typ()==VECTOR_CMD)
727  syzterm = (poly) h->Data();
728 
729 
730 
731  h = h->Next();
732  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
733  {
734  WerrorS(usage);
735  return TRUE;
736  }
737 
738  const ideal L = (ideal) h->Data(); h = h->Next();
739 
740  assume( IDELEMS(L) > 0 );
741 
742  ideal LS = NULL;
743 
744  if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL))
745  {
746  LS = (ideal)h->Data();
747  h = h->Next();
748  }
749 
750 #ifndef SING_NDEBUG
751  if( LIKELY( OPT__TAILREDSYZ) )
752  assume (LS != NULL);
753 #endif
754 
755  assume( h == NULL );
756 
757  if( UNLIKELY(OPT__DEBUG) )
758  {
759  PrintS("FindReducer(product, syzterm, L, T, #)::Input: \n");
760 
761  PrintS("product: "); dPrint(product, r, r, 0);
762  PrintS("syzterm: "); dPrint(syzterm, r, r, 0);
763 // PrintS("L: "); dPrint(L, r, r, 0);
764 // PrintS("T: "); dPrint(T, r, r, 0);
765 
766  if( LS == NULL )
767 // PrintS("LS: NULL\n");
768  ;
769  else
770  {
771 // PrintS("LS: "); dPrint(LS, r, r, 0);
772  }
773  }
774 
775  res->rtyp = VECTOR_CMD;
776  res->data = FindReducer(product, syzterm, L, LS, attributes);
777 
778  if( UNLIKELY( OPT__DEBUG ) )
779  {
780  PrintS("FindReducer::Output: \n");
781  dPrint((poly)res->data, r, r, 0);
782  }
783 
784  return FALSE;
785 
786 }
Computation attribute storage.
Definition: syzextra.h:189
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define LIKELY(expression)
Definition: tgb_internal.h:837
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:65
void PrintS(const char *s)
Definition: reporter.cc:294
static poly FindReducer(poly product, poly syzterm, ideal L, ideal LS, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:601
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
polyrec * poly
Definition: hilb.h:10
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
int BOOLEAN
Definition: auxiliary.h:131
static BOOLEAN _leadmonom ( leftv  res,
leftv  h 
)
static

Get leading term without a module component.

Definition at line 1366 of file mod_main.cc.

1367 {
1368  NoReturn(res);
1369 
1370  if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD) && (h->Data() != NULL))
1371  {
1372  const ring r = currRing;
1373  const poly p = (poly)(h->Data());
1374 
1375  res->data = reinterpret_cast<void *>( leadmonom(p, r) );
1376  res->rtyp = POLY_CMD;
1377 
1378  return FALSE;
1379  }
1380 
1381  WerrorS("`leadmonom(<poly/vector>)` expected");
1382  return TRUE;
1383 }
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
poly leadmonom(const poly p, const ring r, const bool bSetZeroComp)
return a new term: leading coeff * leading monomial of p with 0 leading component! ...
Definition: syzextra.cc:473
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
polyrec * poly
Definition: hilb.h:10
static BOOLEAN _m2_end ( leftv  res,
leftv  h 
)
static

Definition at line 1939 of file mod_main.cc.

1940 {
1941  int ret = 0;
1942 
1943  if ( (h!=NULL) && (h->Typ()!=INT_CMD) )
1944  {
1945  WerrorS("`m2_end([<int>])` expected");
1946  return TRUE;
1947  }
1948  ret = (int)(long)(h->Data());
1949 
1950  m2_end( ret );
1951 
1952  NoReturn(res);
1953  return FALSE;
1954 }
Definition: tok.h:98
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
void m2_end(int i)
Definition: misc_ip.cc:1069
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1118
static BOOLEAN _NumberStatsInit ( leftv  res,
leftv  h 
)
static

Definition at line 1958 of file mod_main.cc.

1959 {
1960  if ( (h!=NULL) && (h->Typ()!=INT_CMD) )
1961  {
1962  WerrorS("`NumberStatsInit([<int>])` expected");
1963  return TRUE;
1964  }
1965 
1966  unsigned long v = 0;
1967 
1968  if( h != NULL )
1969  v = (unsigned long)(h->Data());
1970 
1971  number_stats_Init(v);
1972 
1973  NoReturn(res);
1974  return FALSE;
1975 }
Definition: tok.h:98
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
static void number_stats_Init(const unsigned long defaultvalue=0)
set all counters to zero
Definition: numstats.h:124
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1118
static BOOLEAN _NumberStatsPrint ( leftv  res,
leftv  h 
)
static

Definition at line 1979 of file mod_main.cc.

1980 {
1981  if ( (h!=NULL) && (h->Typ()!=STRING_CMD) )
1982  {
1983  WerrorS("`NumberStatsPrint([<string>])` expected");
1984  return TRUE;
1985  }
1986 
1987  const char* msg = NULL;
1988 
1989  if( h != NULL )
1990  msg = (const char*)(h->Data());
1991 
1992  number_stats_Print(msg);
1993 
1994  NoReturn(res);
1995  return FALSE;
1996 }
static void number_stats_Print(const char *const msg=NULL)
print out all counters
Definition: numstats.h:136
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1118
static BOOLEAN _p_Content ( leftv  res,
leftv  h 
)
static

Get raw syzygies (idPrepare)

Definition at line 1915 of file mod_main.cc.

1916 {
1917  if ( !( (h!=NULL) && (h->Typ()==POLY_CMD) && (h->Data() != NULL) ) )
1918  {
1919  WerrorS("`p_Content(<poly-var>)` expected");
1920  return TRUE;
1921  }
1922 
1923 
1924  const poly p = reinterpret_cast<poly>(h->Data());
1925 
1926 
1927  pTest(p); pWrite(p); PrintLn();
1928 
1929 
1930  p_Content( p, currRing);
1931 
1932  pTest(p);
1933  pWrite(p); PrintLn();
1934 
1935  NoReturn(res);
1936  return FALSE;
1937 }
void PrintLn()
Definition: reporter.cc:327
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define pTest(p)
Definition: polys.h:387
#define TRUE
Definition: auxiliary.h:144
void pWrite(poly p)
Definition: polys.h:279
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void p_Content(poly ph, const ring r)
Definition: p_polys.cc:2207
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1118
polyrec * poly
Definition: hilb.h:10
static BOOLEAN _ProfilerStart ( leftv  __res,
leftv  h 
)
static

Definition at line 217 of file mod_main.cc.

218 {
219  NoReturn(__res);
220 #if GOOGLE_PROFILE_ENABLED
221  if( h!= NULL && h->Typ() == STRING_CMD )
222  {
223  const char* name = (char*)(h->Data());
224  assume( name != NULL );
225  ProfilerStart(name);
226  } else
227  WerrorS("ProfilerStart requires a string [name] argument");
228 #else
229  WarnS("Sorry no google profiler support (GOOGLE_PROFILE_ENABLE!=1)...");
230 // return TRUE; // ?
231 #endif // #if GOOGLE_PROFILE_ENABLED
232  return FALSE;
233  (void)h;
234 }
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:976
#define assume(x)
Definition: mod2.h:405
char name(const Variable &v)
Definition: factory.h:178
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1118
static BOOLEAN _ProfilerStop ( leftv  __res,
leftv   
)
static

Definition at line 235 of file mod_main.cc.

236 {
237  NoReturn(__res);
238 #if GOOGLE_PROFILE_ENABLED
239  ProfilerStop();
240 #else
241  WarnS("Sorry no google profiler support (GOOGLE_PROFILE_ENABLED!=1)...");
242 // return TRUE; // ?
243 #endif // #if GOOGLE_PROFILE_ENABLED
244  return FALSE;
245 }
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define WarnS
Definition: emacs.cc:81
static BOOLEAN _ReduceTerm ( leftv  res,
leftv  h 
)
static

proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #)

Definition at line 898 of file mod_main.cc.

899 {
901 
902  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
903 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
904 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
905 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
906  const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
907 
908  const char* usage = "`ReduceTerm(<poly>, <poly/vector>, <vector/0>, <ideal/module>, <ideal/module>[,<module>])` expected";
909  const ring r = attributes.m_rBaseRing;
910 
911  NoReturn(res);
912 
913  if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL))
914  {
915  WerrorS(usage);
916  return TRUE;
917  }
918 
919  const poly multiplier = (poly) h->Data(); assume (multiplier != NULL);
920 
921 
922  h = h->Next();
923  if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL))
924  {
925  WerrorS(usage);
926  return TRUE;
927  }
928 
929  const poly term4reduction = (poly) h->Data(); assume( term4reduction != NULL );
930 
931 
932  poly syztermCheck = NULL;
933 
934  h = h->Next();
935  if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) )
936  {
937  WerrorS(usage);
938  return TRUE;
939  }
940 
941  if(h->Typ()==VECTOR_CMD)
942  syztermCheck = (poly) h->Data();
943 
944 
945  h = h->Next();
946  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
947  {
948  WerrorS(usage);
949  return TRUE;
950  }
951 
952  const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 );
953 
954 
955  h = h->Next();
956  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
957  {
958  WerrorS(usage);
959  return TRUE;
960  }
961 
962  const ideal T = (ideal) h->Data();
963 
964  assume( IDELEMS(L) == IDELEMS(T) );
965 
966  ideal LS = NULL;
967 
968  h = h->Next();
969  if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL))
970  {
971  LS = (ideal)h->Data();
972  h = h->Next();
973  }
974 
975 #ifndef SING_NDEBUG
976  if( LIKELY( OPT__TAILREDSYZ) )
977  assume (LS != NULL);
978 #endif
979 
980  assume( h == NULL );
981 
982  if( UNLIKELY( OPT__DEBUG ) )
983  {
984  PrintS("ReduceTerm(m, t, syzterm, L, T, #)::Input: \n");
985 
986  PrintS("m: "); dPrint(multiplier, r, r, 0);
987  PrintS("t: "); dPrint(term4reduction, r, r, 0);
988  PrintS("syzterm: "); dPrint(syztermCheck, r, r, 0);
989 
990 // PrintS("L: "); dPrint(L, r, r, 0);
991 // PrintS("T: "); dPrint(T, r, r, 0);
992 
993  if( LS == NULL )
994 // PrintS("LS: NULL\n")
995  ;
996  else
997  {
998 // PrintS("LS: "); dPrint(LS, r, r, 0);
999  }
1000  }
1001 
1002 
1003  if ( UNLIKELY( OPT__DEBUG && syztermCheck != NULL) )
1004  {
1005  const int c = p_GetComp(syztermCheck, r) - 1;
1006  assume( c >= 0 && c < IDELEMS(L) );
1007 
1008  const poly p = L->m[c];
1009  assume( p != NULL ); assume( pNext(p) == NULL );
1010 
1011  assume( p_EqualPolys(term4reduction, p, r) ); // assume? TODO
1012 
1013 
1014  poly m = leadmonom(syztermCheck, r);
1015  assume( m != NULL ); assume( pNext(m) == NULL );
1016 
1017  assume( p_EqualPolys(multiplier, m, r) ); // assume? TODO
1018 
1019  p_Delete(&m, r);
1020 
1021 // NOTE: leadmonomial(syzterm) == m && L[leadcomp(syzterm)] == t
1022  }
1023 
1024  res->rtyp = VECTOR_CMD;
1025  res->data = ReduceTerm(multiplier, term4reduction, syztermCheck, L, T, LS, attributes);
1026 
1027 
1028  if( UNLIKELY( OPT__DEBUG ) )
1029  {
1030  PrintS("ReduceTerm::Output: ");
1031 
1032  dPrint((poly)res->data, r, r, 0);
1033  }
1034 
1035 
1036  return FALSE;
1037 }
Computation attribute storage.
Definition: syzextra.h:189
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
poly leadmonom(const poly p, const ring r, const bool bSetZeroComp)
return a new term: leading coeff * leading monomial of p with 0 leading component! ...
Definition: syzextra.cc:473
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define LIKELY(expression)
Definition: tgb_internal.h:837
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
static poly ReduceTerm(poly multiplier, poly term4reduction, poly syztermCheck, ideal L, ideal T, ideal LS, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:615
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:65
int m
Definition: cfEzgcd.cc:119
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:24
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4318
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:849
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1118
static jList * T
Definition: janet.cc:37
polyrec * poly
Definition: hilb.h:10
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
int BOOLEAN
Definition: auxiliary.h:131
static BOOLEAN _SchreyerSyzygyNF ( leftv  res,
leftv  h 
)
static

Definition at line 789 of file mod_main.cc.

790 {
792 
793  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
794 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
795 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
796  const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
797  const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
798 
799  const char* usage = "`SchreyerSyzygyNF(<vector>, <vector>, <ideal/module>, <ideal/module>[,<module>])` expected";
800  const ring r = attributes.m_rBaseRing;
801 
802  NoReturn(res);
803 
804  assume( OPT__HYBRIDNF ); // ???
805 
806  if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL))
807  {
808  WerrorS(usage);
809  return TRUE;
810  }
811 
812  const poly syz_lead = (poly) h->Data(); assume (syz_lead != NULL);
813 
814 
815  h = h->Next();
816  if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL))
817  {
818  WerrorS(usage);
819  return TRUE;
820  }
821 
822  const poly syz_2 = (poly) h->Data(); assume (syz_2 != NULL);
823 
824  h = h->Next();
825  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
826  {
827  WerrorS(usage);
828  return TRUE;
829  }
830 
831  const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 );
832 
833 
834  h = h->Next();
835  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
836  {
837  WerrorS(usage);
838  return TRUE;
839  }
840 
841  const ideal T = (ideal) h->Data();
842 
843  assume( IDELEMS(L) == IDELEMS(T) );
844 
845  ideal LS = NULL;
846 
847  h = h->Next();
848  if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL))
849  {
850  LS = (ideal)h->Data();
851  h = h->Next();
852  }
853 
854 #ifndef SING_NDEBUG
855  if( LIKELY( OPT__TAILREDSYZ) )
856  assume (LS != NULL);
857 #endif
858 
859  assume( h == NULL );
860 
861  if( UNLIKELY( OPT__DEBUG ) )
862  {
863  PrintS("SchreyerSyzygyNF(syz_lead, syz_2, L, T, #)::Input: \n");
864 
865  PrintS("syz_lead: "); dPrint(syz_lead, r, r, 0);
866  PrintS("syz_2: "); dPrint(syz_2, r, r, 0);
867 
868 // PrintS("L: "); dPrint(L, r, r, 0);
869 // PrintS("T: "); dPrint(T, r, r, 0);
870 
871  if( LS == NULL )
872 // PrintS("LS: NULL\n")
873  ;
874  else
875  {
876 // PrintS("LS: "); dPrint(LS, r, r, 0);
877  }
878  }
879 
880  res->rtyp = VECTOR_CMD;
881  res->data = SchreyerSyzygyNF(syz_lead,
882  (syz_2!=NULL)? p_Copy(syz_2, r): syz_2, L, T, LS, attributes);
883 
884  if( UNLIKELY( OPT__DEBUG ) )
885  {
886  PrintS("SchreyerSyzygyNF::Output: ");
887 
888  dPrint((poly)res->data, r, r, 0);
889  }
890 
891 
892  return FALSE;
893 }
Computation attribute storage.
Definition: syzextra.h:189
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
static poly SchreyerSyzygyNF(poly syz_lead, poly syz_2, ideal L, ideal T, ideal LS, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:623
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define LIKELY(expression)
Definition: tgb_internal.h:837
int Typ()
Definition: subexpr.cc:976
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:810
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:65
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
static jList * T
Definition: janet.cc:37
polyrec * poly
Definition: hilb.h:10
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
int BOOLEAN
Definition: auxiliary.h:131
static BOOLEAN _Sort_c_ds ( leftv  res,
leftv  h 
)
static

sorting wrt <c,ds> & reversing... change the input inplace!!!

Definition at line 580 of file mod_main.cc.

581 {
583 
584  const BOOLEAN OPT__DEBUG = FALSE; // attributes.OPT__DEBUG;
585 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
586 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
587 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
588 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
589 
590  NoReturn(res);
591 
592  const ring r = attributes.m_rBaseRing;
593  NoReturn(res);
594 
595  if( h == NULL )
596  {
597  WarnS("Sort_c_ds needs an argument...");
598  return TRUE;
599  }
600 
601  assume( h != NULL );
602 
603  if( (h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
604  && (h->rtyp == IDHDL) // must be a variable!
605  && (h->e == NULL) // not a list element
606  )
607  {
608  const ideal id = (const ideal)h->Data();
609 
610  assume(id != NULL);
611 
612  if( UNLIKELY( OPT__DEBUG ) )
613  {
614  PrintS("Sort_c_ds::Input: \n");
615  dPrint(id, r, r, 0);
616  }
617 
618  assume (h->Next() == NULL);
619 
620  id_Test(id, r);
621 
622  Sort_c_ds(id, r); // NOT A COPY! inplace sorting!!!
623 
624 // res->data = id;
625 // res->rtyp = h->Typ();
626 
627  if( UNLIKELY( OPT__DEBUG ) )
628  {
629  PrintS("Sort_c_ds::Output: \n");
630  dPrint(id, r, r, 0);
631  }
632 
633  // NOTE: nothing is to be returned!!!
634  return FALSE;
635  }
636 
637  WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument (must be a variable!)...");
638  return TRUE;
639 }
Computation attribute storage.
Definition: syzextra.h:189
void Sort_c_ds(const ideal id, const ring r)
inplace sorting of the module (ideal) id wrt <_(c,ds)
Definition: syzextra.cc:527
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:140
#define id_Test(A, lR)
Definition: simpleideals.h:80
#define TRUE
Definition: auxiliary.h:144
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:976
#define IDHDL
Definition: tok.h:35
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:65
void PrintS(const char *s)
Definition: reporter.cc:294
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
int BOOLEAN
Definition: auxiliary.h:131
static BOOLEAN _TraverseTail ( leftv  res,
leftv  h 
)
static

Definition at line 1043 of file mod_main.cc.

1044 {
1045  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
1046 
1047  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
1048 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
1049 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
1050 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
1051  const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
1052 
1053  const char* usage = "`TraverseTail(<poly>, <poly/vector>, <ideal/module>, <ideal/module>[,<module>])` expected";
1054  const ring r = attributes.m_rBaseRing;
1055 
1056  NoReturn(res);
1057 
1058  if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL))
1059  {
1060  WerrorS(usage);
1061  return TRUE;
1062  }
1063 
1064  const poly multiplier = (poly) h->Data(); assume (multiplier != NULL);
1065 
1066  h = h->Next();
1067  if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD))
1068  {
1069  WerrorS(usage);
1070  return TRUE;
1071  }
1072 
1073  const poly tail = (poly) h->Data();
1074 
1075  h = h->Next();
1076 
1077  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1078  {
1079  WerrorS(usage);
1080  return TRUE;
1081  }
1082 
1083  const ideal L = (ideal) h->Data();
1084 
1085  assume( IDELEMS(L) > 0 );
1086 
1087  h = h->Next();
1088  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1089  {
1090  WerrorS(usage);
1091  return TRUE;
1092  }
1093 
1094  const ideal T = (ideal) h->Data();
1095 
1096  assume( IDELEMS(L) == IDELEMS(T) );
1097 
1098  h = h->Next();
1099 
1100  ideal LS = NULL;
1101 
1102  if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL))
1103  {
1104  LS = (ideal)h->Data();
1105  h = h->Next();
1106  }
1107 
1108 #ifndef SING_NDEBUG
1109  if( LIKELY( OPT__TAILREDSYZ) )
1110  assume (LS != NULL);
1111 #endif
1112 
1113  assume( h == NULL );
1114 
1115  if( UNLIKELY( OPT__DEBUG ) )
1116  {
1117  PrintS("TraverseTail(m, t, L, T, #)::Input: \n");
1118 
1119  PrintS("m: "); dPrint(multiplier, r, r, 0);
1120  PrintS("t: "); dPrint(tail, r, r, 0);
1121 
1122 // PrintS("L: "); dPrint(L, r, r, 0);
1123 // PrintS("T: "); dPrint(T, r, r, 0);
1124 
1125  if( LS == NULL )
1126 // PrintS("LS: NULL\n")
1127  ;
1128  else
1129  {
1130 // PrintS("LS: "); dPrint(LS, r, r, 0);
1131  }
1132  }
1133 
1134  res->rtyp = VECTOR_CMD;
1135  res->data = TraverseTail(multiplier, tail, L, T, LS, attributes);
1136 
1137 
1138  if( UNLIKELY( OPT__DEBUG ) )
1139  {
1140  PrintS("TraverseTail::Output: ");
1141  dPrint((poly)res->data, r, r, 0);
1142  }
1143 
1144  return FALSE;
1145 }
Computation attribute storage.
Definition: syzextra.h:189
static poly TraverseTail(poly multiplier, poly tail, ideal L, ideal T, ideal LS, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:608
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define LIKELY(expression)
Definition: tgb_internal.h:837
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:65
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
static jList * T
Definition: janet.cc:37
polyrec * poly
Definition: hilb.h:10
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
int BOOLEAN
Definition: auxiliary.h:131
static BOOLEAN DetailedPrint ( leftv  __res,
leftv  h 
)
static

Definition at line 274 of file mod_main.cc.

275 {
276  NoReturn(__res);
277 
278  if( h == NULL )
279  {
280  WarnS("DetailedPrint needs an argument...");
281  return TRUE;
282  }
283 
284  if( h->Typ() == NUMBER_CMD)
285  {
286  number n = (number)h->Data();
287 
288  const ring r = currRing;
289 
290  n_Test(n, r->cf);
291 
292  StringSetS("");
293  n_Write(n, r->cf);
294  PrintS(StringEndS());
295  PrintLn();
296 
297  return FALSE;
298  }
299 
300  if( h->Typ() == RING_CMD)
301  {
302  const ring r = (const ring)h->Data();
303  rWrite(r, TRUE);
304  PrintLn();
305 #ifdef RDEBUG
306  //rDebugPrint(r);
307 #endif
308  return FALSE;
309  }
310 
311  if( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD)
312  {
313  const poly p = (const poly)h->Data(); h = h->Next();
314 
316 
317  return FALSE;
318  }
319 
320  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
321  {
322  const ideal id = (const ideal)h->Data(); h = h->Next();
323 
325 
326  return FALSE;
327  }
328 
329  if( h->Typ() == RESOLUTION_CMD )
330  {
331  const syStrategy syzstr = reinterpret_cast<const syStrategy>(h->Data());
332 
333  h = h->Next();
334 
335  int nTerms = getOptionalInteger(h, 1);
336 
337 
338  Print("RESOLUTION_CMD(%p): ", reinterpret_cast<const void*>(syzstr)); PrintLn();
339 
340  const ring save = currRing;
341  const ring r = syzstr->syRing;
342 // const ring rr = (r != NULL) ? r: save;
343 
344 
345  const int iLength = syzstr->length;
346 
347  Print("int 'length': %d", iLength); PrintLn();
348  Print("int 'regularity': %d", syzstr->regularity); PrintLn();
349  Print("short 'list_length': %hd", syzstr->list_length); PrintLn();
350  Print("short 'references': %hd", syzstr->references); PrintLn();
351 
352 
353 #define PRINT_pINTVECTOR(s, v) Print("intvec '%10s'(%p)", #v, reinterpret_cast<const void*>((s)->v)); \
354 if( (s)->v != NULL ){ PrintS(": "); view((s)->v); }; \
355 PrintLn();
356 
357  PRINT_pINTVECTOR(syzstr, resolution);
358  PRINT_pINTVECTOR(syzstr, betti);
359  PRINT_pINTVECTOR(syzstr, Tl);
360  PRINT_pINTVECTOR(syzstr, cw);
361 #undef PRINT_pINTVECTOR
362 
363  if (r == NULL)
364  Print("ring '%10s': NULL", "syRing");
365  else
366  if (r == currRing)
367  Print("ring '%10s': currRing", "syRing");
368  else
369  if (r != NULL && r != save)
370  {
371  Print("ring '%10s': ", "syRing");
372  rWrite(r);
373 #ifdef RDEBUG
374  // rDebugPrint(r);
375 #endif
376  // rChangeCurrRing(r);
377  }
378  PrintLn();
379 
380  const SRes rP = syzstr->resPairs;
381  Print("SRes 'resPairs': %p", reinterpret_cast<const void*>(rP)); PrintLn();
382 
383  if (rP != NULL)
384  for (int iLevel = 0; (iLevel < iLength) && (rP[iLevel] != NULL) && ((*syzstr->Tl)[iLevel] >= 0); iLevel++)
385  {
386  int n = 0;
387  const int iTl = (*syzstr->Tl)[iLevel];
388  for (int j = 0; (j < iTl) && ((rP[iLevel][j].lcm!=NULL) || (rP[iLevel][j].syz!=NULL)); j++)
389  {
390  if (rP[iLevel][j].isNotMinimal==NULL)
391  n++;
392  }
393  Print("minimal-resPairs-Size[1+%d]: %d", iLevel, n); PrintLn();
394  }
395 
396 
397  // const ring rrr = (iLevel > 0) ? rr : save; ?
398 #define PRINT_RESOLUTION(s, v) Print("resolution '%12s': %p", #v, reinterpret_cast<const void*>((s)->v)); PrintLn(); \
399 if ((s)->v != NULL) \
400  for (int iLevel = 0; (iLevel < iLength) && ( ((s)->v)[iLevel] != NULL ); iLevel++) \
401  { \
402  /* const ring rrr = (iLevel > 0) ? save : save; */ \
403  Print("id '%10s'[%d]: (%p) ncols = %d / size: %d; nrows = %d, rank = %ld / rk: %ld", #v, iLevel, reinterpret_cast<const void*>(((s)->v)[iLevel]), ((s)->v)[iLevel]->ncols, idSize(((s)->v)[iLevel]), ((s)->v)[iLevel]->nrows, ((s)->v)[iLevel]->rank, -1L/*id_RankFreeModule(((s)->v)[iLevel], rrr)*/ ); \
404  PrintLn(); \
405  } \
406  PrintLn();
407 
408  // resolvente:
409  PRINT_RESOLUTION(syzstr, minres);
410  PRINT_RESOLUTION(syzstr, fullres);
411 
412 // assume (id_RankFreeModule (syzstr->res[1], rr) == syzstr->res[1]->rank);
413 
414  PRINT_RESOLUTION(syzstr, res);
415  PRINT_RESOLUTION(syzstr, orderedRes);
416 #undef PRINT_RESOLUTION
417 
418 #define PRINT_POINTER(s, v) Print("pointer '%17s': %p", #v, reinterpret_cast<const void*>((s)->v)); PrintLn();
419  // 2d arrays:
420  PRINT_POINTER(syzstr, truecomponents);
421  PRINT_POINTER(syzstr, ShiftedComponents);
422  PRINT_POINTER(syzstr, backcomponents);
423  PRINT_POINTER(syzstr, Howmuch);
424  PRINT_POINTER(syzstr, Firstelem);
425  PRINT_POINTER(syzstr, elemLength);
426  PRINT_POINTER(syzstr, sev);
427 
428  // arrays of intvects:
429  PRINT_POINTER(syzstr, weights);
430  PRINT_POINTER(syzstr, hilb_coeffs);
431 #undef PRINT_POINTER
432 
433 
434  if (syzstr->fullres==NULL)
435  {
436  PrintS("resolution 'fullres': (NULL) => resolution not computed yet");
437  PrintLn();
438  } else
439  {
440  Print("resolution 'fullres': (%p) => resolution seems to be computed already", reinterpret_cast<const void*>(syzstr->fullres));
441  PrintLn();
442  dPrint(*syzstr->fullres, save, save, nTerms);
443  }
444 
445 
446 
447 
448  if (syzstr->minres==NULL)
449  {
450  PrintS("resolution 'minres': (NULL) => resolution not minimized yet");
451  PrintLn();
452  } else
453  {
454  Print("resolution 'minres': (%p) => resolution seems to be minimized already", reinterpret_cast<const void*>(syzstr->minres));
455  PrintLn();
456  dPrint(*syzstr->minres, save, save, nTerms);
457  }
458 
459 
460 
461 
462  /*
463  int ** truecomponents;
464  long** ShiftedComponents;
465  int ** backcomponents;
466  int ** Howmuch;
467  int ** Firstelem;
468  int ** elemLength;
469  unsigned long ** sev;
470 
471  intvec ** weights;
472  intvec ** hilb_coeffs;
473 
474  SRes resPairs; //polynomial data for internal use only
475 
476  resolvente fullres;
477  resolvente minres;
478  resolvente res; //polynomial data for internal use only
479  resolvente orderedRes; //polynomial data for internal use only
480 */
481 
482  // if( currRing != save ) rChangeCurrRing(save);
483  }
484 
485 
486  return FALSE;
487 }
int length
Definition: syz.h:60
#define PRINT_pINTVECTOR(s, v)
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:711
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
short references
Definition: syz.h:63
#define TRUE
Definition: auxiliary.h:144
static int getOptionalInteger(const leftv &h, const int _n)
try to get an optional (simple) integer argument out of h or return the default value ...
Definition: mod_main.cc:196
char * StringEndS()
Definition: reporter.cc:151
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:976
int regularity
Definition: syz.h:61
intvec * Tl
Definition: syz.h:50
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define PRINT_RESOLUTION(s, v)
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
int j
Definition: myNF.cc:70
void StringSetS(const char *st)
Definition: reporter.cc:128
BEGIN_NAMESPACE_SINGULARXX const ring const ring const int nTerms
Definition: DebugPrint.h:30
static FORCE_INLINE void n_Write(number &n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition: coeffs.h:592
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:739
void PrintS(const char *s)
Definition: reporter.cc:294
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:236
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define NULL
Definition: omList.c:10
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
void * Data()
Definition: subexpr.cc:1118
SSet * SRes
Definition: syz.h:33
short list_length
Definition: syz.h:62
polyrec * poly
Definition: hilb.h:10
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
#define PRINT_POINTER(s, v)
static BOOLEAN GetInducedData ( leftv  res,
leftv  h 
)
static

?

Definition at line 1527 of file mod_main.cc.

1528 {
1529  NoReturn(res);
1530 
1531  const ring r = currRing;
1532 
1533  int p = 0; // which IS-block? p^th!
1534 
1535  if ((h!=NULL) && (h->Typ()==INT_CMD))
1536  {
1537  p = (int)((long)(h->Data())); h=h->next;
1538  assume(p >= 0);
1539  }
1540 
1541  const int pos = rGetISPos(p, r);
1542 
1543  if( /*(*/ -1 == pos /*)*/ )
1544  {
1545  WerrorS("`GetInducedData([int])` called on incompatible ring (not created by 'MakeInducedSchreyerOrdering'!)");
1546  return TRUE;
1547  }
1548 
1549 
1550  const int iLimit = r->typ[pos].data.is.limit;
1551  const ideal F = r->typ[pos].data.is.F;
1552 
1553  ideal FF = id_Copy(F, r);
1554 
1556  l->Init(2);
1557 
1558  l->m[0].rtyp = INT_CMD;
1559  l->m[0].data = reinterpret_cast<void *>(iLimit);
1560 
1561 
1562  // l->m[1].rtyp = MODUL_CMD;
1563 
1564  if( id_IsModule(FF, r) ) // ???
1565  {
1566  l->m[1].rtyp = MODUL_CMD;
1567 
1568  // Print("before: %d\n", FF->nrows);
1569  // FF->nrows = id_RankFreeModule(FF, r); // ???
1570  // Print("after: %d\n", FF->nrows);
1571  }
1572  else
1573  l->m[1].rtyp = IDEAL_CMD;
1574 
1575  l->m[1].data = reinterpret_cast<void *>(FF);
1576 
1577  res->rtyp = LIST_CMD; // list of int/module
1578  res->data = reinterpret_cast<void *>(l);
1579 
1580  return FALSE;
1581 
1582 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
Definition: tok.h:98
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
ideal id_Copy(ideal h1, const ring r)
copy an ideal
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
leftv next
Definition: subexpr.h:87
INLINE_THIS void Init(int l=0)
Definition: lists.h:66
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
Definition: tok.h:120
omBin slists_bin
Definition: lists.cc:23
int rGetISPos(const int p, const ring r)
Finds p^th IS ordering, and returns its position in r->typ[] returns -1 if something went wrong! p - ...
Definition: ring.cc:4905
int l
Definition: cfEzgcd.cc:94
static int getOptionalInteger ( const leftv h,
const int  _n 
)
static

try to get an optional (simple) integer argument out of h or return the default value

Definition at line 196 of file mod_main.cc.

197 {
198  if( h!= NULL && h->Typ() == INT_CMD )
199  {
200  int n = (int)(long)(h->Data());
201 
202  if( n < 0 )
203  Warn("Negative (%d) optional integer argument", n);
204 
205  return (n);
206  }
207 
208  return (_n);
209 }
Definition: tok.h:98
int Typ()
Definition: subexpr.cc:976
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1118
#define Warn
Definition: emacs.cc:80
static BOOLEAN idPrepare ( leftv  res,
leftv  h 
)
static

Get raw syzygies (idPrepare)

Definition at line 1823 of file mod_main.cc.

1824 {
1825  // extern int rGetISPos(const int p, const ring r);
1826 
1827  const ring r = currRing;
1828 
1829  const bool isSyz = rIsSyzIndexRing(r);
1830  const int posIS = rGetISPos(0, r);
1831 
1832 
1833  if ( !( (h!=NULL) && (h->Typ()==MODUL_CMD) && (h->Data() != NULL) ) )
1834  {
1835  WerrorS("`idPrepare(<module>)` expected");
1836  return TRUE;
1837  }
1838 
1839  const ideal I = reinterpret_cast<ideal>(h->Data());
1840 
1841  assume( I != NULL );
1842  idTest(I);
1843 
1844  int iComp = -1;
1845 
1846  h=h->next;
1847  if ( (h!=NULL) && (h->Typ()==INT_CMD) )
1848  {
1849  iComp = (int)((long)(h->Data()));
1850  }
1851  else
1852  {
1853  if( (!isSyz) && (-1 == posIS) )
1854  {
1855  WerrorS("`idPrepare(<...>)` called on incompatible ring (not created by 'MakeSyzCompOrdering' or 'MakeInducedSchreyerOrdering'!)");
1856  return TRUE;
1857  }
1858 
1859  if( isSyz )
1860  iComp = rGetCurrSyzLimit(r);
1861  else
1862  iComp = id_RankFreeModule(r->typ[posIS].data.is.F, r); // ;
1863  }
1864 
1865  assume(iComp >= 0);
1866 
1867 
1868  intvec* w = reinterpret_cast<intvec *>(atGet(h, "isHomog", INTVEC_CMD));
1869  tHomog hom = testHomog;
1870 
1871  // int add_row_shift = 0;
1872  //
1873  if (w!=NULL)
1874  {
1875  w = ivCopy(w);
1876  // add_row_shift = ww->min_in();
1877  //
1878  // (*ww) -= add_row_shift;
1879  //
1880  // if (idTestHomModule(I, currRing->qideal, ww))
1881  // {
1882  hom = isHomog;
1883  // w = ww;
1884  // }
1885  // else
1886  // {
1887  // //WarnS("wrong weights");
1888  // delete ww;
1889  // w = NULL;
1890  // hom=testHomog;
1891  // }
1892  }
1893 
1894 
1895  // computes syzygies of h1,
1896  // works always in a ring with ringorder_s
1897  // NOTE: rSetSyzComp(syzcomp) should better be called beforehand
1898  // ideal idPrepare (ideal h1, tHomog hom, int syzcomp, intvec **w);
1899 
1900  ideal J = // idPrepare( I, hom, iComp, &w);
1901  kStd(I, currRing->qideal, hom, &w, NULL, iComp);
1902 
1903  idTest(J);
1904 
1905  if (w!=NULL)
1906  atSet(res, omStrDup("isHomog"), w, INTVEC_CMD);
1907  // if (w!=NULL) delete w;
1908 
1909  res->rtyp = MODUL_CMD;
1910  res->data = reinterpret_cast<void *>(J);
1911  return FALSE;
1912 }
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:711
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:714
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:144
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2225
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
tHomog
Definition: structs.h:37
#define assume(x)
Definition: mod2.h:405
leftv next
Definition: subexpr.h:87
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
int rGetISPos(const int p, const ring r)
Finds p^th IS ordering, and returns its position in r->typ[] returns -1 if something went wrong! p - ...
Definition: ring.cc:4905
#define idTest(id)
Definition: ideals.h:60
#define omStrDup(s)
Definition: omAllocDecl.h:263
static BOOLEAN ISUpdateComponents ( leftv  res,
leftv  h 
)
static

Definition at line 1748 of file mod_main.cc.

1749 {
1750  NoReturn(res);
1751 
1752  PrintS("ISUpdateComponents:.... \n");
1753 
1754  if ((h!=NULL) && (h->Typ()==MODUL_CMD))
1755  {
1756  ideal F = (ideal)h->Data(); ; // No copy!
1757  h=h->next;
1758 
1759  if ((h!=NULL) && (h->Typ()==INTVEC_CMD))
1760  {
1761  const intvec* const V = (const intvec* const) h->Data();
1762  h=h->next;
1763 
1764  if ((h!=NULL) && (h->Typ()==INT_CMD))
1765  {
1766  const int MIN = (int)((long)(h->Data()));
1767 
1768  pISUpdateComponents(F, V, MIN, currRing);
1769  return FALSE;
1770  }
1771  }
1772  }
1773 
1774  WerrorS("`ISUpdateComponents(<module>, intvec, int)` expected");
1775  return TRUE;
1776 }
Definition: tok.h:98
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
#define MIN(a, b)
Definition: omDebug.c:102
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r)
Definition: ring.cc:4277
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:14
void PrintS(const char *s)
Definition: reporter.cc:294
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1118
static number jjLONG2N ( long  d)
inlinestatic

Definition at line 247 of file mod_main.cc.

248 {
249  return n_Init(d, coeffs_BIGINT);
250 }
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:539
coeffs coeffs_BIGINT
Definition: ipid.cc:54
static BOOLEAN leadcomp ( leftv  res,
leftv  h 
)
static

Get leading component.

Definition at line 1386 of file mod_main.cc.

1387 {
1388  NoReturn(res);
1389 
1390  if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD))
1391  {
1392  const ring r = currRing;
1393 
1394  const poly p = (poly)(h->Data());
1395 
1396  if (p != NULL )
1397  {
1398  assume( p != NULL );
1399  p_LmTest(p, r);
1400 
1401  const unsigned long iComp = p_GetComp(p, r);
1402 
1403  // assume( iComp > 0 ); // p is a vector
1404 
1405  res->data = reinterpret_cast<void *>(jjLONG2N(iComp));
1406  } else
1407  res->data = reinterpret_cast<void *>(jjLONG2N(0));
1408 
1409 
1410  res->rtyp = BIGINT_CMD;
1411  return FALSE;
1412  }
1413 
1414  WerrorS("`leadcomp(<poly/vector>)` expected");
1415  return TRUE;
1416 }
static number jjLONG2N(long d)
Definition: mod_main.cc:247
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
Definition: tok.h:42
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define p_LmTest(p, r)
Definition: p_polys.h:161
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
polyrec * poly
Definition: hilb.h:10
static BOOLEAN leadrawexp ( leftv  res,
leftv  h 
)
static

Get raw leading exponent vector.

Definition at line 1422 of file mod_main.cc.

1423 {
1424  NoReturn(res);
1425 
1426  if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD) && (h->Data() != NULL))
1427  {
1428  const ring r = currRing;
1429  const poly p = (poly)(h->Data());
1430 
1431  assume( p != NULL );
1432  p_LmTest(p, r);
1433 
1434  const int iExpSize = r->ExpL_Size;
1435 
1436 // intvec *iv = new intvec(iExpSize);
1437 
1439  l->Init(iExpSize);
1440 
1441  for(int i = iExpSize-1; i >= 0; i--)
1442  {
1443  l->m[i].rtyp = BIGINT_CMD;
1444  l->m[i].data = reinterpret_cast<void *>(jjLONG2N(p->exp[i])); // longs...
1445  }
1446 
1447  res->rtyp = LIST_CMD; // list of bigints
1448  res->data = reinterpret_cast<void *>(l);
1449  return FALSE;
1450  }
1451 
1452  WerrorS("`leadrawexp(<poly/vector>)` expected");
1453  return TRUE;
1454 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
static number jjLONG2N(long d)
Definition: mod_main.cc:247
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:140
Definition: tok.h:42
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
#define p_LmTest(p, r)
Definition: p_polys.h:161
INLINE_THIS void Init(int l=0)
Definition: lists.h:66
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
Definition: tok.h:120
omBin slists_bin
Definition: lists.cc:23
polyrec * poly
Definition: hilb.h:10
int l
Definition: cfEzgcd.cc:94
static BOOLEAN MakeInducedSchreyerOrdering ( leftv  res,
leftv  h 
)
static

Same for Induced Schreyer ordering (ordering on components is defined by sign!)

Definition at line 1473 of file mod_main.cc.

1474 {
1475 
1476  NoReturn(res);
1477 
1478  int sign = 1;
1479  if ((h!=NULL) && (h->Typ()==INT_CMD))
1480  {
1481  const int s = (int)((long)(h->Data()));
1482 
1483  if( s != -1 && s != 1 )
1484  {
1485  WerrorS("`MakeInducedSchreyerOrdering(<int>)` called with wrong integer argument (must be +-1)!");
1486  return TRUE;
1487  }
1488 
1489  sign = s;
1490  }
1491 
1492  assume( sign == 1 || sign == -1 );
1493  res->data = reinterpret_cast<void *>(rAssure_InducedSchreyerOrdering(currRing, TRUE, sign));
1494  res->rtyp = RING_CMD; // return new ring!
1495  // QRING_CMD?
1496  return FALSE;
1497 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:98
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
ring rAssure_InducedSchreyerOrdering(const ring r, BOOLEAN complete, int sign)
Definition: ring.cc:4769
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
static int sign(int x)
Definition: ring.cc:3413
static BOOLEAN MakeSyzCompOrdering ( leftv  res,
leftv   
)
static

Endowe the current ring with additional (leading) Syz-component ordering.

Definition at line 1458 of file mod_main.cc.

1459 {
1460 
1461  NoReturn(res);
1462 
1463  // res->data = rCurrRingAssure_SyzComp(); // changes current ring! :(
1464  res->data = reinterpret_cast<void *>(rAssure_SyzComp(currRing, TRUE));
1465  res->rtyp = RING_CMD; // return new ring!
1466  // QRING_CMD?
1467 
1468  return FALSE;
1469 }
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
Definition: ring.cc:4386
int rtyp
Definition: subexpr.h:92
static BOOLEAN noop ( leftv  __res,
leftv   
)
static

Definition at line 211 of file mod_main.cc.

212 {
213  NoReturn(__res);
214  return FALSE;
215 }
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
static void NoReturn ( leftv res)
inlinestatic

Definition at line 95 of file mod_main.cc.

96 {
97  res->rtyp = NONE;
98  res->data = NULL;
99 }
void * data
Definition: subexpr.h:89
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
#define NONE
Definition: tok.h:220
void pISUpdateComponents ( ideal  F,
const intvec *const  V,
const int  MIN,
const ring  r 
)

Definition at line 4277 of file ring.cc.

4278 {
4279  assume( V != NULL );
4280  assume( MIN >= 0 );
4281 
4282  if( F == NULL )
4283  return;
4284 
4285  for( int j = (F->ncols*F->nrows) - 1; j >= 0; j-- )
4286  {
4287 #ifdef PDEBUG
4288  Print("F[%d]:", j);
4289  p_wrp(F->m[j], r);
4290 #endif
4291 
4292  for( poly p = F->m[j]; p != NULL; pIter(p) )
4293  {
4294  int c = p_GetComp(p, r);
4295 
4296  if( c > MIN )
4297  {
4298 #ifdef PDEBUG
4299  Print("gen[%d] -> gen(%d)\n", c, MIN + (*V)[ c - MIN - 1 ]);
4300 #endif
4301 
4302  p_SetComp( p, MIN + (*V)[ c - MIN - 1 ], r );
4303  }
4304  }
4305 #ifdef PDEBUG
4306  Print("new F[%d]:", j);
4307  p_Test(F->m[j], r);
4308  p_wrp(F->m[j], r);
4309 #endif
4310  }
4311 }
#define Print
Definition: emacs.cc:83
return P p
Definition: myNF.cc:203
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:242
#define p_GetComp(p, r)
Definition: monomials.h:72
#define MIN(a, b)
Definition: omDebug.c:102
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:405
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
void p_wrp(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:237
polyrec * poly
Definition: hilb.h:10
ring rAssure_InducedSchreyerOrdering ( const ring  r,
BOOLEAN  complete,
int  sign 
)

Definition at line 4769 of file ring.cc.

4770 { // TODO: ???? Add leading Syz-comp ordering here...????
4771 
4772 #if MYTEST
4773  Print("rAssure_InducedSchreyerOrdering(r, complete = %d, sgn = %d): r: \n", complete, sgn);
4774  rWrite(r);
4775 #ifdef RDEBUG
4776  rDebugPrint(r);
4777 #endif
4778  PrintLn();
4779 #endif
4780  assume((sgn == 1) || (sgn == -1));
4781 
4782  ring res=rCopy0(r, FALSE, FALSE); // No qideal & ordering copy.
4783 
4784  int n = rBlocks(r); // Including trailing zero!
4785 
4786  // Create 2 more blocks for prefix/suffix:
4787  res->order=(int *)omAlloc0((n+2)*sizeof(int)); // 0 .. n+1
4788  res->block0=(int *)omAlloc0((n+2)*sizeof(int));
4789  res->block1=(int *)omAlloc0((n+2)*sizeof(int));
4790  int ** wvhdl =(int **)omAlloc0((n+2)*sizeof(int**));
4791 
4792  // Encapsulate all existing blocks between induced Schreyer ordering markers: prefix and suffix!
4793  // Note that prefix and suffix have the same ringorder marker and only differ in block[] parameters!
4794 
4795  // new 1st block
4796  int j = 0;
4797  res->order[j] = ringorder_IS; // Prefix
4798  res->block0[j] = res->block1[j] = 0;
4799  // wvhdl[j] = NULL;
4800  j++;
4801 
4802  for(int i = 0; (i <= n) && (r->order[i] != 0); i++, j++) // i = [0 .. n-1] <- non-zero old blocks
4803  {
4804  res->order [j] = r->order [i];
4805  res->block0[j] = r->block0[i];
4806  res->block1[j] = r->block1[i];
4807 
4808  if (r->wvhdl[i] != NULL)
4809  {
4810  wvhdl[j] = (int*) omMemDup(r->wvhdl[i]);
4811  } // else wvhdl[j] = NULL;
4812  }
4813 
4814  // new last block
4815  res->order [j] = ringorder_IS; // Suffix
4816  res->block0[j] = res->block1[j] = sgn; // Sign of v[o]: 1 for C, -1 for c
4817  // wvhdl[j] = NULL;
4818  j++;
4819 
4820  // res->order [j] = 0; // The End!
4821  res->wvhdl = wvhdl;
4822 
4823  // j == the last zero block now!
4824  assume(j == (n+1));
4825  assume(res->order[0]==ringorder_IS);
4826  assume(res->order[j-1]==ringorder_IS);
4827  assume(res->order[j]==0);
4828 
4829 
4830  if (complete)
4831  {
4832  rComplete(res, 1);
4833 
4834 #ifdef HAVE_PLURAL
4835  if (rIsPluralRing(r))
4836  {
4837  if ( nc_rComplete(r, res, false) ) // no qideal!
4838  {
4839 #ifndef SING_NDEBUG
4840  WarnS("error in nc_rComplete"); // cleanup?// rDelete(res);// return r; // just go on..
4841 #endif
4842  }
4843  }
4844  assume(rIsPluralRing(r) == rIsPluralRing(res));
4845 #endif
4846 
4847 
4848 #ifdef HAVE_PLURAL
4849  ring old_ring = r;
4850 #endif
4851 
4852  if (r->qideal!=NULL)
4853  {
4854  res->qideal= idrCopyR_NoSort(r->qideal, r, res);
4855 
4856  assume(id_RankFreeModule(res->qideal, res) == 0);
4857 
4858 #ifdef HAVE_PLURAL
4859  if( rIsPluralRing(res) )
4860  if( nc_SetupQuotient(res, r, true) )
4861  {
4862 // WarnS("error in nc_SetupQuotient"); // cleanup? rDelete(res); return r; // just go on...?
4863  }
4864 
4865 #endif
4866  assume(id_RankFreeModule(res->qideal, res) == 0);
4867  }
4868 
4869 #ifdef HAVE_PLURAL
4870  assume((res->qideal==NULL) == (old_ring->qideal==NULL));
4871  assume(rIsPluralRing(res) == rIsPluralRing(old_ring));
4872  assume(rIsSCA(res) == rIsSCA(old_ring));
4873  assume(ncRingType(res) == ncRingType(old_ring));
4874 #endif
4875  }
4876 
4877  return res;
4878 }
#define omMemDup(s)
Definition: omAllocDecl.h:264
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
int sgn(const Rational &a)
Definition: GMPrat.cc:437
#define FALSE
Definition: auxiliary.h:140
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
Definition: ring.cc:5531
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3488
#define WarnS
Definition: emacs.cc:81
poly res
Definition: myNF.cc:322
static int rBlocks(ring r)
Definition: ring.h:513
const ring r
Definition: syzextra.cc:208
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
Definition: ring.cc:3436
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1318
void rDebugPrint(const ring r)
Definition: ring.cc:4035
int i
Definition: cfEzgcd.cc:123
Induced (Schreyer) ordering.
Definition: ring.h:692
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:236
#define NULL
Definition: omList.c:10
static bool rIsSCA(const ring r)
Definition: nc.h:206
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:206
#define omAlloc0(size)
Definition: omAllocDecl.h:211
static BOOLEAN reduce_syz ( leftv  res,
leftv  h 
)
static

NF using length.

Definition at line 1780 of file mod_main.cc.

1781 {
1782  // const ring r = currRing;
1783 
1784  if ( !( (h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD) ) )
1785  {
1786  WerrorS("`reduce_syz(<poly/vector>!, <ideal/module>, <int>, [int])` expected");
1787  return TRUE;
1788  }
1789 
1790  res->rtyp = h->Typ();
1791  const poly v = reinterpret_cast<poly>(h->Data());
1792  h=h->next;
1793 
1794  if ( !( (h!=NULL) && (h->Typ()==MODUL_CMD || h->Typ()==IDEAL_CMD ) ) )
1795  {
1796  WerrorS("`reduce_syz(<poly/vector>, <ideal/module>!, <int>, [int])` expected");
1797  return TRUE;
1798  }
1799 
1800  assumeStdFlag(h);
1801  const ideal M = reinterpret_cast<ideal>(h->Data()); h=h->next;
1802 
1803 
1804  if ( !( (h!=NULL) && (h->Typ()== INT_CMD) ) )
1805  {
1806  WerrorS("`reduce_syz(<poly/vector>, <ideal/module>, <int>!, [int])` expected");
1807  return TRUE;
1808  }
1809 
1810  const int iSyzComp = (int)((long)(h->Data())); h=h->next;
1811 
1812  int iLazyReduce = 0;
1813 
1814  if ( ( (h!=NULL) && (h->Typ()== INT_CMD) ) )
1815  iLazyReduce = (int)((long)(h->Data()));
1816 
1817  res->data = (void *)kNFLength(M, currRing->qideal, v, iSyzComp, iLazyReduce); // NOTE: currRing :(
1818  return FALSE;
1819 }
Definition: tok.h:98
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
#define M
Definition: sirandom.c:24
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1455
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
polyrec * poly
Definition: hilb.h:10
int rGetISPos ( const int  p,
const ring  r 
)

Finds p^th IS ordering, and returns its position in r->typ[] returns -1 if something went wrong! p - starts with 0!

return the position of the p^th IS block order block in r->typ[]...

Definition at line 4905 of file ring.cc.

4906 {
4907  // Put the reference set F into the ring -ordering -recor
4908 #if MYTEST
4909  Print("rIsIS(p: %d)\nF:", p);
4910  PrintLn();
4911 #endif
4912 
4913  if (r->typ==NULL)
4914  {
4915 // dReportError("'rIsIS:' Error: wrong ring! (typ == NULL)");
4916  return -1;
4917  }
4918 
4919  int j = p; // Which IS record to use...
4920  for( int pos = 0; pos < r->OrdSize; pos++ )
4921  if( r->typ[pos].ord_typ == ro_is)
4922  if( j-- == 0 )
4923  return pos;
4924 
4925  return -1;
4926 }
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
Definition: ring.h:69
#define NULL
Definition: omList.c:10
static BOOLEAN SetInducedReferrence ( leftv  res,
leftv  h 
)
static

Returns old SyzCompLimit, can set new limit.

Definition at line 1698 of file mod_main.cc.

1699 {
1700  NoReturn(res);
1701 
1702  const ring r = currRing;
1703 
1704  if( !( (h!=NULL) && ( (h->Typ()==IDEAL_CMD) || (h->Typ()==MODUL_CMD))) )
1705  {
1706  WerrorS("`SetInducedReferrence(<ideal/module>, [int[, int]])` expected");
1707  return TRUE;
1708  }
1709 
1710  const ideal F = (ideal)h->Data(); ; // No copy!
1711  h=h->next;
1712 
1713  int rank = 0;
1714 
1715  if ((h!=NULL) && (h->Typ()==INT_CMD))
1716  {
1717  rank = (int)((long)(h->Data())); h=h->next;
1718  assume(rank >= 0);
1719  } else
1720  rank = id_RankFreeModule(F, r); // Starting syz-comp (1st: i+1)
1721 
1722  int p = 0; // which IS-block? p^th!
1723 
1724  if ((h!=NULL) && (h->Typ()==INT_CMD))
1725  {
1726  p = (int)((long)(h->Data())); h=h->next;
1727  assume(p >= 0);
1728  }
1729 
1730  const int posIS = rGetISPos(p, r);
1731 
1732  if( /*(*/ -1 == posIS /*)*/ )
1733  {
1734  WerrorS("`SetInducedReferrence(<ideal/module>, [int[, int]])` called on incompatible ring (not created by 'MakeInducedSchreyerOrdering'!)");
1735  return TRUE;
1736  }
1737 
1738 
1739 
1740  // F & componentWeights belong to that ordering block of currRing now:
1741  rSetISReference(r, F, rank, p); // F will be copied!
1742  return FALSE;
1743 }
Definition: tok.h:98
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define assume(x)
Definition: mod2.h:405
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p)
Changes r by setting induced ordering parameters: limit and reference leading terms F belong to r...
Definition: ring.cc:4937
void * Data()
Definition: subexpr.cc:1118
int rGetISPos(const int p, const ring r)
Finds p^th IS ordering, and returns its position in r->typ[] returns -1 if something went wrong! p - ...
Definition: ring.cc:4905
static BOOLEAN SetSyzComp ( leftv  res,
leftv  h 
)
static

Returns old SyzCompLimit, can set new limit.

Definition at line 1501 of file mod_main.cc.

1502 {
1503  NoReturn(res);
1504 
1505  const ring r = currRing;
1506 
1507  if( !rIsSyzIndexRing(r) )
1508  {
1509  WerrorS("`SetSyzComp(<int>)` called on incompatible ring (not created by 'MakeSyzCompOrdering'!)");
1510  return TRUE;
1511  }
1512 
1513  res->rtyp = INT_CMD;
1514  res->data = reinterpret_cast<void *>(rGetCurrSyzLimit(r)); // return old syz limit
1515 
1516  if ((h!=NULL) && (h->Typ()==INT_CMD))
1517  {
1518  const int iSyzComp = (int)reinterpret_cast<long>(h->Data());
1519  assume( iSyzComp > 0 );
1520  rSetSyzComp(iSyzComp, currRing);
1521  }
1522 
1523  return FALSE;
1524 }
Definition: tok.h:98
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:711
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:714
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
void rSetSyzComp(int k, const ring r)
Definition: ring.cc:4991
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
END_NAMESPACE int SI_MOD_INIT() syzextra ( SModulFunctions psModulFunctions)

Definition at line 2000 of file mod_main.cc.

2001 {
2002 
2003 #define ADD(C,D,E) \
2004  psModulFunctions->iiAddCproc((currPack->libname? currPack->libname: ""), (char*)C, D, E);
2005 
2006 
2007 // #define ADD(A,B,C,D,E) ADD0(iiAddCproc, "", C, D, E)
2008 
2009 //#define ADD0(A,B,C,D,E) A(B, (char*)C, D, E)
2010 // #define ADD(A,B,C,D,E) ADD0(A->iiAddCproc, B, C, D, E)
2011  ADD("ClearContent", FALSE, _ClearContent);
2012  ADD("ClearDenominators", FALSE, _ClearDenominators);
2013 
2014  ADD("m2_end", FALSE, _m2_end);
2015 
2016  ADD("DetailedPrint", FALSE, DetailedPrint);
2017  ADD("leadmonomial", FALSE, _leadmonom);
2018  ADD("leadcomp", FALSE, leadcomp);
2019  ADD("leadrawexp", FALSE, leadrawexp);
2020 
2021  ADD("ISUpdateComponents", FALSE, ISUpdateComponents);
2022  ADD("SetInducedReferrence", FALSE, SetInducedReferrence);
2023  ADD("GetInducedData", FALSE, GetInducedData);
2024  ADD("SetSyzComp", FALSE, SetSyzComp);
2025  ADD("MakeInducedSchreyerOrdering", FALSE, MakeInducedSchreyerOrdering);
2026  ADD("MakeSyzCompOrdering", FALSE, MakeSyzCompOrdering);
2027 
2028  ADD("ProfilerStart", FALSE, _ProfilerStart);
2029  ADD("ProfilerStop", FALSE, _ProfilerStop );
2030 
2031  ADD("noop", FALSE, noop);
2032  ADD("idPrepare", FALSE, idPrepare);
2033  ADD("reduce_syz", FALSE, reduce_syz);
2034 
2035  ADD("p_Content", FALSE, _p_Content);
2036 
2037  ADD("Tail", FALSE, Tail);
2038 
2039  ADD("ComputeLeadingSyzygyTerms", FALSE, _ComputeLeadingSyzygyTerms);
2040  ADD("Compute2LeadingSyzygyTerms", FALSE, _Compute2LeadingSyzygyTerms);
2041 
2042  ADD("Sort_c_ds", FALSE, _Sort_c_ds);
2043  ADD("FindReducer", FALSE, _FindReducer);
2044 
2045 
2046  ADD("ReduceTerm", FALSE, _ReduceTerm);
2047  ADD("TraverseTail", FALSE, _TraverseTail);
2048 
2049 
2050  ADD("SchreyerSyzygyNF", FALSE, _SchreyerSyzygyNF);
2051  ADD("ComputeSyzygy", FALSE, _ComputeSyzygy);
2052 
2053  ADD("ComputeResolution", FALSE, _ComputeResolution);
2054 // ADD("GetAMData", FALSE, GetAMData);
2055 
2056  ADD("NumberStatsInit", FALSE, _NumberStatsInit);
2057  ADD("NumberStatsPrint", FALSE, _NumberStatsPrint);
2058 
2059  // ADD("", FALSE, );
2060 
2061 #undef ADD
2062  return MAX_TOK;
2063 }
static BOOLEAN idPrepare(leftv res, leftv h)
Get raw syzygies (idPrepare)
Definition: mod_main.cc:1823
static BOOLEAN noop(leftv __res, leftv)
Definition: mod_main.cc:211
#define FALSE
Definition: auxiliary.h:140
Definition: tok.h:217
static BOOLEAN _ClearContent(leftv res, leftv h)
wrapper around n_ClearContent
Definition: mod_main.cc:102
static BOOLEAN Tail(leftv res, leftv h)
wrapper around p_Tail and id_Tail
Definition: mod_main.cc:490
static BOOLEAN SetSyzComp(leftv res, leftv h)
Returns old SyzCompLimit, can set new limit.
Definition: mod_main.cc:1501
static BOOLEAN MakeSyzCompOrdering(leftv res, leftv)
Endowe the current ring with additional (leading) Syz-component ordering.
Definition: mod_main.cc:1458
static BOOLEAN DetailedPrint(leftv __res, leftv h)
Definition: mod_main.cc:274
static BOOLEAN leadrawexp(leftv res, leftv h)
Get raw leading exponent vector.
Definition: mod_main.cc:1422
static BOOLEAN _ComputeResolution(leftv res, leftv h)
Definition: mod_main.cc:1148
static BOOLEAN GetInducedData(leftv res, leftv h)
?
Definition: mod_main.cc:1527
static BOOLEAN _ProfilerStop(leftv __res, leftv)
Definition: mod_main.cc:235
static BOOLEAN leadcomp(leftv res, leftv h)
Get leading component.
Definition: mod_main.cc:1386
#define ADD(C, D, E)
static BOOLEAN _SchreyerSyzygyNF(leftv res, leftv h)
Definition: mod_main.cc:789
static BOOLEAN _p_Content(leftv res, leftv h)
Get raw syzygies (idPrepare)
Definition: mod_main.cc:1915
static BOOLEAN _TraverseTail(leftv res, leftv h)
Definition: mod_main.cc:1043
static BOOLEAN SetInducedReferrence(leftv res, leftv h)
Returns old SyzCompLimit, can set new limit.
Definition: mod_main.cc:1698
static BOOLEAN MakeInducedSchreyerOrdering(leftv res, leftv h)
Same for Induced Schreyer ordering (ordering on components is defined by sign!)
Definition: mod_main.cc:1473
static BOOLEAN _ProfilerStart(leftv __res, leftv h)
Definition: mod_main.cc:217
static BOOLEAN _NumberStatsInit(leftv res, leftv h)
Definition: mod_main.cc:1958
static BOOLEAN _ComputeLeadingSyzygyTerms(leftv res, leftv h)
Definition: mod_main.cc:530
static BOOLEAN _FindReducer(leftv res, leftv h)
proc SSFindReducer(def product, def syzterm, def L, def T, list #)
Definition: mod_main.cc:692
static BOOLEAN reduce_syz(leftv res, leftv h)
NF using length.
Definition: mod_main.cc:1780
static BOOLEAN _Compute2LeadingSyzygyTerms(leftv res, leftv h)
Definition: mod_main.cc:642
static BOOLEAN _NumberStatsPrint(leftv res, leftv h)
Definition: mod_main.cc:1979
static BOOLEAN _ClearDenominators(leftv res, leftv h)
wrapper around n_ClearDenominators
Definition: mod_main.cc:148
static BOOLEAN _ReduceTerm(leftv res, leftv h)
proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #)
Definition: mod_main.cc:898
static BOOLEAN _ComputeSyzygy(leftv res, leftv h)
module (LL, TT) = SSComputeSyzygy(L, T); Compute Syz(L ++ T) = N = LL ++ TT
Definition: mod_main.cc:1296
static BOOLEAN _Sort_c_ds(leftv res, leftv h)
sorting wrt <c,ds> & reversing... change the input inplace!!!
Definition: mod_main.cc:580
static BOOLEAN _m2_end(leftv res, leftv h)
Definition: mod_main.cc:1939
static BOOLEAN _leadmonom(leftv res, leftv h)
Get leading term without a module component.
Definition: mod_main.cc:1366
static BOOLEAN ISUpdateComponents(leftv res, leftv h)
Definition: mod_main.cc:1748
static BOOLEAN Tail ( leftv  res,
leftv  h 
)
static

wrapper around p_Tail and id_Tail

Definition at line 490 of file mod_main.cc.

491 {
492  NoReturn(res);
493 
494  if( h == NULL )
495  {
496  WarnS("Tail needs a poly/vector/ideal/module argument...");
497  return TRUE;
498  }
499 
500  assume( h != NULL );
501 
502  const ring r = currRing;
503 
504  if( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD)
505  {
506  res->data = p_Tail( (const poly)h->Data(), r );
507  res->rtyp = h->Typ();
508 
509  h = h->Next(); assume (h == NULL);
510 
511  return FALSE;
512  }
513 
514  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
515  {
516  res->data = id_Tail( (const ideal)h->Data(), r );
517  res->rtyp = h->Typ();
518 
519  h = h->Next(); assume (h == NULL);
520 
521  return FALSE;
522  }
523 
524  WarnS("Tail needs a single poly/vector/ideal/module argument...");
525  return TRUE;
526 }
static void NoReturn(leftv &res)
Definition: mod_main.cc:95
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
poly p_Tail(const poly p, const ring r)
return the tail of a given polynomial or vector returns NULL if input is NULL, otherwise the result i...
Definition: syzextra.cc:501
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:976
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1118
ideal id_Tail(const ideal id, const ring r)
return the tail of a given ideal or module returns NULL if input is NULL, otherwise the result is a n...
Definition: syzextra.cc:510
polyrec * poly
Definition: hilb.h:10
USING_NAMESPACE ( SINGULARXXNAME::DEBUG  )

Definition at line 62 of file mod_main.cc.

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 }
#define FALSE
Definition: auxiliary.h:140
#define id_Test(A, lR)
Definition: simpleideals.h:80
#define p_GetComp(p, r)
Definition: monomials.h:72
#define TRUE
Definition: auxiliary.h:144
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
#define IDELEMS(i)
Definition: simpleideals.h:24
#define rRing_has_Comp(r)
Definition: monomials.h:274
#define NULL
Definition: omList.c:10
int l
Definition: cfEzgcd.cc:94
static void view ( const intvec v)
inlinestatic

Definition at line 252 of file mod_main.cc.

253 {
254 #ifndef SING_NDEBUG
255  v->view();
256 #else
257  // This code duplication is only due to Hannes's #ifndef SING_NDEBUG!
258  Print ("intvec: {rows: %d, cols: %d, length: %d, Values: \n", v->rows(), v->cols(), v->length());
259 
260  for (int i = 0; i < v->rows(); i++)
261  {
262  Print ("Row[%3d]:", i);
263  for (int j = 0; j < v->cols(); j++)
264  Print (" %5d", (*v)[j + i * (v->cols())] );
265  PrintLn ();
266  }
267  PrintS ("}\n");
268 #endif
269 
270 }
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
int length() const
Definition: intvec.h:86
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
int cols() const
Definition: intvec.h:87
int rows() const
Definition: intvec.h:88
void view() const
Definition: intvec.cc:135