My Project
Loading...
Searching...
No Matches
Data Structures | Functions
flintcf_Zn.h File Reference
#include "singularconfig.h"
#include "misc/auxiliary.h"

Go to the source code of this file.

Data Structures

struct  flintZn_struct
 

Functions

BOOLEAN flintZn_InitChar (coeffs cf, void *infoStruct)
 
coeffs flintZnInitCfByName (char *s, n_coeffType n)
 

Data Structure Documentation

◆ flintZn_struct

struct flintZn_struct

Definition at line 16 of file flintcf_Zn.h.

Data Fields
int ch
char * name

Function Documentation

◆ flintZn_InitChar()

BOOLEAN flintZn_InitChar ( coeffs  cf,
void *  infoStruct 
)

Definition at line 486 of file flintcf_Zn.cc.

487{
488 flintZn_struct *pp=(flintZn_struct*)infoStruct;
489 cf->ch=pp->ch;
490
491 cf->cfCoeffName = CoeffName;
492 cf->nCoeffIsEqual = CoeffIsEqual;
493 cf->cfKillChar = KillChar;
494 cf->cfSetChar = SetChar;
495 cf->cfMult = Mult;
496 cf->cfSub = Sub;
497 cf->cfAdd = Add;
498 cf->cfDiv = Div;
499 cf->cfExactDiv = ExactDiv; // ???
500 cf->cfInit = Init;
501 cf->cfInitMPZ = InitMPZ;
502 cf->cfSize = Size;
503 cf->cfInt = Int;
504 cf->cfMPZ = MPZ;
505 cf->cfInpNeg = Neg;
506 cf->cfInvers = Invers;
507 cf->cfCopy = Copy;
508 cf->cfRePart = Copy;
509 // default: cf->cfImPart = ndReturn0;
510 cf->cfWriteLong = WriteShort; //WriteLong;
511 cf->cfWriteShort = WriteShort;
512 cf->cfRead = Read;
513 cf->cfNormalize = Normalize;
514
515 //cf->cfDivComp=
516 //cf->cfIsUnit=
517 //cf->cfGetUnit=
518 //cf->cfDivBy=
519
520 cf->cfGreater=Greater;
521 cf->cfEqual =Equal;
522 cf->cfIsZero =IsZero;
523 cf->cfIsOne =IsOne;
524 cf->cfIsMOne =IsMOne;
525 cf->cfGreaterZero=GreaterZero;
526
527 cf->cfPower = Power;
528 //default: cf->cfGetDenom = GetDenom;
529 //default: cf->cfGetNumerator = GetNumerator;
530 cf->cfGcd = Gcd;
531 cf->cfExtGcd = ExtGcd;
532 cf->cfLcm = Lcm;
533 cf->cfDelete = Delete;
534 cf->cfSetMap = SetMap;
535 // default: cf->cfInpMult
536 // default: cf->cfInpAdd
537 cf->cfFarey =Farey;
538 cf->cfChineseRemainder=ChineseRemainder;
539 cf->cfParDeg = ParDeg;
540 cf->cfParameter = Parameter;
541 // cf->cfClearContent = ClearContent;
542 // cf->cfClearDenominators = ClearDenominators;
543 //cf->convFactoryNSingN=ConvFactoryNSingN;
544 //cf->convSingNFactoryN=ConvSingNFactoryN;
545 cf->cfWriteFd = WriteFd;
546 cf->cfReadFd = ReadFd;
547#ifdef LDEBUG
548 cf->cfDBTest = DBTest;
549#endif
550
551 cf->iNumberOfParameters = 1;
552 char **pn=(char**)omAlloc0(sizeof(char*));
553 pn[0]=(char*)omStrDup(pp->name);
554 cf->pParameterNames = (const char **)pn;
555 cf->has_simple_Inverse= FALSE;
556 cf->has_simple_Alloc= FALSE;
557 cf->is_field=FALSE;
558
559 return FALSE;
560}
#define FALSE
Definition: auxiliary.h:96
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:676
CanonicalForm cf
Definition: cfModGcd.cc:4083
static void WriteShort(number a, const coeffs r)
Definition: flintcf_Zn.cc:215
static char * CoeffName(const coeffs r)
Definition: flintcf_Zn.cc:426
static number Lcm(number a, number b, const coeffs r)
Definition: flintcf_Zn.cc:344
static void MPZ(mpz_t result, number &n, const coeffs r)
Definition: flintcf_Zn.cc:159
static number Neg(number a, const coeffs r)
Definition: flintcf_Zn.cc:169
static BOOLEAN Greater(number a, number b, const coeffs r)
Definition: flintcf_Zn.cc:282
static const char * Read(const char *st, number *a, const coeffs r)
Definition: flintcf_Zn.cc:245
static number Mult(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:63
static number Sub(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:70
static long Int(number &n, const coeffs r)
Definition: flintcf_Zn.cc:149
static number Init(long i, const coeffs r)
Definition: flintcf_Zn.cc:125
static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void *parameter)
Definition: flintcf_Zn.cc:47
static void Normalize(number &a, const coeffs r)
Definition: flintcf_Zn.cc:279
static number Gcd(number a, number b, const coeffs r)
Definition: flintcf_Zn.cc:328
static number ExtGcd(number a, number b, number *s, number *t, const coeffs r)
Definition: flintcf_Zn.cc:335
static void WriteFd(number a, const ssiInfo *d, const coeffs)
Definition: flintcf_Zn.cc:453
static BOOLEAN GreaterZero(number k, const coeffs r)
Definition: flintcf_Zn.cc:315
static BOOLEAN DBTest(number a, const char *f, const int l, const coeffs r)
Definition: flintcf_Zn.cc:481
static void Delete(number *a, const coeffs r)
Definition: flintcf_Zn.cc:349
static number ReadFd(const ssiInfo *d, const coeffs r)
Definition: flintcf_Zn.cc:466
static void KillChar(coeffs cf)
Definition: flintcf_Zn.cc:54
static number Copy(number a, const coeffs r)
Definition: flintcf_Zn.cc:197
static number InitMPZ(mpz_t i, const coeffs r)
Definition: flintcf_Zn.cc:134
static number Div(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:84
static void Power(number a, int i, number *result, const coeffs r)
Definition: flintcf_Zn.cc:321
static BOOLEAN Equal(number a, number b, const coeffs r)
Definition: flintcf_Zn.cc:297
static number Add(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:77
static BOOLEAN IsOne(number a, const coeffs r)
Definition: flintcf_Zn.cc:305
static number Farey(number p, number n, const coeffs)
Definition: flintcf_Zn.cc:389
static BOOLEAN IsZero(number a, const coeffs r)
Definition: flintcf_Zn.cc:301
static int ParDeg(number x, const coeffs r)
Definition: flintcf_Zn.cc:399
static nMapFunc SetMap(const coeffs src, const coeffs dst)
Definition: flintcf_Zn.cc:358
static number ChineseRemainder(number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs)
Definition: flintcf_Zn.cc:394
static BOOLEAN IsMOne(number k, const coeffs r)
Definition: flintcf_Zn.cc:309
static void SetChar(const coeffs r)
Definition: flintcf_Zn.cc:59
static number Parameter(const int i, const coeffs r)
Definition: flintcf_Zn.cc:403
static number Invers(number a, const coeffs r)
Definition: flintcf_Zn.cc:174
static int Size(number n, const coeffs r)
Definition: flintcf_Zn.cc:145
static number ExactDiv(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:106
#define omStrDup(s)
Definition: omAllocDecl.h:263
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ flintZnInitCfByName()

coeffs flintZnInitCfByName ( char *  s,
n_coeffType  n 
)

Definition at line 432 of file flintcf_Zn.cc.

433{
434 const char start[]="flint:Z/";
435 const int start_len=strlen(start);
436 if (strncmp(s,start,start_len)==0)
437 {
438 s+=start_len;
439 int p;
440 char st[10];
441 int l=sscanf(s,"%d[%s",&p,st);
442 if (l==2)
443 {
445 info.ch=p;
446 while (st[strlen(st)-1]==']') st[strlen(st)-1]='\0';
447 info.name=st;
448 return nInitChar(n,(void*)&info);
449 }
450 }
451 return NULL;
452}
int l
Definition: cfEzgcd.cc:100
int p
Definition: cfModGcd.cc:4078
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:413
const CanonicalForm int s
Definition: facAbsFact.cc:51
#define info
Definition: libparse.cc:1256
#define NULL
Definition: omList.c:12