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 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:227
void PrintLn()
Definition: reporter.cc:322
#define Print
Definition: emacs.cc:83
int int kStrategy strat if(h==NULL) return NULL
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:322
#define Print
Definition: emacs.cc:83
int int kStrategy strat if(h==NULL) return NULL
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:46

Function Documentation

static BOOLEAN _ClearContent ( leftv  res,
leftv  h 
)
static

wrapper around n_ClearContent

Definition at line 77 of file mod_main.cc.

78 {
79  NoReturn(res);
80 
81  const char *usage = "'ClearContent' needs a (non-zero!) poly or vector argument...";
82 
83  if( h == NULL )
84  {
85  WarnS(usage);
86  return TRUE;
87  }
88 
89  assume( h != NULL );
90 
91  if( !( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD) )
92  {
93  WarnS(usage);
94  return TRUE;
95  }
96 
97  assume (h->Next() == NULL);
98 
99  poly ph = reinterpret_cast<poly>(h->Data());
100 
101  if( ph == NULL )
102  {
103  WarnS(usage);
104  return TRUE;
105  }
106 
107  const ring r = currRing;
108  assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf;
109 
110  number n;
111 
112  // experimentall (recursive enumerator treatment) of alg. ext
113  CPolyCoeffsEnumerator itr(ph);
114  n_ClearContent(itr, n, C);
115 
116  res->data = n;
117  res->rtyp = NUMBER_CMD;
118 
119  return FALSE;
120 }
#define FALSE
Definition: auxiliary.h:140
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define TRUE
Definition: auxiliary.h:144
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:949
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:927
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.
polyrec * poly
Definition: hilb.h:10
#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:1091
static BOOLEAN _ClearDenominators ( leftv  res,
leftv  h 
)
static

wrapper around n_ClearDenominators

Definition at line 123 of file mod_main.cc.

124 {
125  NoReturn(res);
126 
127  const char *usage = "'ClearDenominators' needs a (non-zero!) poly or vector argument...";
128 
129  if( h == NULL )
130  {
131  WarnS(usage);
132  return TRUE;
133  }
134 
135  assume( h != NULL );
136 
137  if( !( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD) )
138  {
139  WarnS(usage);
140  return TRUE;
141  }
142 
143  assume (h->Next() == NULL);
144 
145  poly ph = reinterpret_cast<poly>(h->Data());
146 
147  if( ph == NULL )
148  {
149  WarnS(usage);
150  return TRUE;
151  }
152 
153  const ring r = currRing;
154  assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf;
155 
156  number n;
157 
158  // experimentall (recursive enumerator treatment) of alg. ext.
159  CPolyCoeffsEnumerator itr(ph);
160  n_ClearDenominators(itr, n, C);
161 
162  res->data = n;
163  res->rtyp = NUMBER_CMD;
164 
165  return FALSE;
166 }
#define FALSE
Definition: auxiliary.h:140
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define TRUE
Definition: auxiliary.h:144
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:949
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.
polyrec * poly
Definition: hilb.h:10
#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:1091
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:934
static BOOLEAN _Compute2LeadingSyzygyTerms ( leftv  res,
leftv  h 
)
static

Definition at line 617 of file mod_main.cc.

618 {
620 
621  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
622 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
623  const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
624 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
625 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
626 
627  const ring r = attributes.m_rBaseRing;
628  NoReturn(res);
629 
630  if( h == NULL )
631  {
632  WarnS("Compute2LeadingSyzygyTerms needs an argument...");
633  return TRUE;
634  }
635 
636  assume( h != NULL );
637 
638  assume( OPT__LEAD2SYZ ); // ???
639 
640  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
641  {
642  const ideal id = (const ideal)h->Data();
643 
644  assume(id != NULL);
645 
646  if( UNLIKELY( OPT__DEBUG ) )
647  {
648  PrintS("Compute2LeadingSyzygyTerms::Input: \n");
649  dPrint(id, r, r, 0);
650  }
651 
652  h = h->Next(); assume (h == NULL);
653 
654  res->data = Compute2LeadingSyzygyTerms(id, attributes);
655  res->rtyp = MODUL_CMD;
656 
657  return FALSE;
658  }
659 
660  WarnS("Compute2LeadingSyzygyTerms needs a single ideal/module argument...");
661  return TRUE;
662 }
Computation attribute storage.
Definition: syzextra.h:189
static ideal Compute2LeadingSyzygyTerms(const ideal &L, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:592
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
const int OPT__DEBUG
Definition: syzextra.cc:229
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:949
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:64
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:1091
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 505 of file mod_main.cc.

506 {
508 
509  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
510 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
511  const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
512 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
513 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
514 
515  const ring r = attributes.m_rBaseRing;
516  NoReturn(res);
517 
518  if( h == NULL )
519  {
520  WarnS("ComputeLeadingSyzygyTerms needs an argument...");
521  return TRUE;
522  }
523 
524  assume( h != NULL );
525 
526  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
527  {
528  const ideal id = (const ideal)h->Data();
529 
530  assume(id != NULL);
531 
532  if( UNLIKELY( OPT__DEBUG ) )
533  {
534  PrintS("ComputeLeadingSyzygyTerms::Input: \n");
535  dPrint(id, r, r, 0);
536  }
537 
538  assume( !OPT__LEAD2SYZ );
539 
540  h = h->Next(); assume (h == NULL);
541 
542  const ideal newid = ComputeLeadingSyzygyTerms(id, attributes);
543 
544  res->data = newid; res->rtyp = MODUL_CMD;
545  return FALSE;
546  }
547 
548  WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument...");
549  return TRUE;
550 }
Computation attribute storage.
Definition: syzextra.h:189
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
const int OPT__DEBUG
Definition: syzextra.cc:229
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:949
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:64
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:1091
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 1123 of file mod_main.cc.

1124 {
1125  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
1126 
1127  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
1128 
1129  const char* usage = "`ComputeResolution(<ideal/module>, <same as before>, <same as before>[,int])` expected";
1130  const ring r = attributes.m_rBaseRing;
1131 
1132  NoReturn(res);
1133 
1134  // input
1135  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1136  {
1137  WerrorS(usage);
1138  return TRUE;
1139  }
1140 
1141  const int type = h->Typ();
1142  ideal M = (ideal)(h->CopyD()); // copy for resolution...!???
1143  int size = IDELEMS(M);
1144 
1145  assume( size >= 0 );
1146 
1147  h = h->Next();
1148 
1149  // lead
1150  if ((h==NULL) || (h->Typ()!=type) || (h->Data() == NULL))
1151  {
1152  WerrorS(usage);
1153  return TRUE;
1154  }
1155 
1156  ideal L = (ideal)(h->CopyD()); // no copy!
1157  assume( IDELEMS(L) == size );
1158 
1159  h = h->Next();
1160  if ((h==NULL) || (h->Typ()!=type) || (h->Data() == NULL))
1161  {
1162  WerrorS(usage);
1163  return TRUE;
1164  }
1165 
1166  ideal T = (ideal)(h->CopyD()); // no copy!
1167  assume( IDELEMS(T) == size );
1168 
1169  h = h->Next();
1170 
1171  // length..?
1172  long length = 0;
1173 
1174  if ((h!=NULL) && (h->Typ()==INT_CMD))
1175  {
1176  length = (long)(h->Data());
1177  h = h->Next();
1178  }
1179 
1180  assume( h == NULL );
1181 
1182  if( length <= 0 )
1183  length = 1 + rVar(r);
1184 
1185  if( UNLIKELY( OPT__DEBUG ) )
1186  {
1187  PrintS("ComputeResolution(M, length)::Input: \n");
1188  Print( "starting length: %ld\n", length);
1189  PrintS("M: \n"); dPrint(M, r, r, 0);
1190  PrintS("L=LEAD(M): \n"); dPrint(L, r, r, 0);
1191  PrintS("T=TAIL(M): \n"); dPrint(T, r, r, 0);
1192  }
1193 
1194 
1195  syStrategy _res=(syStrategy)omAlloc0(sizeof(ssyStrategy));
1196 
1197 // class ssyStrategy; typedef ssyStrategy * syStrategy;
1198 // typedef ideal * resolvente;
1199 
1200  _res->length = length + 1; // index + 1;
1201  _res->fullres = (resolvente)omAlloc0((_res->length+1)*sizeof(ideal));
1202  int index = 0;
1203  _res->fullres[index++] = M;
1204 
1205 // if (UNLIKELY(attributes.OPT__TREEOUTPUT))
1206 // Print("{ \"RESOLUTION: HYBRIDNF:%d, TAILREDSYZ: %d, LEAD2SYZ: %d, IGNORETAILS: %d\": [\n", attributes.OPT__HYBRIDNF, attributes.OPT__TAILREDSYZ, attributes.OPT__LEAD2SYZ, attributes.OPT__IGNORETAILS);
1207 
1208  while( (!idIs0(L)) && (index < length))
1209  {
1210  attributes.nextSyzygyLayer();
1211  ideal LL, TT;
1212 
1213  ComputeSyzygy(L, T, LL, TT, attributes);
1214 
1215  if( UNLIKELY( OPT__DEBUG ) )
1216  {
1217  Print("ComputeResolution()::Separated Syzygy[%d]: \n", index);
1218 // PrintS("LL: \n"); dPrint(LL, r, r, 0);
1219 // PrintS("TT: \n"); dPrint(TT, r, r, 0);
1220  }
1221  size = IDELEMS(LL);
1222 
1223  assume( size == IDELEMS(TT) );
1224 
1225  id_Delete(&L, r); id_Delete(&T, r);
1226 
1227  L = LL; T = TT;
1228 
1229  // id_Add(T, L, r);
1230  M = idInit(size, 0);
1231  for( int i = size-1; i >= 0; i-- )
1232  {
1233  M->m[i] = p_Add_q(p_Copy(T->m[i], r), p_Copy(L->m[i], r), r); // TODO: :(((
1234  }
1235  M->rank = id_RankFreeModule(M, r);
1236 
1237  if( UNLIKELY( OPT__DEBUG ) )
1238  {
1239  Print("ComputeResolution()::Restored Syzygy[%d]: \n", index);
1240  PrintS("M = LL + TT: \n"); dPrint(M, r, r, 0);
1241  }
1242 
1243  _res->fullres[index++] = M; // ???
1244  }
1245 // if ( UNLIKELY(attributes.OPT__TREEOUTPUT) )
1246 // PrintS("] }\n");
1247 
1248  id_Delete(&L, r); id_Delete(&T, r);
1249 
1250  res->data = _res;
1251  res->rtyp = RESOLUTION_CMD;
1252 
1253  if( UNLIKELY(OPT__DEBUG) )
1254  {
1255  Print("ComputeResolution::Output (index: %d): ", index);
1256 // class sleftv; typedef sleftv * leftv;
1257  sleftv _h;
1258  DetailedPrint(&_h, res);
1259  }
1260 
1261 // omFreeSize(_res, sizeof(ssyStrategy));
1262 
1263  return FALSE;
1264 
1265 }
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:85
static void ComputeSyzygy(const ideal L, const ideal T, ideal &LL, ideal &TT, const SchreyerSyzygyComputationFlags A)
Definition: syzextra.h:576
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:531
void id_Delete(ideal *h, ring r)
#define TRUE
Definition: auxiliary.h:144
const int OPT__DEBUG
Definition: syzextra.cc:229
static BOOLEAN DetailedPrint(leftv __res, leftv h)
Definition: mod_main.cc:249
void WerrorS(const char *s)
Definition: feFopen.cc:23
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
int Typ()
Definition: subexpr.cc:949
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
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)
leftv Next()
Definition: subexpr.h:137
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:64
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:19
resolvente fullres
Definition: syz.h:57
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:597
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)
Definition: simpleideals.cc:40
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1091
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:884
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)
void * CopyD(int t)
Definition: subexpr.cc:656
#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 1271 of file mod_main.cc.

