Data Structures | Macros | Typedefs | Functions
ipconv.cc File Reference
#include <kernel/mod2.h>
#include <Singular/tok.h>
#include <Singular/ipid.h>
#include <misc/intvec.h>
#include <misc/options.h>
#include <omalloc/omalloc.h>
#include <kernel/polys.h>
#include <kernel/ideals.h>
#include <Singular/subexpr.h>
#include <coeffs/numbers.h>
#include <coeffs/coeffs.h>
#include <coeffs/bigintmat.h>
#include <polys/matpol.h>
#include <Singular/links/silink.h>
#include <kernel/GBEngine/syz.h>
#include <Singular/attrib.h>
#include <polys/monomials/ring.h>
#include <Singular/ipshell.h>
#include <Singular/number2.h>
#include <Singular/ipconv.h>
#include <Singular/table.h>

Go to the source code of this file.

Data Structures

struct  sConvertTypes
 

Macros

#define IPCONV
 
#define D(A)   A
 
#define NULL_VAL   NULL
 

Typedefs

typedef void *(* iiConvertProc) (void *data)
 
typedef void(* iiConvertProcL) (leftv out, leftv in)
 

Functions

static void * iiI2P (void *data)
 
static void * iiBI2P (void *data)
 
static void * iiI2V (void *data)
 
static void * iiBI2V (void *data)
 
static void * iiI2Id (void *data)
 
static void * iiBI2Id (void *data)
 
static void * iiP2V (void *data)
 
static void * iiP2Id (void *data)
 
static void * iiV2Ma (void *data)
 
static void * iiN2P (void *data)
 
static void * iiDummy (void *data)
 
static void * iiMo2Ma (void *data)
 
static void * iiMa2Mo (void *data)
 
static void * iiI2Iv (void *data)
 
static void * iiI2N (void *data)
 
static void * iiI2BI (void *data)
 
static void * iiBI2N (void *data)
 
static void * iiIm2Ma (void *data)
 
static void * iiIm2Bim (void *data)
 
static void * iiN2Ma (void *data)
 
static void * iiS2Link (void *data)
 
static void iiR2L_l (leftv out, leftv in)
 
static void iiL2R (leftv out, leftv in)
 
