Loading...
Searching...
No Matches
p_Numbers.h
Go to the documentation of this file.
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/***************************************************************
* File: p_Numbers.h
* Purpose: macros/inline functions for number operations
* Author: obachman (Olaf Bachmann)
* Created: 8/00
*******************************************************************/
#ifndef P_NUMBERS_H
#define P_NUMBERS_H
#include "misc/auxiliary.h"
#include "coeffs/coeffs.h"
#include "coeffs/numbers.h"
#include "polys/monomials/ring.h"
static FORCE_INLINE number n_Copy_FieldGeneral(number n, const coeffs r)
{ return n_Copy(n,r); }
static FORCE_INLINE void n_Delete_FieldGeneral(number* p, const coeffs r)
{ n_Delete(p,r); }
static FORCE_INLINE number n_Mult_FieldGeneral(number n1, number n2, const coeffs r)
{ return n_Mult(n1, n2, r); }
static FORCE_INLINE number n_Add_FieldGeneral(number n1, number n2, const coeffs r)
{ return n_Add(n1, n2, r); }
static FORCE_INLINE BOOLEAN n_IsZero_FieldGeneral(number n, const coeffs r)
{ return n_IsZero(n, r); }
static FORCE_INLINE BOOLEAN n_Equal_FieldGeneral(number n1, number n2, const coeffs r)
{ return n_Equal(n1, n2, r); }
static FORCE_INLINE number n_Neg_FieldGeneral(number n, const coeffs r)
{ return n_InpNeg(n, r); }
static FORCE_INLINE number n_Sub_FieldGeneral(number n1, number n2, const coeffs r)
{ return n_Sub(n1, n2, r); }
static FORCE_INLINE void n_InpMult_FieldGeneral(number &n1, number n2, const coeffs r)
{ n_InpMult(n1, n2, r); }
static FORCE_INLINE void n_InpAdd_FieldGeneral(number &n1, number n2, const coeffs r)
{ n_InpAdd(n1, n2, r); }
#ifdef HAVE_RINGS
#define n_Copy_RingGeneral(n, r) n_Copy_FieldGeneral(n, r)
#define n_Delete_RingGeneral(n, r) n_Delete_FieldGeneral(n, r)
#define n_Mult_RingGeneral(n1, n2, r) n_Mult_FieldGeneral(n1, n2, r)
#define n_Add_RingGeneral(n1, n2, r) n_Add_FieldGeneral(n1, n2, r)
#define n_IsZero_RingGeneral(n, r) n_IsZero_FieldGeneral(n, r)
#define n_Equal_RingGeneral(n1, n2, r) n_Equal_FieldGeneral(n1, n2, r)
#define n_Neg_RingGeneral(n, r) n_Neg_FieldGeneral(n, r)
#define n_Sub_RingGeneral(n1, n2, r) n_Sub_FieldGeneral(n1, n2, r)
#define n_InpMult_RingGeneral(n1, n2, r) n_InpMult_FieldGeneral(n1, n2, r)
#define n_InpAdd_RingGeneral(n1,n2,r) n_InpAdd(n1, n2, r)
#endif
#include "coeffs/modulop.h"
#include "coeffs/modulop_inl.h"
#define n_Copy_FieldZp(n, r) n
#define n_Delete_FieldZp(n, r) do {} while (0)
#define n_Mult_FieldZp(n1,n2,r) npMultM(n1,n2,r)
#define n_Add_FieldZp(n1,n2,r) npAddM(n1,n2,r)
#define n_Sub_FieldZp(n1,n2,r) npSubM(n1,n2,r)
#define n_IsZero_FieldZp(n,r) npIsZeroM(n,r)
#define n_Equal_FieldZp(n1,n2,r) npEqualM(n1,n2,r)
#define n_Neg_FieldZp(n,r) npNegM(n,r)
#define n_InpMult_FieldZp(n1,n2,r) npInpMultM(n1,n2,r)
#define n_InpAdd_FieldZp(n1,n2,r) npInpAddM(n1,n2,r)
#define DO_LFORCE_INLINE
#include "coeffs/longrat.cc" // for inlining... TODO: fix this Ugliness?!!!
#define n_Copy_FieldQ(n,r) nlCopy(n,r)
#define n_Delete_FieldQ(n,r) nlDelete(n,r)
#define n_Mult_FieldQ(n1,n2,r) nlMult(n1,n2,r)
#define n_Add_FieldQ(n1,n2,r) nlAdd(n1,n2,r)
#define n_Sub_FieldQ(n1,n2,r) nlSub(n1,n2,r)
#define n_IsZero_FieldQ(n,r) nlIsZero(n,r)
#define n_Equal_FieldQ(n1,n2,r) nlEqual(n1,n2,r)
#define n_Neg_FieldQ(n,r) nlNeg(n,r)
#define n_InpMult_FieldQ(n1,n2,r) nlInpMult(n1,n2,r)
#define n_InpAdd_FieldQ(n1,n2,r) nlInpAdd(n1,n2,r)
#endif
auxiliary.h
All the auxiliary stuff.
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
FORCE_INLINE
#define FORCE_INLINE
Definition auxiliary.h:330
p
int p
Definition cfModGcd.cc:4086
coeffs.h
Coefficient rings, fields and other domains suitable for Singular polynomials.
n_Mult
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
Definition coeffs.h:639
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:457
n_Add
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
Definition coeffs.h:653
n_InpNeg
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
Definition coeffs.h:560
n_IsZero
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition coeffs.h:470
n_Sub
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
Definition coeffs.h:658
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
n_InpMult
static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
multiplication of 'a' and 'b'; replacement of 'a' by the product a*b
Definition coeffs.h:644
n_Equal
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
Definition coeffs.h:466
n_InpAdd
static FORCE_INLINE void n_InpAdd(number &a, number b, const coeffs r)
addition of 'a' and 'b'; replacement of 'a' by the sum a+b
Definition coeffs.h:649
longrat.cc
modulop.h
modulop_inl.h
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
numbers.h
n_Equal_FieldGeneral
static FORCE_INLINE BOOLEAN n_Equal_FieldGeneral(number n1, number n2, const coeffs r)
Definition p_Numbers.h:33
n_InpAdd_FieldGeneral
static FORCE_INLINE void n_InpAdd_FieldGeneral(number &n1, number n2, const coeffs r)
Definition p_Numbers.h:45
n_Add_FieldGeneral
static FORCE_INLINE number n_Add_FieldGeneral(number n1, number n2, const coeffs r)
Definition p_Numbers.h:27
n_Delete_FieldGeneral
static FORCE_INLINE void n_Delete_FieldGeneral(number *p, const coeffs r)
Definition p_Numbers.h:21
n_Sub_FieldGeneral
static FORCE_INLINE number n_Sub_FieldGeneral(number n1, number n2, const coeffs r)
Definition p_Numbers.h:39
n_Mult_FieldGeneral
static FORCE_INLINE number n_Mult_FieldGeneral(number n1, number n2, const coeffs r)
Definition p_Numbers.h:24
n_Neg_FieldGeneral
static FORCE_INLINE number n_Neg_FieldGeneral(number n, const coeffs r)
Definition p_Numbers.h:36
n_Copy_FieldGeneral
static FORCE_INLINE number n_Copy_FieldGeneral(number n, const coeffs r)
Definition p_Numbers.h:18
n_InpMult_FieldGeneral
static FORCE_INLINE void n_InpMult_FieldGeneral(number &n1, number n2, const coeffs r)
Definition p_Numbers.h:42
n_IsZero_FieldGeneral
static FORCE_INLINE BOOLEAN n_IsZero_FieldGeneral(number n, const coeffs r)
Definition p_Numbers.h:30
ring.h