1272 {
1273  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
1274 
1275  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
1276 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
1277 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
1278 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
1279 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
1280 
1281  const char* usage = "`ComputeSyzygy(<ideal/module>, <ideal/module>)` expected";
1282  const ring r = attributes.m_rBaseRing;
1283 
1284  NoReturn(res);
1285 
1286  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1287  {
1288  WerrorS(usage);
1289  return TRUE;
1290  }
1291 
1292  const ideal L = (ideal) h->Data();
1293 
1294  assume( IDELEMS(L) > 0 );
1295 
1296  h = h->Next();
1297  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1298  {
1299  WerrorS(usage);
1300  return TRUE;
1301  }
1302 
1303  const ideal T = (ideal) h->Data();
1304  assume( IDELEMS(L) == IDELEMS(T) );
1305 
1306 
1307  h = h->Next(); assume( h == NULL );
1308 
1309  if( UNLIKELY( OPT__DEBUG ) )
1310  {
1311  PrintS("ComputeSyzygy(L, T)::Input: \n");
1312 // PrintS("L: "); dPrint(L, r, r, 0);
1313 // PrintS("T: "); dPrint(T, r, r, 0);
1314  }
1315 
1316  ideal LL, TT;
1317 
1318  ComputeSyzygy(L, T, LL, TT, attributes);
1319 
1320  lists l = (lists)omAllocBin(slists_bin); l->Init(2);
1321 
1322  l->m[0].rtyp = MODUL_CMD; l->m[0].data = reinterpret_cast<void *>(LL);
1323 
1324  l->m[1].rtyp = MODUL_CMD; l->m[1].data = reinterpret_cast<void *>(TT);
1325 
1326  res->data = l; res->rtyp = LIST_CMD;
1327 
1328  if( UNLIKELY( OPT__DEBUG ) )
1329  {
1330  PrintS("ComputeSyzygy::Output: \nLL: \n");
1331  dPrint(LL, r, r, 0);
1332  PrintS("\nTT: \n");
1333  dPrint(TT, r, r, 0);
1334  }
1335 
1336  return FALSE;
1337 
1338 }
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
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
const int OPT__DEBUG
Definition: syzextra.cc:229
void WerrorS(const char *s)
Definition: feFopen.cc:23
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
int Typ()
Definition: subexpr.cc:949
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:64
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:19
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:1091
Definition: tok.h:96
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 667 of file mod_main.cc.

668 {
670 
671  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
672 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
673 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
674 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
675  const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
676 
677  const char* usage = "`FindReducer(<poly/vector>, <vector/0>, <ideal/module>[,<module>])` expected";
678  const ring r = attributes.m_rBaseRing;
679 
680  NoReturn(res);
681 
682 
683  if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL))
684  {
685  WerrorS(usage);
686  return TRUE;
687  }
688 
689  const poly product = (poly) h->Data(); assume (product != NULL);
690 
691 
692  h = h->Next();
693  if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) )
694  {
695  WerrorS(usage);
696  return TRUE;
697  }
698 
699  poly syzterm = NULL;
700 
701  if(h->Typ()==VECTOR_CMD)
702  syzterm = (poly) h->Data();
703 
704 
705 
706  h = h->Next();
707  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
708  {
709  WerrorS(usage);
710  return TRUE;
711  }
712 
713  const ideal L = (ideal) h->Data(); h = h->Next();
714 
715  assume( IDELEMS(L) > 0 );
716 
717  ideal LS = NULL;
718 
719  if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL))
720  {
721  LS = (ideal)h->Data();
722  h = h->Next();
723  }
724 
725 #ifndef SING_NDEBUG
726  if( LIKELY( OPT__TAILREDSYZ) )
727  assume (LS != NULL);
728 #endif
729 
730  assume( h == NULL );
731 
732  if( UNLIKELY(OPT__DEBUG) )
733  {
734  PrintS("FindReducer(product, syzterm, L, T, #)::Input: \n");
735 
736  PrintS("product: "); dPrint(product, r, r, 0);
737  PrintS("syzterm: "); dPrint(syzterm, r, r, 0);
738 // PrintS("L: "); dPrint(L, r, r, 0);
739 // PrintS("T: "); dPrint(T, r, r, 0);
740 
741  if( LS == NULL )
742 // PrintS("LS: NULL\n");
743  ;
744  else
745  {
746 // PrintS("LS: "); dPrint(LS, r, r, 0);
747  }
748  }
749 
750  res->rtyp = VECTOR_CMD;
751  res->data = FindReducer(product, syzterm, L, LS, attributes);
752 
753  if( UNLIKELY( OPT__DEBUG ) )
754  {
755  PrintS("FindReducer::Output: \n");
756  dPrint((poly)res->data, r, r, 0);
757  }
758 
759  return FALSE;
760 
761 }
Computation attribute storage.
Definition: syzextra.h:189
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
const int OPT__DEBUG
Definition: syzextra.cc:229
void WerrorS(const char *s)
Definition: feFopen.cc:23
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define LIKELY(expression)
Definition: tgb_internal.h:837
int Typ()
Definition: subexpr.cc:949
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:64
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:19
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1091
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 1341 of file mod_main.cc.

1342 {
1343  NoReturn(res);
1344 
1345  if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD) && (h->Data() != NULL))
1346  {
1347  const ring r = currRing;
1348  const poly p = (poly)(h->Data());
1349 
1350  res->data = reinterpret_cast<void *>( leadmonom(p, r) );
1351  res->rtyp = POLY_CMD;
1352 
1353  return FALSE;
1354  }
1355 
1356  WerrorS("`leadmonom(<poly/vector>)` expected");
1357  return TRUE;
1358 }
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:23
int Typ()
Definition: subexpr.cc:949
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
polyrec * poly
Definition: hilb.h:10
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1091
static BOOLEAN _m2_end ( leftv  res,
leftv  h 
)
static

Definition at line 1914 of file mod_main.cc.

