20static void nforder_Register()
22 puts(
"nforder_Register called");
27static void * nforder_ideal_Init(blackbox *)
32static char * nforder_ideal_String(blackbox *
b,
void *d)
39static void * nforder_ideal_Copy(blackbox* ,
void *d)
44 if (
l->Typ()==r->
Typ())
52 l->data=(
char *)nforder_ideal_Copy((blackbox*)
NULL, r->
data);
58static void nforder_ideal_destroy(blackbox * ,
void *d)
72 if (cmp && cmp != O)
return FALSE;
81 if (r &&
b->basecoeffs() != r)
return FALSE;
89 number2
b = (number2) arg->
Data();
90 if (r &&
b->cf != r)
return FALSE;
98 if (arg->
Typ() != nforder_type_id)
return FALSE;
100 if (r && (*result)->order() != r)
return FALSE;
113 switch (arg->
Typ()) {
128 number2 n = (number2)arg->
Data();
150 if (!checkArgumentIsNFOrderIdeal(r1,
NULL, &I))
152 if (!checkArgumentIsNFOrderIdeal(r2, I->
order(), &J))
159 if (!checkArgumentIsNFOrderIdeal(r1,
NULL, &I)) {
164 if (!checkArgumentIsNFOrderIdeal(r1,
NULL, &I))
166 if (checkArgumentIsNFOrderIdeal(r2, I->
order(), &J)) {
168 }
else if (checkArgumentIsNumber2(r2, I->
order(), &e)) {
170 }
else if (checkArgumentIsInt(r2, &
f)) {
178 if (!checkArgumentIsNFOrderIdeal(r1,
NULL, &I))
180 if (!checkArgumentIsInt(r2, &
f))
188 l->rtyp = nforder_type_id;
192static BOOLEAN nforder_ideal_bb_setup()
194 blackbox *
b=(blackbox*)
omAlloc0(
sizeof(blackbox));
198 b->blackbox_destroy=nforder_ideal_destroy;
199 b->blackbox_String=nforder_ideal_String;
201 b->blackbox_Init=nforder_ideal_Init;
202 b->blackbox_Copy=nforder_ideal_Copy;
203 b->blackbox_Assign=nforder_ideal_Assign;
205 b->blackbox_Op2=nforder_ideal_Op2;
209 Print(
"setup: created a blackbox type [%d] '%s'",nforder_type_id,
getBlackboxName(nforder_type_id));
218 if (
b->rows() != r)
return FALSE;
219 if (
b->cols() != c)
return FALSE;
223#define returnNumber(_res, _n, _R) \
225 number2 _r = (number2)omAlloc(sizeof(struct snumber2)); \
228 _res->rtyp = CNUMBER_CMD; \
240 for(
int i=0;
i<n;
i++) {
270 if (!checkArgumentIsOrder(arg,
NULL, &O)) {
271 WerrorS(
"usage: IdealFromMat(order, basis matrix)");
276 if (!checkArgumentIsBigintmat(arg, O->
basecoeffs(), &
b)) {
277 WerrorS(
"3:usage: IdealFromMat(order, basis matrix)");
280 result->rtyp = nforder_type_id;
289 if (!checkArgumentIsOrder(arg,
NULL, &O)) {
290 WerrorS(
"usage: EltFromMat(order, matrix)");
295 if (!checkArgumentIsBigintmat(arg, O->
basecoeffs(), &
b)) {
296 WerrorS(
"2:usage: EltFromMat(order, matrix)");
306 if (!checkArgumentIsOrder(arg,
NULL, &O)) {
307 WerrorS(
"usage: Discriminant(order)");
319 if (!checkArgumentIsOrder(arg,
NULL, &o)) {
320 WerrorS(
"usage: pMaximalOrder(order, int)");
324 long p = (int)(
long)arg->
Data();
343 long p = (
int)(long)arg->
Data();
357 if (!checkArgumentIsOrder(arg,
NULL, &o)) {
358 WerrorS(
"usage: NFOrderSimplify(order)");
372 if (!checkArgumentIsNumber2(arg,
NULL, &a)) {
378 WerrorS(
"EltTrace(elt in order)");
391 if (!checkArgumentIsNumber2(arg,
NULL, &a)) {
397 WerrorS(
"EltNorm(elt in order)");
410 number2 a = (number2) arg->
Data();
427 long p = (int)(
long)arg->
Data();
442 nforder_ideal_bb_setup();
443 psModulFunctions->iiAddCproc(
449 psModulFunctions->iiAddCproc(
455 psModulFunctions->iiAddCproc(
461 psModulFunctions->iiAddCproc(
467 psModulFunctions->iiAddCproc(
473 psModulFunctions->iiAddCproc(
479 psModulFunctions->iiAddCproc(
485 psModulFunctions->iiAddCproc(
491 psModulFunctions->iiAddCproc(
497 psModulFunctions->iiAddCproc(
503 psModulFunctions->iiAddCproc(
511 "nforder: orders in number fields");
BOOLEAN dimension(leftv res, leftv args)
void diagonalForm(bigintmat *A, bigintmat **S, bigintmat **T)
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
coeffs basecoeffs() const
number elTrace(bigintmat *a)
coeffs basecoeffs() const
bigintmat * elRepMat(bigintmat *a)
number elNorm(bigintmat *a)
Class used for (list of) interpreter objects.
Coefficient rings, fields and other domains suitable for Singular polynomials.
@ n_Z
only used if HAVE_RINGS is defined
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
void WerrorS(const char *s)
if(!FE_OPT_NO_SHELL_FLAG)(void) system(sys)
void module_help_main(const char *newlib, const char *help)
The main handler for Singular numbers which are suitable for Singular polynomials.
nforder * onestep(nforder *o, number p, coeffs c)
nforder * pmaximal(nforder *o, number p)
number EltCreateMat(nforder *a, bigintmat *b)
BOOLEAN n_nfOrderInit(coeffs r, void *parameter)
EXTERN_VAR n_coeffType nforder_type
nforder_ideal * nf_idMult(nforder_ideal *A, nforder_ideal *B)
nforder_ideal * nf_idPower(nforder_ideal *A, int i)
nforder_ideal * nf_idAdd(nforder_ideal *A, nforder_ideal *B)
n_coeffType nRegister(n_coeffType n, cfInitCharProc p)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void StringSetS(const char *st)
void StringAppendS(const char *st)