Functions
gnumpc.h File Reference
#include <misc/auxiliary.h>

Go to the source code of this file.

Functions

BOOLEAN ngcInitChar (coeffs r, void *)
 Initialize r (n_long_C) More...
 

Function Documentation

BOOLEAN ngcInitChar ( coeffs  r,
void *   
)

Initialize r (n_long_C)

Definition at line 464 of file gnumpc.cc.

465 {
466  assume( getCoeffType(n) == ID );
467  n->is_field=TRUE;
468  n->is_domain=TRUE;
469  n->rep=n_rep_gmp_complex;
470 
471  n->cfKillChar = ngcKillChar;
472  n->ch = 0;
473  n->cfCoeffString=ngcCoeffString;
474 
475  n->cfDelete = ngcDelete;
476  //n->cfNormalize=ndNormalize;
477  n->cfInit = ngcInit;
478  n->cfInt = ngcInt;
479  n->cfAdd = ngcAdd;
480  n->cfSub = ngcSub;
481  n->cfMult = ngcMult;
482  n->cfDiv = ngcDiv;
483  n->cfExactDiv= ngcDiv;
484  n->cfInpNeg = ngcNeg;
485  n->cfInvers = ngcInvers;
486  n->cfCopy = ngcCopy;
487  n->cfGreater = ngcGreater;
488  n->cfEqual = ngcEqual;
489  n->cfIsZero = ngcIsZero;
490  n->cfIsOne = ngcIsOne;
491  n->cfIsMOne = ngcIsMOne;
492  n->cfGreaterZero = ngcGreaterZero;
493 
494  n->cfWriteLong = ngcWrite;
495  n->cfWriteShort = ngcWrite;
496 
497  n->cfRead = ngcRead;
498  n->cfPower = ngcPower;
499  n->cfSetMap = ngcSetMap;
500  n->cfRePart = ngcRePart;
501  n->cfImPart = ngcImPart;
502  n->cfCoeffWrite = ngcCoeffWrite;
503  // cfSize = ndSize;
504 #ifdef LDEBUG
505  //n->cfDBTest = ndDBTest; // not yet implemented: ngcDBTest
506 #endif
507 
508  n->nCoeffIsEqual = ngcCoeffIsEqual;
509 
510  n->cfSetChar=ngcSetChar;
511 
512 // we need to initialize n->nNULL at least for minpoly printing
513  n->nNULL = n->cfInit(0,n);
514 
515 /*
516  //r->cfInitChar=nlInitChar;
517  r->cfKillChar=NULL;
518 
519  r->cfMult = nlMult;
520  r->cfSub = nlSub;
521  r->cfAdd = nlAdd;
522  r->cfDiv = nlDiv;
523  r->cfIntMod= nlIntMod;
524  r->cfExactDiv= nlExactDiv;
525  r->cfInit = nlInit;
526  r->cfSize = nlSize;
527  r->cfInt = nlInt;
528 #ifdef HAVE_RINGS
529  r->cfDivComp = NULL; // only for ring stuff
530  r->cfIsUnit = NULL; // only for ring stuff
531  r->cfGetUnit = NULL; // only for ring stuff
532  r->cfExtGcd = NULL; // only for ring stuff
533 #endif
534  r->cfInpNeg = nlNeg;
535  r->cfInvers= nlInvers;
536  r->cfCopy = nl_Copy;
537  r->cfRePart = nl_Copy;
538  r->cfImPart = ndReturn0;
539  r->cfWriteLong = nlWrite;
540  r->cfRead = nlRead;
541  r->cfNormalize=nlNormalize;
542  r->cfGreater = nlGreater;
543 #ifdef HAVE_RINGS
544  r->cfDivBy = NULL; // only for ring stuff
545 #endif
546  r->cfEqual = nlEqual;
547  r->cfIsZero = nlIsZero;
548  r->cfIsOne = nlIsOne;
549  r->cfIsMOne = nlIsMOne;
550  r->cfGreaterZero = nlGreaterZero;
551  r->cfPower = nlPower;
552  r->cfGetDenom = nlGetDenom;
553  r->cfGetNumerator = nlGetNumerator;
554  r->cfGcd = nlGcd;
555  r->cfLcm = nlLcm;
556  r->cfDelete= nlDelete;
557  r->cfSetMap = nlSetMap;
558  r->cfName = ndName;
559  r->cfInpMult=nlInpMult;
560  r->cfInit_bigint=nlCopyMap;
561 #ifdef LDEBUG
562  // debug stuff
563  r->cfDBTest=nlDBTest;
564 #endif
565 
566  // the variables:
567  r->nNULL = INT_TO_SR(0);
568  r->type = n_Q;
569  r->ch = 0;
570  r->has_simple_Alloc=FALSE;
571  r->has_simple_Inverse=FALSE;
572 */
573 
574  n->iNumberOfParameters = 1;
575  n->cfParameter = ngcParameter;
576 
577  char ** pParameterNames = (char **) omAlloc0(sizeof(char *));
578 
579  if( parameter != NULL)
580  {
581  LongComplexInfo* p = (LongComplexInfo*)parameter;
582  pParameterNames[0] = omStrDup(p->par_name);
583  // fix wrong parameters:
585  n->float_len = p->float_len;
586  n->float_len2 = p->float_len2;
587 
588  } else // default values, just for testing!
589  {
590  pParameterNames[0] = omStrDup("i");
591  n->float_len = SHORT_REAL_LENGTH;
592  n->float_len2 = SHORT_REAL_LENGTH;
593  }
594 
595  assume( pParameterNames != NULL );
596  assume( pParameterNames[0] != NULL );
597 
598  n->pParameterNames = (const char**)pParameterNames;
599 
600  // NOTE: n->complex_parameter was replaced by n_ParameterNames(n)[0]
601  // TODO: nfKillChar MUST destroy n->pParameterNames[0] (0-term. string) && n->pParameterNames (array of size 1)
602 
603  return FALSE;
604 }
void ngcPower(number x, int exp, number *lu, const coeffs r)
Definition: gnumpc.cc:242
static void ngcKillChar(coeffs r)
Definition: gnumpc.cc:443
number ngcRePart(number a, const coeffs r)
Definition: gnumpc.cc:294
void ngcDelete(number *a, const coeffs r)
Definition: gnumpc.cc:135
number ngcInit(long i, const coeffs r)
Definition: gnumpc.cc:98
void ngcWrite(number a, const coeffs r)
Definition: gnumpc.cc:405
number ngcImPart(number a, const coeffs r)
Definition: gnumpc.cc:302
#define SHORT_REAL_LENGTH
Definition: numbers.h:54
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
nMapFunc ngcSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type: long_C!
Definition: gnumpc.cc:701
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
long ngcInt(number &n, const coeffs r)
Definition: gnumpc.cc:110
#define TRUE
Definition: auxiliary.h:144
number ngcDiv(number a, number b, const coeffs r)
Definition: gnumpc.cc:225
BOOLEAN ngcCoeffIsEqual(const coeffs r, n_coeffType n, void *parameter)
Definition: gnumpc.cc:421
short float_len2
additional char-flags, rInit
Definition: coeffs.h:101
void ngcCoeffWrite(const coeffs r, BOOLEAN details)
Definition: gnumpc.cc:732
static char * ngcCoeffString(const coeffs r)
Definition: gnumpc.cc:456
void ngcSetChar(const coeffs r)
Definition: gnumpc.cc:606
short float_len
additional char-flags, rInit
Definition: coeffs.h:100
BOOLEAN ngcGreaterZero(number za, const coeffs r)
Note: MAY NOT WORK AS EXPECTED!
Definition: gnumpc.cc:313
static const n_coeffType ID
Our Type!
Definition: gnumpc.cc:71
number ngcSub(number la, number li, const coeffs r)
Definition: gnumpc.cc:203
#define assume(x)
Definition: mod2.h:405
(gmp_complex), see gnumpc.h
Definition: coeffs.h:117
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:422
BOOLEAN ngcIsOne(number a, const coeffs r)
Definition: gnumpc.cc:350
BOOLEAN ngcIsZero(number za, const coeffs r)
Definition: gnumpc.cc:287
BOOLEAN ngcIsMOne(number a, const coeffs r)
Definition: gnumpc.cc:361
#define NULL
Definition: omList.c:10
number ngcMult(number a, number b, const coeffs r)
Definition: gnumpc.cc:214
number ngcAdd(number la, number li, const coeffs r)
Definition: gnumpc.cc:192
const char * ngcRead(const char *s, number *a, const coeffs r)
Definition: gnumpc.cc:372
BOOLEAN ngcGreater(number a, number b, const coeffs r)
Definition: gnumpc.cc:326
number ngcParameter(int i, const coeffs r)
Definition: gnumpc.cc:84
const char * par_name
parameter name
Definition: coeffs.h:102
number ngcInvers(number a, const coeffs r)
Definition: gnumpc.cc:173
number ngcNeg(number za, const coeffs r)
Definition: gnumpc.cc:161
BOOLEAN ngcEqual(number a, number b, const coeffs r)
Definition: gnumpc.cc:338
#define omAlloc0(size)
Definition: omAllocDecl.h:211
number ngcCopy(number a, const coeffs r)
Definition: gnumpc.cc:149
#define omStrDup(s)
Definition: omAllocDecl.h:263