1915 {
1916  int ret = 0;
1917 
1918  if ( (h!=NULL) && (h->Typ()!=INT_CMD) )
1919  {
1920  WerrorS("`m2_end([<int>])` expected");
1921  return TRUE;
1922  }
1923  ret = (int)(long)(h->Data());
1924 
1925  m2_end( ret );
1926 
1927  NoReturn(res);
1928  return FALSE;
1929 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
Definition: tok.h:85
#define FALSE
Definition: auxiliary.h:140
void m2_end(int i)
Definition: misc_ip.cc:1074
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
int Typ()
Definition: subexpr.cc:949
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1091
static BOOLEAN _NumberStatsInit ( leftv  res,
leftv  h 
)
static

Definition at line 1933 of file mod_main.cc.

1934 {
1935  if ( (h!=NULL) && (h->Typ()!=INT_CMD) )
1936  {
1937  WerrorS("`NumberStatsInit([<int>])` expected");
1938  return TRUE;
1939  }
1940 
1941  unsigned long v = 0;
1942 
1943  if( h != NULL )
1944  v = (unsigned long)(h->Data());
1945 
1946  number_stats_Init(v);
1947 
1948  NoReturn(res);
1949  return FALSE;
1950 }
Definition: tok.h:85
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
int Typ()
Definition: subexpr.cc:949
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:1091
static BOOLEAN _NumberStatsPrint ( leftv  res,
leftv  h 
)
static

Definition at line 1954 of file mod_main.cc.

1955 {
1956  if ( (h!=NULL) && (h->Typ()!=STRING_CMD) )
1957  {
1958  WerrorS("`NumberStatsPrint([<string>])` expected");
1959  return TRUE;
1960  }
1961 
1962  const char* msg = NULL;
1963 
1964  if( h != NULL )
1965  msg = (const char*)(h->Data());
1966 
1967  number_stats_Print(msg);
1968 
1969  NoReturn(res);
1970  return FALSE;
1971 }
static void number_stats_Print(const char *const msg=NULL)
print out all counters
Definition: numstats.h:136
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
int Typ()
Definition: subexpr.cc:949
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1091
static BOOLEAN _p_Content ( leftv  res,
leftv  h 
)
static

Get raw syzygies (idPrepare)

Definition at line 1890 of file mod_main.cc.

1891 {
1892  if ( !( (h!=NULL) && (h->Typ()==POLY_CMD) && (h->Data() != NULL) ) )
1893  {
1894  WerrorS("`p_Content(<poly-var>)` expected");
1895  return TRUE;
1896  }
1897 
1898 
1899  const poly p = reinterpret_cast<poly>(h->Data());
1900 
1901 
1902  pTest(p); pWrite(p); PrintLn();
1903 
1904 
1905  p_Content( p, currRing);
1906 
1907  pTest(p);
1908  pWrite(p); PrintLn();
1909 
1910  NoReturn(res);
1911  return FALSE;
1912 }
void PrintLn()
Definition: reporter.cc:322
#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:23
int Typ()
Definition: subexpr.cc:949
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
polyrec * poly
Definition: hilb.h:10
void p_Content(poly ph, const ring r)
Definition: p_polys.cc:2182
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1091
static BOOLEAN _ProfilerStart ( leftv  __res,
leftv  h 
)
static

Definition at line 192 of file mod_main.cc.

193 {
194  NoReturn(__res);
195 #if GOOGLE_PROFILE_ENABLED
196  if( h!= NULL && h->Typ() == STRING_CMD )
197  {
198  const char* name = (char*)(h->Data());
199  assume( name != NULL );
200  ProfilerStart(name);
201  } else
202  WerrorS("ProfilerStart requires a string [name] argument");
203 #else
204  WarnS("Sorry no google profiler support (GOOGLE_PROFILE_ENABLE!=1)...");
205 // return TRUE; // ?
206 #endif // #if GOOGLE_PROFILE_ENABLED
207  return FALSE;
208  (void)h;
209 }
#define FALSE
Definition: auxiliary.h:140
void WerrorS(const char *s)
Definition: feFopen.cc:23
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:949
#define assume(x)
Definition: mod2.h:405
char name(const Variable &v)
Definition: variable.h:95
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1091
static BOOLEAN _ProfilerStop ( leftv  __res,
leftv   
)
static

Definition at line 210 of file mod_main.cc.

211 {
212  NoReturn(__res);
213 #if GOOGLE_PROFILE_ENABLED
214  ProfilerStop();
215 #else
216  WarnS("Sorry no google profiler support (GOOGLE_PROFILE_ENABLED!=1)...");
217 // return TRUE; // ?
218 #endif // #if GOOGLE_PROFILE_ENABLED
219  return FALSE;
220 }
#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 873 of file mod_main.cc.

874 {
876 
877  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
878 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
879 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
880 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
881  const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
882 
883  const char* usage = "`ReduceTerm(<poly>, <poly/vector>, <vector/0>, <ideal/module>, <ideal/module>[,<module>])` expected";
884  const ring r = attributes.m_rBaseRing;
885 
886  NoReturn(res);
887 
888  if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL))
889  {
890  WerrorS(usage);
891  return TRUE;
892  }
893 
894  const poly multiplier = (poly) h->Data(); assume (multiplier != NULL);
895 
896 
897  h = h->Next();
898  if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL))
899  {
900  WerrorS(usage);
901  return TRUE;
902  }
903 
904  const poly term4reduction = (poly) h->Data(); assume( term4reduction != NULL );
905 
906 
907  poly syztermCheck = NULL;
908 
909  h = h->Next();
910  if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) )
911  {
912  WerrorS(usage);
913  return TRUE;
914  }
915 
916  if(h->Typ()==VECTOR_CMD)
917  syztermCheck = (poly) h->Data();
918 
919 
920  h = h->Next();
921  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
922  {
923  WerrorS(usage);
924  return TRUE;
925  }
926 
927  const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 );
928 
929 
930  h = h->Next();
931  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
932  {
933  WerrorS(usage);
934  return TRUE;
935  }
936 
937  const ideal T = (ideal) h->Data();
938 
939  assume( IDELEMS(L) == IDELEMS(T) );
940 
941  ideal LS = NULL;
942 
943  h = h->Next();
944  if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL))
945  {
946  LS = (ideal)h->Data();
947  h = h->Next();
948  }
949 
950 #ifndef SING_NDEBUG
951  if( LIKELY( OPT__TAILREDSYZ) )
952  assume (LS != NULL);
953 #endif
954 
955  assume( h == NULL );
956 
957  if( UNLIKELY( OPT__DEBUG ) )
958  {
959  PrintS("ReduceTerm(m, t, syzterm, L, T, #)::Input: \n");
960 
961  PrintS("m: "); dPrint(multiplier, r, r, 0);
962  PrintS("t: "); dPrint(term4reduction, r, r, 0);
963  PrintS("syzterm: "); dPrint(syztermCheck, r, r, 0);
964 
965 // PrintS("L: "); dPrint(L, r, r, 0);
966 // PrintS("T: "); dPrint(T, r, r, 0);
967 
968  if( LS == NULL )
969 // PrintS("LS: NULL\n")
970  ;
971  else
972  {
973 // PrintS("LS: "); dPrint(LS, r, r, 0);
974  }
975  }
976 
977 
978  if ( UNLIKELY( OPT__DEBUG && syztermCheck != NULL) )
979  {
980  const int c = p_GetComp(syztermCheck, r) - 1;
981  assume( c >= 0 && c < IDELEMS(L) );
982 
983  const poly p = L->m[c];
984  assume( p != NULL ); assume( pNext(p) == NULL );
985 
986  assume( p_EqualPolys(term4reduction, p, r) ); // assume? TODO
987 
988 
989  poly m = leadmonom(syztermCheck, r);
990  assume( m != NULL ); assume( pNext(m) == NULL );
991 
992  assume( p_EqualPolys(multiplier, m, r) ); // assume? TODO
993 
994  p_Delete(&m, r);
995 
996 // NOTE: leadmonomial(syzterm) == m && L[leadcomp(syzterm)] == t
997  }
998 
999  res->rtyp = VECTOR_CMD;
1000  res->data = ReduceTerm(multiplier, term4reduction, syztermCheck, L, T, LS, attributes);
1001 
1002 
1003  if( UNLIKELY( OPT__DEBUG ) )
1004  {
1005  PrintS("ReduceTerm::Output: ");
1006 
1007  dPrint((poly)res->data, r, r, 0);
1008  }
1009 
1010 
1011  return FALSE;
1012 }
Computation attribute storage.
Definition: syzextra.h:189
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
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
const int OPT__DEBUG
Definition: syzextra.cc:229
void WerrorS(const char *s)
Definition: feFopen.cc:23
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define LIKELY(expression)
Definition: tgb_internal.h:837
int Typ()
Definition: subexpr.cc:949
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
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:64
int m
Definition: cfEzgcd.cc:119
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:19
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4288
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
#define pNext(p)
Definition: monomials.h:43
void * Data()
Definition: subexpr.cc:1091
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
static BOOLEAN _SchreyerSyzygyNF ( leftv  res,
leftv  h 
)
static

Definition at line 764 of file mod_main.cc.

765 {
767 
768  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
769 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
770 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
771  const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
772  const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
773 
774  const char* usage = "`SchreyerSyzygyNF(<vector>, <vector>, <ideal/module>, <ideal/module>[,<module>])` expected";
775  const ring r = attributes.m_rBaseRing;
776 
777  NoReturn(res);
778 
779  assume( OPT__HYBRIDNF ); // ???
780 
781  if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL))
782  {
783  WerrorS(usage);
784  return TRUE;
785  }
786 
787  const poly syz_lead = (poly) h->Data(); assume (syz_lead != NULL);
788 
789 
790  h = h->Next();
791  if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL))
792  {
793  WerrorS(usage);
794  return TRUE;
795  }
796 
797  const poly syz_2 = (poly) h->Data(); assume (syz_2 != NULL);
798 
799  h = h->Next();
800  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
801  {
802  WerrorS(usage);
803  return TRUE;
804  }
805 
806  const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 );
807 
808 
809  h = h->Next();
810  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
811  {
812  WerrorS(usage);
813  return TRUE;
814  }
815 
816  const ideal T = (ideal) h->Data();
817 
818  assume( IDELEMS(L) == IDELEMS(T) );
819 
820  ideal LS = NULL;
821 
822  h = h->Next();
823  if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL))
824  {
825  LS = (ideal)h->Data();
826  h = h->Next();
827  }
828 
829 #ifndef SING_NDEBUG
830  if( LIKELY( OPT__TAILREDSYZ) )
831  assume (LS != NULL);
832 #endif
833 
834  assume( h == NULL );
835 
836  if( UNLIKELY( OPT__DEBUG ) )
837  {
838  PrintS("SchreyerSyzygyNF(syz_lead, syz_2, L, T, #)::Input: \n");
839 
840  PrintS("syz_lead: "); dPrint(syz_lead, r, r, 0);
841  PrintS("syz_2: "); dPrint(syz_2, r, r, 0);
842 
843 // PrintS("L: "); dPrint(L, r, r, 0);
844 // PrintS("T: "); dPrint(T, r, r, 0);
845 
846  if( LS == NULL )
847 // PrintS("LS: NULL\n")
848  ;
849  else
850  {
851 // PrintS("LS: "); dPrint(LS, r, r, 0);
852  }
853  }
854 
855  res->rtyp = VECTOR_CMD;
856  res->data = SchreyerSyzygyNF(syz_lead,
857  (syz_2!=NULL)? p_Copy(syz_2, r): syz_2, L, T, LS, attributes);
858 
859  if( UNLIKELY( OPT__DEBUG ) )
860  {
861  PrintS("SchreyerSyzygyNF::Output: ");
862 
863  dPrint((poly)res->data, r, r, 0);
864  }
865 
866 
867  return FALSE;
868 }
Computation attribute storage.
Definition: syzextra.h:189
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#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
const int OPT__DEBUG
Definition: syzextra.cc:229
void WerrorS(const char *s)
Definition: feFopen.cc:23
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define LIKELY(expression)
Definition: tgb_internal.h:837
int Typ()
Definition: subexpr.cc:949
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:64
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:19
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1091
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
static BOOLEAN _Sort_c_ds ( leftv  res,
leftv  h 
)
static

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