BOOLEAN iiConvert (int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
 
int iiTestConvert (int inputType, int outputType, const struct sConvertTypes *dConvertTypes)
 

Data Structure Documentation

◆ sConvertTypes

struct sConvertTypes

Definition at line 110 of file gentable.cc.

Data Fields
int i_typ
int o_typ
iiConvertProc p
int p
iiConvertProcL pl
int pl

Macro Definition Documentation

◆ D

#define D (   A)    A

Definition at line 394 of file ipconv.cc.

◆ IPCONV

#define IPCONV

Definition at line 393 of file ipconv.cc.

◆ NULL_VAL

#define NULL_VAL   NULL

Definition at line 395 of file ipconv.cc.

Typedef Documentation

◆ iiConvertProc

typedef void*(* iiConvertProc) (void *data)

Definition at line 33 of file ipconv.cc.

◆ iiConvertProcL

typedef void(* iiConvertProcL) (leftv out, leftv in)

Definition at line 34 of file ipconv.cc.

Function Documentation

◆ iiBI2Id()

static void* iiBI2Id ( void *  data)
static

Definition at line 94 of file ipconv.cc.

95 {
96  ideal I=idInit(1,1);
98  if (nMap==NULL)
99  {
100  Werror("no conversion from bigint to %s", nCoeffName(currRing->cf));
101  return NULL;
102  }
103  number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
104  n_Delete((number *)&data,coeffs_BIGINT);
105  poly p=pNSet(n);
106  I->m[0]=p;
107  return (void *)I;
108 }
#define pNSet(n)
Definition: polys.h:295
return P p
Definition: myNF.cc:203
coeffs coeffs_BIGINT
Definition: ipid.cc:54
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:980
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ iiBI2N()

static void* iiBI2N ( void *  data)
static

Definition at line 207 of file ipconv.cc.

208 {
209  if (currRing==NULL) return NULL;
211  if (nMap==NULL)
212  {
213  Werror("no conversion from bigint to %s", nCoeffName(currRing->cf));
214  return NULL;
215  }
216  number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
217  n_Delete((number *)&data, coeffs_BIGINT);
218  return (void*)n;
219 }
coeffs coeffs_BIGINT
Definition: ipid.cc:54
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:980
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ iiBI2P()

static void* iiBI2P ( void *  data)
static

Definition at line 51 of file ipconv.cc.

52 {
54  if (nMap==NULL)
55  {
56  Werror("no conversion from bigint to %s", nCoeffName(currRing->cf));
57  return NULL;
58  }
59  number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
60  n_Delete((number *)&data, coeffs_BIGINT);
61  poly p=p_NSet(n, currRing);
62  return (void *)p;
63 }
return P p
Definition: myNF.cc:203
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1442
coeffs coeffs_BIGINT
Definition: ipid.cc:54
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:980
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ iiBI2V()

static void* iiBI2V ( void *  data)
static

Definition at line 72 of file ipconv.cc.

73 {
75  if (nMap==NULL)
76  {
77  Werror("no conversion from bigint to %s", nCoeffName(currRing->cf));
78  return NULL;
79  }
80  number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
81  n_Delete((number *)&data, coeffs_BIGINT);
82  poly p=p_NSet(n, currRing);
83  if (p!=NULL) pSetComp(p,1);
84  return (void *)p;
85 }
return P p
Definition: myNF.cc:203
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1442
coeffs coeffs_BIGINT
Definition: ipid.cc:54
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:980
#define pSetComp(p, v)
Definition: polys.h:38
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ iiConvert()

BOOLEAN iiConvert ( int  inputType,
int  outputType,
int  index,
leftv  input,
leftv  output,
const struct sConvertTypes dConvertTypes 
)

Definition at line 401 of file ipconv.cc.

402 {
403  memset(output,0,sizeof(sleftv));
404  if ((inputType==outputType)
405  || (outputType==DEF_CMD)
406  || ((outputType==IDHDL)&&(input->rtyp==IDHDL)))
407  {
408  memcpy(output,input,sizeof(*output));
409  memset(input,0,sizeof(*input));
410  return FALSE;
411  }
412  else if (outputType==ANY_TYPE)
413  {
414  output->rtyp=ANY_TYPE;
415  output->data=(char *)(long)input->Typ();
416  /* the name of the object:*/
417  if (input->e==NULL)
418  {
419  if (input->rtyp==IDHDL)
420  /* preserve name: copy it */
421  output->name=omStrDup(IDID((idhdl)(input->data)));
422  else if (input->name!=NULL)
423  {
424  if (input->rtyp==ALIAS_CMD)
425  output->name=omStrDup(input->name);
426  else
427  {
428  output->name=input->name;
429  input->name=NULL;
430  }
431  }
432  else if ((input->rtyp==POLY_CMD) && (input->name==NULL))
433  {
434  if (input->data!=NULL)
435  {
436  int nr=pIsPurePower((poly)input->data);
437  if (nr!=0)
438  {
439  if (pGetExp((poly)input->data,nr)==1)
440  {
441  output->name=omStrDup(currRing->names[nr-1]);
442  }
443  else
444  {
445  char *tmp=(char *)omAlloc(4);
446  sprintf(tmp,"%c%d",*(currRing->names[nr-1]),
447  (int)pGetExp((poly)input->data,nr));
448  output->name=tmp;
449  }
450  }
451  else if(pIsConstant((poly)input->data))
452  {
453  StringSetS("");
454  number n=(pGetCoeff((poly)input->data));
455  n_Write(n, currRing->cf);
456  (pGetCoeff((poly)input->data))=n;
457  output->name=StringEndS();
458  }
459  }
460  }
461  else if ((input->rtyp==NUMBER_CMD) && (input->name==NULL))
462  {
463  StringSetS("");
464  number n=(number)input->data;
465  n_Write(n, currRing->cf);
466  input->data=(void*)n;
467  output->name=StringEndS();
468  }
469  else
470  {
471  /* no need to preserve name: use it */
472  output->name=input->name;
473  memset(input,0,sizeof(*input));
474  }
475  }
476  output->next=input->next;
477  input->next=NULL;
478  return errorreported;
479  }
480  if (index!=0) /* iiTestConvert does not returned 'failure' */
481  {
482  index--;
483 
484  if((dConvertTypes[index].i_typ==inputType)
485  &&(dConvertTypes[index].o_typ==outputType))
486  {
487  if(traceit&TRACE_CONV)
488  {
489  Print("automatic conversion %s -> %s\n",
490  Tok2Cmdname(inputType),Tok2Cmdname(outputType));
491  }
492  if ((currRing==NULL) && (outputType>BEGIN_RING) && (outputType<END_RING))
493  return TRUE;
494  output->rtyp=outputType;
495  if (dConvertTypes[index].p!=NULL)
496  {
497  output->data=dConvertTypes[index].p(input->CopyD());
498  }
499  else
500  {
501  dConvertTypes[index].pl(output,input);
502  }
503  if ((output->data==NULL)
504  && ((outputType!=INT_CMD)
505  &&(outputType!=POLY_CMD)
506  &&(outputType!=VECTOR_CMD)
507  &&(outputType!=NUMBER_CMD)))
508  {
509  return TRUE;
510  }
511  if (errorreported) return TRUE;
512  output->next=input->next;
513  input->next=NULL;
514  //if (outputType==MATRIX_CMD) Print("convert %d -> matrix\n",inputType);
515  return FALSE;
516  }
517  }
518  return TRUE;
519 }
#define pIsPurePower(p)
Definition: polys.h:231
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define ANY_TYPE
Definition: tok.h:30
#define Print
Definition: emacs.cc:83
Definition: tok.h:95
Subexpr e
Definition: subexpr.h:106
#define IDID(a)
Definition: ipid.h:119
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRACE_CONV
Definition: reporter.h:47
#define TRUE
Definition: auxiliary.h:98
char * StringEndS()
Definition: reporter.cc:151
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
int traceit
Definition: febase.cc:47
int Typ()
Definition: subexpr.cc:995
#define omAlloc(size)
Definition: omAllocDecl.h:210
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
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:10
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
Definition: tok.h:58
const char * name
Definition: subexpr.h:88
void StringSetS(const char *st)
Definition: reporter.cc:128
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition: coeffs.h:595
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:221
short errorreported
Definition: feFopen.cc:23
leftv next
Definition: subexpr.h:87
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
Definition: tok.h:34
#define NULL
Definition: omList.c:10
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:132
int rtyp
Definition: subexpr.h:92
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:707
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ iiDummy()

static void* iiDummy ( void *  data)
static

Definition at line 142 of file ipconv.cc.

143 {
144  return data;
145 }

◆ iiI2BI()

static void* iiI2BI ( void *  data)
static

Definition at line 172 of file ipconv.cc.

173 {
174  number n=n_Init((int)(long)data, coeffs_BIGINT);
175  return (void *)n;
176 }
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:542
coeffs coeffs_BIGINT
Definition: ipid.cc:54

◆ iiI2Id()

static void* iiI2Id ( void *  data)
static

Definition at line 87 of file ipconv.cc.

88 {
89  ideal I=idInit(1,1);
90  I->m[0]=pISet((int)(long)data);
91  return (void *)I;
92 }
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define pISet(i)
Definition: polys.h:294

◆ iiI2Iv()

static void* iiI2Iv ( void *  data)
static

Definition at line 159 of file ipconv.cc.

160 {
161  int s=(int)(long)data;
162  intvec *iv=new intvec(s,s);
163  return (void *)iv;
164 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: intvec.h:14

◆ iiI2N()

static void* iiI2N ( void *  data)
static

Definition at line 166 of file ipconv.cc.

167 {
168  number n=nInit((int)(long)data);
169  return (void *)n;
170 }
#define nInit(i)
Definition: numbers.h:24

◆ iiI2P()

static void* iiI2P ( void *  data)
static

Definition at line 45 of file ipconv.cc.

46 {
47  poly p=pISet((int)(long)data);
48  return (void *)p;
49 }
return P p
Definition: myNF.cc:203
polyrec * poly
Definition: hilb.h:10
#define pISet(i)
Definition: polys.h:294

◆ iiI2V()

static void* iiI2V ( void *  data)
static

Definition at line 65 of file ipconv.cc.

66 {
67  poly p=pISet((int)(long)data);
68  if (p!=NULL) pSetComp(p,1);
69  return (void *)p;
70 }
return P p
Definition: myNF.cc:203
#define pSetComp(p, v)
Definition: polys.h:38
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
#define pISet(i)
Definition: polys.h:294

◆ iiIm2Bim()

static void* iiIm2Bim ( void *  data)
static

Definition at line 320 of file ipconv.cc.

321 {
322  intvec *iv=(intvec*)data;
323  void *r=(void *)iv2bim(iv,coeffs_BIGINT);
324  delete iv;
325  return r;
326 }
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:350
coeffs coeffs_BIGINT
Definition: ipid.cc:54
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14

◆ iiIm2Ma()

static void* iiIm2Ma ( void *  data)
static

Definition at line 303 of file ipconv.cc.

304 {
305  int i, j;
306  intvec *iv = (intvec *)data;
307  matrix m = mpNew(iv->rows(), iv->cols());
308 
309  for (i=iv->rows(); i>0; i--)
310  {
311  for (j=iv->cols(); j>0; j--)
312  {
313  MATELEM(m, i, j) = pISet(IMATELEM(*iv, i, j));
314  }
315  }
316  delete iv;
317  return (void *)m;
318 }
int rows() const
Definition: intvec.h:88
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:47
int cols() const
Definition: intvec.h:87
#define pISet(i)
Definition: polys.h:294
#define IMATELEM(M, I, J)
Definition: intvec.h:77
#define MATELEM(mat, i, j)
Definition: matpol.h:29

◆ iiL2R()

static void iiL2R ( leftv  out,
leftv  in 
)
static

Definition at line 376 of file ipconv.cc.

377 {
378  //int add_row_shift = 0;
379  lists l=(lists)in->Data();
380  intvec *ww=NULL;
381  if (l->nr>=0) ww=(intvec *)atGet(&(l->m[0]),"isHomog",INTVEC_CMD);
382  out->data=(void *)syConvList(l);
383  if (ww!=NULL)
384  {
385  intvec *weights=ivCopy(ww);
386  atSet(out,"isHomog",weights,INTVEC_CMD);
387  }
388 }
sleftv * m
Definition: lists.h:45
void atSet(idhdl root, const char *name, void *data, int typ)
Definition: attrib.cc:156
Definition: lists.h:22
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
syStrategy syConvList(lists li)
Definition: ipshell.cc:3176
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
int nr
Definition: lists.h:43
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
void * Data()
Definition: subexpr.cc:1137
int l
Definition: cfEzgcd.cc:94

◆ iiMa2Mo()

static void* iiMa2Mo ( void *  data)
static

Definition at line 153 of file ipconv.cc.

154 {
155  void *res=id_Matrix2Module((matrix)data,currRing);
156  return res;
157 }
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:10
ideal id_Matrix2Module(matrix mat, const ring R)

◆ iiMo2Ma()

static void* iiMo2Ma ( void *  data)
static

Definition at line 147 of file ipconv.cc.

148 {
149  void *res=id_Module2Matrix((ideal)data,currRing);
150  return res;
151 }
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:10
matrix id_Module2Matrix(ideal mod, const ring R)

◆ iiN2Ma()

static void* iiN2Ma ( void *  data)
static

Definition at line 342 of file ipconv.cc.

343 {
344  ideal I=idInit(1,1);
345  if (!nIsZero((number)data))
346  {
347  poly p=pNSet((number)data);
348  I->m[0]=p;
349  }
350  //else
351  //{
352  // nDelete((number *)&data);
353  //}
354  return (void *)I;
355 }
#define pNSet(n)
Definition: polys.h:295
return P p
Definition: myNF.cc:203
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define nIsZero(n)
Definition: numbers.h:19
polyrec * poly
Definition: hilb.h:10

◆ iiN2P()

static void * iiN2P ( void *  data)
static

Definition at line 328 of file ipconv.cc.

329 {
330  poly p=NULL;
331  if (!nIsZero((number)data))
332  {
333  p=pNSet((number)data);
334  }
335  //else
336  //{
337  // nDelete((number *)&data);
338  //}
339  return (void *)p;
340 }
#define pNSet(n)
Definition: polys.h:295
return P p
Definition: myNF.cc:203
#define nIsZero(n)
Definition: numbers.h:19
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10

◆ iiP2Id()

static void* iiP2Id ( void *  data)
static

Definition at line 116 of file ipconv.cc.

117 {
118  ideal I=idInit(1,1);
119 
120  if (data!=NULL)
121  {
122  poly p=(poly)data;
123  I->m[0]=p;
124  if (pGetComp(p)!=0) I->rank=pMaxComp(p);
125  }
126  return (void *)I;
127 }
#define pMaxComp(p)
Definition: polys.h:281
return P p
Definition: myNF.cc:203
#define pGetComp(p)
Component.
Definition: polys.h:37
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10

◆ iiP2V()

static void* iiP2V ( void *  data)
static

Definition at line 109 of file ipconv.cc.

110 {
111  poly p=(poly)data;
112  if (p!=NULL) pSetCompP(p,1);
113  return (void *)p;
114 }
return P p
Definition: myNF.cc:203
#define pSetCompP(a, i)
Definition: polys.h:285
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10

◆ iiR2L_l()

static void iiR2L_l ( leftv  out,
leftv  in 
)
static

Definition at line 365 of file ipconv.cc.

366 {
367  int add_row_shift = 0;
368  intvec *weights=(intvec*)atGet(in,"isHomog",INTVEC_CMD);
369  if (weights!=NULL) add_row_shift=weights->min_in();
370 
371  syStrategy tmp=(syStrategy)in->CopyD();
372 
373  out->data=(void *)syConvRes(tmp,TRUE,add_row_shift);
374 }
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition: ipshell.cc:3103
#define TRUE
Definition: auxiliary.h:98
int min_in()
Definition: intvec.h:113
void * data
Definition: subexpr.h:89
Definition: intvec.h:14
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:707
ssyStrategy * syStrategy
Definition: syz.h:35

◆ iiS2Link()

static void* iiS2Link ( void *  data)
static

Definition at line 357 of file ipconv.cc.

358 {
360  slInit(l, (char *) data);
361  omFree((ADDRESS)data);
362  return (void *)l;
363 }
void * ADDRESS
Definition: auxiliary.h:115
#define omFree(addr)
Definition: omAllocDecl.h:261
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
int l
Definition: cfEzgcd.cc:94

◆ iiTestConvert()

int iiTestConvert ( int  inputType,
int  outputType,
const struct sConvertTypes dConvertTypes 
)

Definition at line 525 of file ipconv.cc.

526 {
527  if ((inputType==outputType)
528  || (outputType==DEF_CMD)
529  || (outputType==IDHDL)
530  || (outputType==ANY_TYPE))
531  {
532  return -1;
533  }
534  if (inputType==UNKNOWN) return 0;
535 
536  if ((currRing==NULL) && (outputType>BEGIN_RING) && (outputType<END_RING))
537  return 0;
538  //if ((currRing==NULL) && (outputType==CNUMBER_CMD))
539  // return 0;
540 
541  // search the list
542  int i=0;
543  while (dConvertTypes[i].i_typ!=0)
544  {
545  if((dConvertTypes[i].i_typ==inputType)
546  &&(dConvertTypes[i].o_typ==outputType))
547  {
548  //Print("test convert %d to %d (%s -> %s):%d\n",inputType,outputType,
549  //Tok2Cmdname(inputType), Tok2Cmdname(outputType),i+1);
550  return i+1;
551  }
552  i++;
553  }
554  //Print("test convert %d to %d (%s -> %s):0, tested:%d\n",inputType,outputType,
555  // Tok2Cmdname(inputType), Tok2Cmdname(outputType),i);
556  return 0;
557 }
#define ANY_TYPE
Definition: tok.h:30
#define UNKNOWN
Definition: tok.h:217
#define IDHDL
Definition: tok.h:31
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: tok.h:58
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10

◆ iiV2Ma()

static void* iiV2Ma ( void *  data)
static

Definition at line 129 of file ipconv.cc.

130 {
131  matrix m=(matrix)idVec2Ideal((poly)data);
132  int h=MATCOLS(m);
133  MATCOLS(m)=MATROWS(m);
134  MATROWS(m)=h;
135  m->rank=h;
136  pDelete((poly *)&data);
137  return (void *)m;
138 }
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
#define MATCOLS(i)
Definition: matpol.h:28
#define pDelete(p_ptr)
Definition: polys.h:169
#define MATROWS(i)
Definition: matpol.h:27
static ideal idVec2Ideal(poly vec)
Definition: ideals.h:154
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
long rank
Definition: matpol.h:20