Definition at line 555 of file mod_main.cc.

556 {
558 
559  const BOOLEAN OPT__DEBUG = FALSE; // attributes.OPT__DEBUG;
560 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
561 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
562 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
563 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
564 
565  NoReturn(res);
566 
567  const ring r = attributes.m_rBaseRing;
568  NoReturn(res);
569 
570  if( h == NULL )
571  {
572  WarnS("Sort_c_ds needs an argument...");
573  return TRUE;
574  }
575 
576  assume( h != NULL );
577 
578  if( (h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
579  && (h->rtyp == IDHDL) // must be a variable!
580  && (h->e == NULL) // not a list element
581  )
582  {
583  const ideal id = (const ideal)h->Data();
584 
585  assume(id != NULL);
586 
587  if( UNLIKELY( OPT__DEBUG ) )
588  {
589  PrintS("Sort_c_ds::Input: \n");
590  dPrint(id, r, r, 0);
591  }
592 
593  assume (h->Next() == NULL);
594 
595  id_Test(id, r);
596 
597  Sort_c_ds(id, r); // NOT A COPY! inplace sorting!!!
598 
599 // res->data = id;
600 // res->rtyp = h->Typ();
601 
602  if( UNLIKELY( OPT__DEBUG ) )
603  {
604  PrintS("Sort_c_ds::Output: \n");
605  dPrint(id, r, r, 0);
606  }
607 
608  // NOTE: nothing is to be returned!!!
609  return FALSE;
610  }
611 
612  WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument (must be a variable!)...");
613  return TRUE;
614 }
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
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:140
#define id_Test(A, lR)
Definition: simpleideals.h:67
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
const int OPT__DEBUG
Definition: syzextra.cc:229
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:949
#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:64
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:1091
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 1018 of file mod_main.cc.

1019 {
1020  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
1021 
1022  const BOOLEAN OPT__DEBUG = attributes.OPT__DEBUG;
1023 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;
1024 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
1025 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;
1026  const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
1027 
1028  const char* usage = "`TraverseTail(<poly>, <poly/vector>, <ideal/module>, <ideal/module>[,<module>])` expected";
1029  const ring r = attributes.m_rBaseRing;
1030 
1031  NoReturn(res);
1032 
1033  if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL))
1034  {
1035  WerrorS(usage);
1036  return TRUE;
1037  }
1038 
1039  const poly multiplier = (poly) h->Data(); assume (multiplier != NULL);
1040 
1041  h = h->Next();
1042  if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD))
1043  {
1044  WerrorS(usage);
1045  return TRUE;
1046  }
1047 
1048  const poly tail = (poly) h->Data();
1049 
1050  h = h->Next();
1051 
1052  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1053  {
1054  WerrorS(usage);
1055  return TRUE;
1056  }
1057 
1058  const ideal L = (ideal) h->Data();
1059 
1060  assume( IDELEMS(L) > 0 );
1061 
1062  h = h->Next();
1063  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
1064  {
1065  WerrorS(usage);
1066  return TRUE;
1067  }
1068 
1069  const ideal T = (ideal) h->Data();
1070 
1071  assume( IDELEMS(L) == IDELEMS(T) );
1072 
1073  h = h->Next();
1074 
1075  ideal LS = NULL;
1076 
1077  if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL))
1078  {
1079  LS = (ideal)h->Data();
1080  h = h->Next();
1081  }
1082 
1083 #ifndef SING_NDEBUG
1084  if( LIKELY( OPT__TAILREDSYZ) )
1085  assume (LS != NULL);
1086 #endif
1087 
1088  assume( h == NULL );
1089 
1090  if( UNLIKELY( OPT__DEBUG ) )
1091  {
1092  PrintS("TraverseTail(m, t, L, T, #)::Input: \n");
1093 
1094  PrintS("m: "); dPrint(multiplier, r, r, 0);
1095  PrintS("t: "); dPrint(tail, r, r, 0);
1096 
1097 // PrintS("L: "); dPrint(L, r, r, 0);
1098 // PrintS("T: "); dPrint(T, r, r, 0);
1099 
1100  if( LS == NULL )
1101 // PrintS("LS: NULL\n")
1102  ;
1103  else
1104  {
1105 // PrintS("LS: "); dPrint(LS, r, r, 0);
1106  }
1107  }
1108 
1109  res->rtyp = VECTOR_CMD;
1110  res->data = TraverseTail(multiplier, tail, L, T, LS, attributes);
1111 
1112 
1113  if( UNLIKELY( OPT__DEBUG ) )
1114  {
1115  PrintS("TraverseTail::Output: ");
1116  dPrint((poly)res->data, r, r, 0);
1117  }
1118 
1119  return FALSE;
1120 }
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
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
const int OPT__DEBUG
Definition: syzextra.cc:229
void WerrorS(const char *s)
Definition: feFopen.cc:23
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
#define LIKELY(expression)
Definition: tgb_internal.h:837
int Typ()
Definition: subexpr.cc:949
void * data
Definition: subexpr.h:89
const ring r
Definition: syzextra.cc:208
leftv Next()
Definition: subexpr.h:137
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
idhdl currRingHdl
Definition: ipid.cc:64
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:19
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1091
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
static BOOLEAN DetailedPrint ( leftv  __res,
leftv  h 
)
static

Definition at line 249 of file mod_main.cc.

250 {
251  NoReturn(__res);
252 
253  if( h == NULL )
254  {
255  WarnS("DetailedPrint needs an argument...");
256  return TRUE;
257  }
258 
259  if( h->Typ() == NUMBER_CMD)
260  {
261  number n = (number)h->Data();
262 
263  const ring r = currRing;
264 
265  n_Test(n, r->cf);
266 
267  StringSetS("");
268  n_Write(n, r->cf);
269  PrintS(StringEndS());
270  PrintLn();
271 
272  return FALSE;
273  }
274 
275  if( h->Typ() == RING_CMD)
276  {
277  const ring r = (const ring)h->Data();
278  rWrite(r, TRUE);
279  PrintLn();
280 #ifdef RDEBUG
281  //rDebugPrint(r);
282 #endif
283  return FALSE;
284  }
285 
286  if( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD)
287  {
288  const poly p = (const poly)h->Data(); h = h->Next();
289 
291 
292  return FALSE;
293  }
294 
295  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
296  {
297  const ideal id = (const ideal)h->Data(); h = h->Next();
298 
300 
301  return FALSE;
302  }
303 
304  if( h->Typ() == RESOLUTION_CMD )
305  {
306  const syStrategy syzstr = reinterpret_cast<const syStrategy>(h->Data());
307 
308  h = h->Next();
309 
310  int nTerms = getOptionalInteger(h, 1);
311 
312 
313  Print("RESOLUTION_CMD(%p): ", reinterpret_cast<const void*>(syzstr)); PrintLn();
314 
315  const ring save = currRing;
316  const ring r = syzstr->syRing;
317 // const ring rr = (r != NULL) ? r: save;
318 
319 
320  const int iLength = syzstr->length;
321 
322  Print("int 'length': %d", iLength); PrintLn();
323  Print("int 'regularity': %d", syzstr->regularity); PrintLn();
324  Print("short 'list_length': %hd", syzstr->list_length); PrintLn();
325  Print("short 'references': %hd", syzstr->references); PrintLn();
326 
327 
328 #define PRINT_pINTVECTOR(s, v) Print("intvec '%10s'(%p)", #v, reinterpret_cast<const void*>((s)->v)); \
329 if( (s)->v != NULL ){ PrintS(": "); view((s)->v); }; \
330 PrintLn();
331 
332  PRINT_pINTVECTOR(syzstr, resolution);
333  PRINT_pINTVECTOR(syzstr, betti);
334  PRINT_pINTVECTOR(syzstr, Tl);
335  PRINT_pINTVECTOR(syzstr, cw);
336 #undef PRINT_pINTVECTOR
337 
338  if (r == NULL)
339  Print("ring '%10s': NULL", "syRing");
340  else
341  if (r == currRing)
342  Print("ring '%10s': currRing", "syRing");
343  else
344  if (r != NULL && r != save)
345  {
346  Print("ring '%10s': ", "syRing");
347  rWrite(r);
348 #ifdef RDEBUG
349  // rDebugPrint(r);
350 #endif
351  // rChangeCurrRing(r);
352  }
353  PrintLn();
354 
355  const SRes rP = syzstr->resPairs;
356  Print("SRes 'resPairs': %p", reinterpret_cast<const void*>(rP)); PrintLn();
357 
358  if (rP != NULL)
359  for (int iLevel = 0; (iLevel < iLength) && (rP[iLevel] != NULL) && ((*syzstr->Tl)[iLevel] >= 0); iLevel++)
360  {
361  int n = 0;
362  const int iTl = (*syzstr->Tl)[iLevel];
363  for (int j = 0; (j < iTl) && ((rP[iLevel][j].lcm!=NULL) || (rP[iLevel][j].syz!=NULL)); j++)
364  {
365  if (rP[iLevel][j].isNotMinimal==NULL)
366  n++;
367  }
368  Print("minimal-resPairs-Size[1+%d]: %d", iLevel, n); PrintLn();
369  }
370 
371 
372  // const ring rrr = (iLevel > 0) ? rr : save; ?
373 #define PRINT_RESOLUTION(s, v) Print("resolution '%12s': %p", #v, reinterpret_cast<const void*>((s)->v)); PrintLn(); \
374 if ((s)->v != NULL) \
375  for (int iLevel = 0; (iLevel < iLength) && ( ((s)->v)[iLevel] != NULL ); iLevel++) \
376  { \
377  /* const ring rrr = (iLevel > 0) ? save : save; */ \
378  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)*/ ); \
379  PrintLn(); \
380  } \
381  PrintLn();
382 
383  // resolvente:
384  PRINT_RESOLUTION(syzstr, minres);
385  PRINT_RESOLUTION(syzstr, fullres);
386 
387 // assume (id_RankFreeModule (syzstr->res[1], rr) == syzstr->res[1]->rank);
388 
389  PRINT_RESOLUTION(syzstr, res);
390  PRINT_RESOLUTION(syzstr, orderedRes);
391 #undef PRINT_RESOLUTION
392 
393 #define PRINT_POINTER(s, v) Print("pointer '%17s': %p", #v, reinterpret_cast<const void*>((s)->v)); PrintLn();
394  // 2d arrays:
395  PRINT_POINTER(syzstr, truecomponents);
396  PRINT_POINTER(syzstr, ShiftedComponents);
397  PRINT_POINTER(syzstr, backcomponents);
398  PRINT_POINTER(syzstr, Howmuch);
399  PRINT_POINTER(syzstr, Firstelem);
400  PRINT_POINTER(syzstr, elemLength);
401  PRINT_POINTER(syzstr, sev);
402 
403  // arrays of intvects:
404  PRINT_POINTER(syzstr, weights);
405  PRINT_POINTER(syzstr, hilb_coeffs);
406 #undef PRINT_POINTER
407 
408 
409  if (syzstr->fullres==NULL)
410  {
411  PrintS("resolution 'fullres': (NULL) => resolution not computed yet");
412  PrintLn();
413  } else
414  {
415  Print("resolution 'fullres': (%p) => resolution seems to be computed already", reinterpret_cast<const void*>(syzstr->fullres));
416  PrintLn();
417  dPrint(*syzstr->fullres, save, save, nTerms);
418  }
419 
420 
421 
422 
423  if (syzstr->minres==NULL)
424  {
425  PrintS("resolution 'minres': (NULL) => resolution not minimized yet");
426  PrintLn();
427  } else
428  {
429  Print("resolution 'minres': (%p) => resolution seems to be minimized already", reinterpret_cast<const void*>(syzstr->minres));
430  PrintLn();
431  dPrint(*syzstr->minres, save, save, nTerms);
432  }
433 
434 
435 
436 
437  /*
438  int ** truecomponents;
439  long** ShiftedComponents;
440  int ** backcomponents;
441  int ** Howmuch;
442  int ** Firstelem;
443  int ** elemLength;
444  unsigned long ** sev;
445 
446  intvec ** weights;
447  intvec ** hilb_coeffs;
448 
449  SRes resPairs; //polynomial data for internal use only
450 
451  resolvente fullres;
452  resolvente minres;
453  resolvente res; //polynomial data for internal use only
454  resolvente orderedRes; //polynomial data for internal use only
455 */
456 
457  // if( currRing != save ) rChangeCurrRing(save);
458  }
459 
460 
461  return FALSE;
462 }
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:322
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
short references
Definition: syz.h:63
const ideal
Definition: gb_hack.h:42
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#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:171
char * StringEndS()
Definition: reporter.cc:151
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:949
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
polyrec * poly
Definition: hilb.h:10
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:590
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:918
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:1091
SSet * SRes
Definition: syz.h:33
short list_length
Definition: syz.h:62
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 1502 of file mod_main.cc.

1503 {
1504  NoReturn(res);
1505 
1506  const ring r = currRing;
1507 
1508  int p = 0; // which IS-block? p^th!
1509 
1510  if ((h!=NULL) && (h->Typ()==INT_CMD))
1511  {
1512  p = (int)((long)(h->Data())); h=h->next;
1513  assume(p >= 0);
1514  }
1515 
1516  const int pos = rGetISPos(p, r);
1517 
1518  if( /*(*/ -1 == pos /*)*/ )
1519  {
1520  WerrorS("`GetInducedData([int])` called on incompatible ring (not created by 'MakeInducedSchreyerOrdering'!)");
1521  return TRUE;
1522  }
1523 
1524 
1525  const int iLimit = r->typ[pos].data.is.limit;
1526  const ideal F = r->typ[pos].data.is.F;
1527  ideal FF = id_Copy(F, r);
1528 
1529 
1530 
1532  l->Init(2);
1533 
1534  l->m[0].rtyp = INT_CMD;
1535  l->m[0].data = reinterpret_cast<void *>(iLimit);
1536 
1537 
1538  // l->m[1].rtyp = MODUL_CMD;
1539 
1540  if( idIsModule(FF, r) )
1541  {
1542  l->m[1].rtyp = MODUL_CMD;
1543 
1544  // Print("before: %d\n", FF->nrows);
1545  // FF->nrows = id_RankFreeModule(FF, r); // ???
1546  // Print("after: %d\n", FF->nrows);
1547  }
1548  else
1549  l->m[1].rtyp = IDEAL_CMD;
1550 
1551  l->m[1].data = reinterpret_cast<void *>(FF);
1552 
1553  res->rtyp = LIST_CMD; // list of int/module
1554  res->data = reinterpret_cast<void *>(l);
1555 
1556  return FALSE;
1557 
1558 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
sleftv * m
Definition: lists.h:45
Definition: tok.h:85
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)
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
BOOLEAN idIsModule(ideal m, const ring r)
int Typ()
Definition: subexpr.cc:949
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:1091
Definition: tok.h:96
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:4873
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 171 of file mod_main.cc.

172 {
173  if( h!= NULL && h->Typ() == INT_CMD )
174  {
175  int n = (int)(long)(h->Data());
176 
177  if( n < 0 )
178  Warn("Negative (%d) optional integer argument", n);
179 
180  return (n);
181  }
182 
183  return (_n);
184 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
Definition: tok.h:85
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
int Typ()
Definition: subexpr.cc:949
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1091
#define Warn
Definition: emacs.cc:80
static BOOLEAN idPrepare ( leftv  res,
leftv  h 
)
static

Get raw syzygies (idPrepare)

Definition at line 1799 of file mod_main.cc.

1800 {
1801  // extern int rGetISPos(const int p, const ring r);
1802 
1803  const ring r = currRing;
1804 
1805  const bool isSyz = rIsSyzIndexRing(r);
1806  const int posIS = rGetISPos(0, r);
1807 
1808 
1809  if ( !( (h!=NULL) && (h->Typ()==MODUL_CMD) && (h->Data() != NULL) ) )
1810  {
1811  WerrorS("`idPrepare(<module>)` expected");
1812  return TRUE;
1813  }
1814 
1815  const ideal I = reinterpret_cast<ideal>(h->Data());
1816 
1817  assume( I != NULL );
1818  idTest(I);
1819 
1820  int iComp = -1;
1821 
1822  h=h->next;
1823  if ( (h!=NULL) && (h->Typ()==INT_CMD) )
1824  {
1825  iComp = (int)((long)(h->Data()));
1826  } else
1827  {
1828  if( (!isSyz) && (-1 == posIS) )
1829  {
1830  WerrorS("`idPrepare(<...>)` called on incompatible ring (not created by 'MakeSyzCompOrdering' or 'MakeInducedSchreyerOrdering'!)");
1831  return TRUE;
1832  }
1833 
1834  if( isSyz )
1835  iComp = rGetCurrSyzLimit(r);
1836  else
1837  iComp = id_RankFreeModule(r->typ[posIS].data.is.F, r); // ;
1838  }
1839 
1840  assume(iComp >= 0);
1841 
1842 
1843  intvec* w = reinterpret_cast<intvec *>(atGet(h, "isHomog", INTVEC_CMD));
1844  tHomog hom = testHomog;
1845 
1846  // int add_row_shift = 0;
1847  //
1848  if (w!=NULL)
1849  {
1850  w = ivCopy(w);
1851  // add_row_shift = ww->min_in();
1852  //
1853  // (*ww) -= add_row_shift;
1854  //
1855  // if (idTestHomModule(I, currRing->qideal, ww))
1856  // {
1857  hom = isHomog;
1858  // w = ww;
1859  // }
1860  // else
1861  // {
1862  // //WarnS("wrong weights");
1863  // delete ww;
1864  // w = NULL;
1865  // hom=testHomog;
1866  // }
1867  }
1868 
1869 
1870  // computes syzygies of h1,
1871  // works always in a ring with ringorder_s
1872  // NOTE: rSetSyzComp(syzcomp) should better be called beforehand
1873  // ideal idPrepare (ideal h1, tHomog hom, int syzcomp, intvec **w);
1874 
1875  ideal J = // idPrepare( I, hom, iComp, &w);
1876  kStd(I, currRing->qideal, hom, &w, NULL, iComp);
1877 
1878  idTest(J);
1879 
1880  if (w!=NULL)
1881  atSet(res, omStrDup("isHomog"), w, INTVEC_CMD);
1882  // if (w!=NULL) delete w;
1883 
1884  res->rtyp = MODUL_CMD;
1885  res->data = reinterpret_cast<void *>(J);
1886  return FALSE;
1887 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
Definition: tok.h:85
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw)
Definition: kstd1.cc:2067
#define FALSE
Definition: auxiliary.h:140
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:705
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:708
const ideal
Definition: gb_hack.h:42
intvec * ivCopy(const intvec *o)
Definition: intvec.h:132
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
int Typ()
Definition: subexpr.cc:949
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:16
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
tHomog
Definition: structs.h:37
#define assume(x)
Definition: mod2.h:405
Definition: tok.h:88
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:1091
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:4873
#define idTest(id)
Definition: ideals.h:63
#define omStrDup(s)
Definition: omAllocDecl.h:263
static BOOLEAN ISUpdateComponents ( leftv  res,
leftv  h 
)
static

Definition at line 1724 of file mod_main.cc.

1725 {
1726  NoReturn(res);
1727 
1728  PrintS("ISUpdateComponents:.... \n");
1729 
1730  if ((h!=NULL) && (h->Typ()==MODUL_CMD))
1731  {
1732  ideal F = (ideal)h->Data(); ; // No copy!
1733  h=h->next;
1734 
1735  if ((h!=NULL) && (h->Typ()==INTVEC_CMD))
1736  {
1737  const intvec* const V = (const intvec* const) h->Data();
1738  h=h->next;
1739 
1740  if ((h!=NULL) && (h->Typ()==INT_CMD))
1741  {
1742  const int MIN = (int)((long)(h->Data()));
1743 
1744  pISUpdateComponents(F, V, MIN, currRing);
1745  return FALSE;
1746  }
1747  }
1748  }
1749 
1750  WerrorS("`ISUpdateComponents(<module>, intvec, int)` expected");
1751  return TRUE;
1752 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
Definition: tok.h:85
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
#define MIN(a, b)
Definition: omDebug.c:102
void WerrorS(const char *s)
Definition: feFopen.cc:23
int Typ()
Definition: subexpr.cc:949
void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r)
Definition: ring.cc:4249
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:16
void PrintS(const char *s)
Definition: reporter.cc:294
Definition: tok.h:88
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1091
static number jjLONG2N ( long  d)
inlinestatic

Definition at line 222 of file mod_main.cc.

223 {
224  return n_Init(d, coeffs_BIGINT);
225 }
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:537
coeffs coeffs_BIGINT
Definition: ipid.cc:53
static BOOLEAN leadcomp ( leftv  res,
leftv  h 
)
static

Get leading component.

Definition at line 1361 of file mod_main.cc.

1362 {
1363  NoReturn(res);
1364 
1365  if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD))
1366  {
1367  const ring r = currRing;
1368 
1369  const poly p = (poly)(h->Data());
1370 
1371  if (p != NULL )
1372  {
1373  assume( p != NULL );
1374  p_LmTest(p, r);
1375 
1376  const unsigned long iComp = p_GetComp(p, r);
1377 
1378  // assume( iComp > 0 ); // p is a vector
1379 
1380  res->data = reinterpret_cast<void *>(jjLONG2N(iComp));
1381  } else
1382  res->data = reinterpret_cast<void *>(jjLONG2N(0));
1383 
1384 
1385  res->rtyp = BIGINT_CMD;
1386  return FALSE;
1387  }
1388 
1389  WerrorS("`leadcomp(<poly/vector>)` expected");
1390  return TRUE;
1391 }
static number jjLONG2N(long d)
Definition: mod_main.cc:222
#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:23
int Typ()
Definition: subexpr.cc:949
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
polyrec * poly
Definition: hilb.h:10
#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:1091
static BOOLEAN leadrawexp ( leftv  res,
leftv  h 
)
static

Get raw leading exponent vector.

Definition at line 1397 of file mod_main.cc.

1398 {
1399  NoReturn(res);
1400 
1401  if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD) && (h->Data() != NULL))
1402  {
1403  const ring r = currRing;
1404  const poly p = (poly)(h->Data());
1405 
1406  assume( p != NULL );
1407  p_LmTest(p, r);
1408 
1409  const int iExpSize = r->ExpL_Size;
1410 
1411 // intvec *iv = new intvec(iExpSize);
1412 
1414  l->Init(iExpSize);
1415 
1416  for(int i = iExpSize-1; i >= 0; i--)
1417  {
1418  l->m[i].rtyp = BIGINT_CMD;
1419  l->m[i].data = reinterpret_cast<void *>(jjLONG2N(p->exp[i])); // longs...
1420  }
1421 
1422  res->rtyp = LIST_CMD; // list of bigints
1423  res->data = reinterpret_cast<void *>(l);
1424  return FALSE;
1425  }
1426 
1427  WerrorS("`leadrawexp(<poly/vector>)` expected");
1428  return TRUE;
1429 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
sleftv * m
Definition: lists.h:45
static number jjLONG2N(long d)
Definition: mod_main.cc:222
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:23
int Typ()
Definition: subexpr.cc:949
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
polyrec * poly
Definition: hilb.h:10
#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:1091
Definition: tok.h:96
omBin slists_bin
Definition: lists.cc:23
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 1448 of file mod_main.cc.

1449 {
1450 
1451  NoReturn(res);
1452 
1453  int sign = 1;
1454  if ((h!=NULL) && (h->Typ()==INT_CMD))
1455  {
1456  const int s = (int)((long)(h->Data()));
1457 
1458  if( s != -1 && s != 1 )
1459  {
1460  WerrorS("`MakeInducedSchreyerOrdering(<int>)` called with wrong integer argument (must be +-1)!");
1461  return TRUE;
1462  }
1463 
1464  sign = s;
1465  }
1466 
1467  assume( sign == 1 || sign == -1 );
1468  res->data = reinterpret_cast<void *>(rAssure_InducedSchreyerOrdering(currRing, TRUE, sign));
1469  res->rtyp = RING_CMD; // return new ring!
1470  // QRING_CMD?
1471  return FALSE;
1472 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:85
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
int Typ()
Definition: subexpr.cc:949
ring rAssure_InducedSchreyerOrdering(const ring r, BOOLEAN complete, int sign)
Definition: ring.cc:4742
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:1091
int sign(const CanonicalForm &a)
static BOOLEAN MakeSyzCompOrdering ( leftv  res,
leftv   
)
static

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

Definition at line 1433 of file mod_main.cc.

1434 {
1435 
1436  NoReturn(res);
1437 
1438  // res->data = rCurrRingAssure_SyzComp(); // changes current ring! :(
1439  res->data = reinterpret_cast<void *>(rAssure_SyzComp(currRing, TRUE));
1440  res->rtyp = RING_CMD; // return new ring!
1441  // QRING_CMD?
1442 
1443  return FALSE;
1444 }
#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:4357
int rtyp
Definition: subexpr.h:92
static BOOLEAN noop ( leftv  __res,
leftv   
)
static

Definition at line 186 of file mod_main.cc.

187 {
188  NoReturn(__res);
189  return FALSE;
190 }
#define FALSE
Definition: auxiliary.h:140
void pISUpdateComponents ( ideal  F,
const intvec *const  V,
const int  MIN,
const ring  r 
)

Definition at line 4249 of file ring.cc.

4250 {
4251  assume( V != NULL );
4252  assume( MIN >= 0 );
4253 
4254  if( F == NULL )
4255  return;
4256 
4257  for( int j = (F->ncols*F->nrows) - 1; j >= 0; j-- )
4258  {
4259 #ifdef PDEBUG
4260  Print("F[%d]:", j);
4261  p_DebugPrint(F->m[j], r, r, 0);
4262 #endif
4263 
4264  for( poly p = F->m[j]; p != NULL; pIter(p) )
4265  {
4266  int c = p_GetComp(p, r);
4267 
4268  if( c > MIN )
4269  {
4270 #ifdef PDEBUG
4271  Print("gen[%d] -> gen(%d)\n", c, MIN + (*V)[ c - MIN - 1 ]);
4272 #endif
4273 
4274  p_SetComp( p, MIN + (*V)[ c - MIN - 1 ], r );
4275  }
4276  }
4277 #ifdef PDEBUG
4278  Print("new F[%d]:", j);
4279  p_Test(F->m[j], r);
4280  p_DebugPrint(F->m[j], r, r, 0);
4281 #endif
4282  }
4283 
4284 }
void p_DebugPrint(poly p, const ring r)
Definition: ring.cc:4176
#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:236
#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
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
ring rAssure_InducedSchreyerOrdering ( const ring  r,
BOOLEAN  complete,
int  sign 
)

Definition at line 4742 of file ring.cc.

4743 { // TODO: ???? Add leading Syz-comp ordering here...????
4744 
4745 #if MYTEST
4746  Print("rAssure_InducedSchreyerOrdering(r, complete = %d, sgn = %d): r: \n", complete, sgn);
4747  rWrite(r);
4748 #ifdef RDEBUG
4749  rDebugPrint(r);
4750 #endif
4751  PrintLn();
4752 #endif
4753  assume((sgn == 1) || (sgn == -1));
4754 
4755  ring res=rCopy0(r, FALSE, FALSE); // No qideal & ordering copy.
4756 
4757  int n = rBlocks(r); // Including trailing zero!
4758 
4759  // Create 2 more blocks for prefix/suffix:
4760  res->order=(int *)omAlloc0((n+2)*sizeof(int)); // 0 .. n+1
4761  res->block0=(int *)omAlloc0((n+2)*sizeof(int));
4762  res->block1=(int *)omAlloc0((n+2)*sizeof(int));
4763  int ** wvhdl =(int **)omAlloc0((n+2)*sizeof(int**));
4764 
4765  // Encapsulate all existing blocks between induced Schreyer ordering markers: prefix and suffix!
4766  // Note that prefix and suffix have the same ringorder marker and only differ in block[] parameters!
4767 
4768  // new 1st block
4769  int j = 0;
4770  res->order[j] = ringorder_IS; // Prefix
4771  res->block0[j] = res->block1[j] = 0;
4772  // wvhdl[j] = NULL;
4773  j++;
4774 
4775  for(int i = 0; (i <= n) && (r->order[i] != 0); i++, j++) // i = [0 .. n-1] <- non-zero old blocks
4776  {
4777  res->order [j] = r->order [i];
4778  res->block0[j] = r->block0[i];
4779  res->block1[j] = r->block1[i];
4780 
4781  if (r->wvhdl[i] != NULL)
4782  {
4783  wvhdl[j] = (int*) omMemDup(r->wvhdl[i]);
4784  } // else wvhdl[j] = NULL;
4785  }
4786 
4787  // new last block
4788  res->order [j] = ringorder_IS; // Suffix
4789  res->block0[j] = res->block1[j] = sgn; // Sign of v[o]: 1 for C, -1 for c
4790  // wvhdl[j] = NULL;
4791  j++;
4792 
4793  // res->order [j] = 0; // The End!
4794  res->wvhdl = wvhdl;
4795 
4796  // j == the last zero block now!
4797  assume(j == (n+1));
4798  assume(res->order[0]==ringorder_IS);
4799  assume(res->order[j-1]==ringorder_IS);
4800  assume(res->order[j]==0);
4801 
4802 
4803  if (complete)
4804  {
4805  rComplete(res, 1);
4806 
4807 #ifdef HAVE_PLURAL
4808  if (rIsPluralRing(r))
4809  {
4810  if ( nc_rComplete(r, res, false) ) // no qideal!
4811  {
4812 #ifndef SING_NDEBUG
4813  WarnS("error in nc_rComplete"); // cleanup?// rDelete(res);// return r; // just go on..
4814 #endif
4815  }
4816  }
4817  assume(rIsPluralRing(r) == rIsPluralRing(res));
4818 #endif
4819 
4820 
4821 #ifdef HAVE_PLURAL
4822  ring old_ring = r;
4823 #endif
4824 
4825  if (r->qideal!=NULL)
4826  {
4827  res->qideal= idrCopyR_NoSort(r->qideal, r, res);
4828 
4829  assume(id_RankFreeModule(res->qideal, res) == 0);
4830 
4831 #ifdef HAVE_PLURAL
4832  if( rIsPluralRing(res) )
4833  if( nc_SetupQuotient(res, r, true) )
4834  {
4835 // WarnS("error in nc_SetupQuotient"); // cleanup? rDelete(res); return r; // just go on...?
4836  }
4837 
4838 #endif
4839  assume(id_RankFreeModule(res->qideal, res) == 0);
4840  }
4841 
4842 #ifdef HAVE_PLURAL
4843  assume((res->qideal==NULL) == (old_ring->qideal==NULL));
4844  assume(rIsPluralRing(res) == rIsPluralRing(old_ring));
4845  assume(rIsSCA(res) == rIsSCA(old_ring));
4846  assume(ncRingType(res) == ncRingType(old_ring));
4847 #endif
4848  }
4849 
4850  return res;
4851 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
#define omMemDup(s)
Definition: omAllocDecl.h:264
void PrintLn()
Definition: reporter.cc:322
#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:5499
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3475
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define WarnS
Definition: emacs.cc:81
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
void rDebugPrint(ring r)
Definition: ring.cc:3971
poly res
Definition: myNF.cc:322
static int rBlocks(ring r)
Definition: ring.h:507
const ring r
Definition: syzextra.cc:208
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
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:3371
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:405
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1281
int i
Definition: cfEzgcd.cc:123
Induced (Schreyer) ordering.
Definition: ring.h:686
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:205
#define omAlloc0(size)
Definition: omAllocDecl.h:211
static BOOLEAN reduce_syz ( leftv  res,
leftv  h 
)
static

NF using length.

Definition at line 1756 of file mod_main.cc.

1757 {
1758  // const ring r = currRing;
1759 
1760  if ( !( (h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD) ) )
1761  {
1762  WerrorS("`reduce_syz(<poly/vector>!, <ideal/module>, <int>, [int])` expected");
1763  return TRUE;
1764  }
1765 
1766  res->rtyp = h->Typ();
1767  const poly v = reinterpret_cast<poly>(h->Data());
1768  h=h->next;
1769 
1770  if ( !( (h!=NULL) && (h->Typ()==MODUL_CMD || h->Typ()==IDEAL_CMD ) ) )
1771  {
1772  WerrorS("`reduce_syz(<poly/vector>, <ideal/module>!, <int>, [int])` expected");
1773  return TRUE;
1774  }
1775 
1776  assumeStdFlag(h);
1777  const ideal M = reinterpret_cast<ideal>(h->Data()); h=h->next;
1778 
1779 
1780  if ( !( (h!=NULL) && (h->Typ()== INT_CMD) ) )
1781  {
1782  WerrorS("`reduce_syz(<poly/vector>, <ideal/module>, <int>!, [int])` expected");
1783  return TRUE;
1784  }
1785 
1786  const int iSyzComp = (int)((long)(h->Data())); h=h->next;
1787 
1788  int iLazyReduce = 0;
1789 
1790  if ( ( (h!=NULL) && (h->Typ()== INT_CMD) ) )
1791  iLazyReduce = (int)((long)(h->Data()));
1792 
1793  res->data = (void *)kNFLength(M, currRing->qideal, v, iSyzComp, iLazyReduce); // NOTE: currRing :(
1794  return FALSE;
1795 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
Definition: tok.h:85
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
int Typ()
Definition: subexpr.cc:949
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
polyrec * poly
Definition: hilb.h:10
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1428
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:1091
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 4873 of file ring.cc.

4874 {
4875  // Put the reference set F into the ring -ordering -recor
4876 #if MYTEST
4877  Print("rIsIS(p: %d)\nF:", p);
4878  PrintLn();
4879 #endif
4880 
4881  if (r->typ==NULL)
4882  {
4883 // dReportError("'rIsIS:' Error: wrong ring! (typ == NULL)");
4884  return -1;
4885  }
4886 
4887  int j = p; // Which IS record to use...
4888  for( int pos = 0; pos < r->OrdSize; pos++ )
4889  if( r->typ[pos].ord_typ == ro_is)
4890  if( j-- == 0 )
4891  return pos;
4892 
4893  return -1;
4894 }
void PrintLn()
Definition: reporter.cc:322
#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 1674 of file mod_main.cc.

1675 {
1676  NoReturn(res);
1677 
1678  const ring r = currRing;
1679 
1680  if( !( (h!=NULL) && ( (h->Typ()==IDEAL_CMD) || (h->Typ()==MODUL_CMD))) )
1681  {
1682  WerrorS("`SetInducedReferrence(<ideal/module>, [int[, int]])` expected");
1683  return TRUE;
1684  }
1685 
1686  const ideal F = (ideal)h->Data(); ; // No copy!
1687  h=h->next;
1688 
1689  int rank = 0;
1690 
1691  if ((h!=NULL) && (h->Typ()==INT_CMD))
1692  {
1693  rank = (int)((long)(h->Data())); h=h->next;
1694  assume(rank >= 0);
1695  } else
1696  rank = id_RankFreeModule(F, r); // Starting syz-comp (1st: i+1)
1697 
1698  int p = 0; // which IS-block? p^th!
1699 
1700  if ((h!=NULL) && (h->Typ()==INT_CMD))
1701  {
1702  p = (int)((long)(h->Data())); h=h->next;
1703  assume(p >= 0);
1704  }
1705 
1706  const int posIS = rGetISPos(p, r);
1707 
1708  if( /*(*/ -1 == posIS /*)*/ )
1709  {
1710  WerrorS("`SetInducedReferrence(<ideal/module>, [int[, int]])` called on incompatible ring (not created by 'MakeInducedSchreyerOrdering'!)");
1711  return TRUE;
1712  }
1713 
1714 
1715 
1716  // F & componentWeights belong to that ordering block of currRing now:
1717  rSetISReference(r, F, rank, p); // F will be copied!
1718  return FALSE;
1719 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
Definition: tok.h:85
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
int Typ()
Definition: subexpr.cc:949
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)
#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:4905
void * Data()
Definition: subexpr.cc:1091
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:4873
static BOOLEAN SetSyzComp ( leftv  res,
leftv  h 
)
static

Returns old SyzCompLimit, can set new limit.

Definition at line 1476 of file mod_main.cc.

1477 {
1478  NoReturn(res);
1479 
1480  const ring r = currRing;
1481 
1482  if( !rIsSyzIndexRing(r) )
1483  {
1484  WerrorS("`SetSyzComp(<int>)` called on incompatible ring (not created by 'MakeSyzCompOrdering'!)");
1485  return TRUE;
1486  }
1487 
1488  res->rtyp = INT_CMD;
1489  res->data = reinterpret_cast<void *>(rGetCurrSyzLimit(r)); // return old syz limit
1490 
1491  if ((h!=NULL) && (h->Typ()==INT_CMD))
1492  {
1493  const int iSyzComp = (int)reinterpret_cast<long>(h->Data());
1494  assume( iSyzComp > 0 );
1495  rSetSyzComp(iSyzComp, currRing);
1496  }
1497 
1498  return FALSE;
1499 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
Definition: tok.h:85
#define FALSE
Definition: auxiliary.h:140
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:705
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:708
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
int Typ()
Definition: subexpr.cc:949
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:4959
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1091
END_NAMESPACE int SI_MOD_INIT() syzextra ( SModulFunctions psModulFunctions)

Definition at line 1975 of file mod_main.cc.

1976 {
1977 
1978 #define ADD(C,D,E) \
1979  psModulFunctions->iiAddCproc((currPack->libname? currPack->libname: ""), (char*)C, D, E);
1980 
1981 
1982 // #define ADD(A,B,C,D,E) ADD0(iiAddCproc, "", C, D, E)
1983 
1984 //#define ADD0(A,B,C,D,E) A(B, (char*)C, D, E)
1985 // #define ADD(A,B,C,D,E) ADD0(A->iiAddCproc, B, C, D, E)
1986  ADD("ClearContent", FALSE, _ClearContent);
1987  ADD("ClearDenominators", FALSE, _ClearDenominators);
1988 
1989  ADD("m2_end", FALSE, _m2_end);
1990 
1991  ADD("DetailedPrint", FALSE, DetailedPrint);
1992  ADD("leadmonomial", FALSE, _leadmonom);
1993  ADD("leadcomp", FALSE, leadcomp);
1994  ADD("leadrawexp", FALSE, leadrawexp);
1995 
1996  ADD("ISUpdateComponents", FALSE, ISUpdateComponents);
1997  ADD("SetInducedReferrence", FALSE, SetInducedReferrence);
1998  ADD("GetInducedData", FALSE, GetInducedData);
1999  ADD("SetSyzComp", FALSE, SetSyzComp);
2000  ADD("MakeInducedSchreyerOrdering", FALSE, MakeInducedSchreyerOrdering);
2001  ADD("MakeSyzCompOrdering", FALSE, MakeSyzCompOrdering);
2002 
2003  ADD("ProfilerStart", FALSE, _ProfilerStart);
2004  ADD("ProfilerStop", FALSE, _ProfilerStop );
2005 
2006  ADD("noop", FALSE, noop);
2007  ADD("idPrepare", FALSE, idPrepare);
2008  ADD("reduce_syz", FALSE, reduce_syz);
2009 
2010  ADD("p_Content", FALSE, _p_Content);
2011 
2012  ADD("Tail", FALSE, Tail);
2013 
2014  ADD("ComputeLeadingSyzygyTerms", FALSE, _ComputeLeadingSyzygyTerms);
2015  ADD("Compute2LeadingSyzygyTerms", FALSE, _Compute2LeadingSyzygyTerms);
2016 
2017  ADD("Sort_c_ds", FALSE, _Sort_c_ds);
2018  ADD("FindReducer", FALSE, _FindReducer);
2019 
2020 
2021  ADD("ReduceTerm", FALSE, _ReduceTerm);
2022  ADD("TraverseTail", FALSE, _TraverseTail);
2023 
2024 
2025  ADD("SchreyerSyzygyNF", FALSE, _SchreyerSyzygyNF);
2026  ADD("ComputeSyzygy", FALSE, _ComputeSyzygy);
2027 
2028  ADD("ComputeResolution", FALSE, _ComputeResolution);
2029 // ADD("GetAMData", FALSE, GetAMData);
2030 
2031  ADD("NumberStatsInit", FALSE, _NumberStatsInit);
2032  ADD("NumberStatsPrint", FALSE, _NumberStatsPrint);
2033 
2034  // ADD("", FALSE, );
2035 
2036 #undef ADD
2037  return MAX_TOK;
2038 }
static BOOLEAN idPrepare(leftv res, leftv h)
Get raw syzygies (idPrepare)
Definition: mod_main.cc:1799
static BOOLEAN noop(leftv __res, leftv)
Definition: mod_main.cc:186
#define FALSE
Definition: auxiliary.h:140
Definition: tok.h:167
static BOOLEAN _ClearContent(leftv res, leftv h)
wrapper around n_ClearContent
Definition: mod_main.cc:77
static BOOLEAN Tail(leftv res, leftv h)
wrapper around p_Tail and id_Tail
Definition: mod_main.cc:465
static BOOLEAN SetSyzComp(leftv res, leftv h)
Returns old SyzCompLimit, can set new limit.
Definition: mod_main.cc:1476
static BOOLEAN MakeSyzCompOrdering(leftv res, leftv)
Endowe the current ring with additional (leading) Syz-component ordering.
Definition: mod_main.cc:1433
static BOOLEAN DetailedPrint(leftv __res, leftv h)
Definition: mod_main.cc:249
static BOOLEAN leadrawexp(leftv res, leftv h)
Get raw leading exponent vector.
Definition: mod_main.cc:1397
static BOOLEAN _ComputeResolution(leftv res, leftv h)
Definition: mod_main.cc:1123
static BOOLEAN GetInducedData(leftv res, leftv h)
?
Definition: mod_main.cc:1502
static BOOLEAN _ProfilerStop(leftv __res, leftv)
Definition: mod_main.cc:210
static BOOLEAN leadcomp(leftv res, leftv h)
Get leading component.
Definition: mod_main.cc:1361
#define ADD(C, D, E)
static BOOLEAN _SchreyerSyzygyNF(leftv res, leftv h)
Definition: mod_main.cc:764
static BOOLEAN _p_Content(leftv res, leftv h)
Get raw syzygies (idPrepare)
Definition: mod_main.cc:1890
static BOOLEAN _TraverseTail(leftv res, leftv h)
Definition: mod_main.cc:1018
static BOOLEAN SetInducedReferrence(leftv res, leftv h)
Returns old SyzCompLimit, can set new limit.
Definition: mod_main.cc:1674
static BOOLEAN MakeInducedSchreyerOrdering(leftv res, leftv h)
Same for Induced Schreyer ordering (ordering on components is defined by sign!)
Definition: mod_main.cc:1448
static BOOLEAN _ProfilerStart(leftv __res, leftv h)
Definition: mod_main.cc:192
static BOOLEAN _NumberStatsInit(leftv res, leftv h)
Definition: mod_main.cc:1933
static BOOLEAN _ComputeLeadingSyzygyTerms(leftv res, leftv h)
Definition: mod_main.cc:505
static BOOLEAN _FindReducer(leftv res, leftv h)
proc SSFindReducer(def product, def syzterm, def L, def T, list #)
Definition: mod_main.cc:667
static BOOLEAN reduce_syz(leftv res, leftv h)
NF using length.
Definition: mod_main.cc:1756
static BOOLEAN _Compute2LeadingSyzygyTerms(leftv res, leftv h)
Definition: mod_main.cc:617
static BOOLEAN _NumberStatsPrint(leftv res, leftv h)
Definition: mod_main.cc:1954
static BOOLEAN _ClearDenominators(leftv res, leftv h)
wrapper around n_ClearDenominators
Definition: mod_main.cc:123
static BOOLEAN _ReduceTerm(leftv res, leftv h)
proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #)
Definition: mod_main.cc:873
static BOOLEAN _ComputeSyzygy(leftv res, leftv h)
module (LL, TT) = SSComputeSyzygy(L, T); Compute Syz(L ++ T) = N = LL ++ TT
Definition: mod_main.cc:1271
static BOOLEAN _Sort_c_ds(leftv res, leftv h)
sorting wrt & reversing... change the input inplace!!!
Definition: mod_main.cc:555
static BOOLEAN _m2_end(leftv res, leftv h)
Definition: mod_main.cc:1914
static BOOLEAN _leadmonom(leftv res, leftv h)
Get leading term without a module component.
Definition: mod_main.cc:1341
static BOOLEAN ISUpdateComponents(leftv res, leftv h)
Definition: mod_main.cc:1724
static BOOLEAN Tail ( leftv  res,
leftv  h 
)
static

wrapper around p_Tail and id_Tail

Definition at line 465 of file mod_main.cc.

466 {
467  NoReturn(res);
468 
469  if( h == NULL )
470  {
471  WarnS("Tail needs a poly/vector/ideal/module argument...");
472  return TRUE;
473  }
474 
475  assume( h != NULL );
476 
477  const ring r = currRing;
478 
479  if( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD)
480  {
481  res->data = p_Tail( (const poly)h->Data(), r );
482  res->rtyp = h->Typ();
483 
484  h = h->Next(); assume (h == NULL);
485 
486  return FALSE;
487  }
488 
489  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
490  {
491  res->data = id_Tail( (const ideal)h->Data(), r );
492  res->rtyp = h->Typ();
493 
494  h = h->Next(); assume (h == NULL);
495 
496  return FALSE;
497  }
498 
499  WarnS("Tail needs a single poly/vector/ideal/module argument...");
500  return TRUE;
501 }
#define FALSE
Definition: auxiliary.h:140
const ideal
Definition: gb_hack.h:42
#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:949
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
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
void * Data()
Definition: subexpr.cc:1091
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
USING_NAMESPACE ( SINGULARXXNAME::DEBUG  )

Definition at line 62 of file mod_main.cc.

71 {
72  res->rtyp = NONE;
73  res->data = NULL;
74 }
poly res
Definition: myNF.cc:322
#define NULL
Definition: omList.c:10
#define NONE
Definition: tok.h:170
static void view ( const intvec v)
inlinestatic

Definition at line 227 of file mod_main.cc.

228 {
229 #ifndef SING_NDEBUG
230  v->view();
231 #else
232  // This code duplication is only due to Hannes's #ifndef SING_NDEBUG!
233  Print ("intvec: {rows: %d, cols: %d, length: %d, Values: \n", v->rows(), v->cols(), v->length());
234 
235  for (int i = 0; i < v->rows(); i++)
236  {
237  Print ("Row[%3d]:", i);
238  for (int j = 0; j < v->cols(); j++)
239  Print (" %5d", (*v)[j + i * (v->cols())] );
240  PrintLn ();
241  }
242  PrintS ("}\n");
243 #endif
244 
245 }
void PrintLn()
Definition: reporter.cc:322
#define Print
Definition: emacs.cc:83
int length() const
Definition: intvec.h:85
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:86
int rows() const
Definition: intvec.h:87
void view() const
Definition: intvec.cc:139