My Project
Loading...
Searching...
No Matches
p_Numbers.h
Go to the documentation of this file.
1/****************************************
2* Computer Algebra System SINGULAR *
3****************************************/
4/***************************************************************
5 * File: p_Numbers.h
6 * Purpose: macros/inline functions for number operations
7 * Author: obachman (Olaf Bachmann)
8 * Created: 8/00
9 *******************************************************************/
10#ifndef P_NUMBERS_H
11#define P_NUMBERS_H
12
13#include "misc/auxiliary.h"
14#include "coeffs/coeffs.h"
15#include "coeffs/numbers.h"
17
18static FORCE_INLINE number n_Copy_FieldGeneral(number n, const coeffs r)
19{ return n_Copy(n,r); }
20
21static FORCE_INLINE void n_Delete_FieldGeneral(number* p, const coeffs r)
22{ n_Delete(p,r); }
23
24static FORCE_INLINE number n_Mult_FieldGeneral(number n1, number n2, const coeffs r)
25{ return n_Mult(n1, n2, r); }
26
27static FORCE_INLINE number n_Add_FieldGeneral(number n1, number n2, const coeffs r)
28{ return n_Add(n1, n2, r); }
29
31{ return n_IsZero(n, r); }
32
33static FORCE_INLINE BOOLEAN n_Equal_FieldGeneral(number n1, number n2, const coeffs r)
34{ return n_Equal(n1, n2, r); }
35
36static FORCE_INLINE number n_Neg_FieldGeneral(number n, const coeffs r)
37{ return n_InpNeg(n, r); }
38
39static FORCE_INLINE number n_Sub_FieldGeneral(number n1, number n2, const coeffs r)
40{ return n_Sub(n1, n2, r); }
41
42static FORCE_INLINE void n_InpMult_FieldGeneral(number &n1, number n2, const coeffs r)
43{ n_InpMult(n1, n2, r); }
44
45static FORCE_INLINE void n_InpAdd_FieldGeneral(number &n1, number n2, const coeffs r)
46{ n_InpAdd(n1, n2, r); }
47
48#ifdef HAVE_RINGS
49#define n_Copy_RingGeneral(n, r) n_Copy_FieldGeneral(n, r)
50#define n_Delete_RingGeneral(n, r) n_Delete_FieldGeneral(n, r)
51#define n_Mult_RingGeneral(n1, n2, r) n_Mult_FieldGeneral(n1, n2, r)
52#define n_Add_RingGeneral(n1, n2, r) n_Add_FieldGeneral(n1, n2, r)
53#define n_IsZero_RingGeneral(n, r) n_IsZero_FieldGeneral(n, r)
54#define n_Equal_RingGeneral(n1, n2, r) n_Equal_FieldGeneral(n1, n2, r)
55#define n_Neg_RingGeneral(n, r) n_Neg_FieldGeneral(n, r)
56#define n_Sub_RingGeneral(n1, n2, r) n_Sub_FieldGeneral(n1, n2, r)
57#define n_InpMult_RingGeneral(n1, n2, r) n_InpMult_FieldGeneral(n1, n2, r)
58#define n_InpAdd_RingGeneral(n1,n2,r) n_InpAdd(n1, n2, r)
59#endif
60
61#include "coeffs/modulop.h"
62#include "coeffs/modulop_inl.h"
63
64#define n_Copy_FieldZp(n, r) n
65#define n_Delete_FieldZp(n, r) do {} while (0)
66#define n_Mult_FieldZp(n1,n2,r) npMultM(n1,n2,r)
67#define n_Add_FieldZp(n1,n2,r) npAddM(n1,n2,r)
68#define n_Sub_FieldZp(n1,n2,r) npSubM(n1,n2,r)
69#define n_IsZero_FieldZp(n,r) npIsZeroM(n,r)
70#define n_Equal_FieldZp(n1,n2,r) npEqualM(n1,n2,r)
71#define n_Neg_FieldZp(n,r) npNegM(n,r)
72#define n_InpMult_FieldZp(n1,n2,r) npInpMultM(n1,n2,r)
73#define n_InpAdd_FieldZp(n1,n2,r) npInpAddM(n1,n2,r)
74
75#define DO_LFORCE_INLINE
76#include "coeffs/longrat.cc" // for inlining... TODO: fix this Uglyness?!!!
77
78#define n_Copy_FieldQ(n,r) nlCopy(n,r)
79#define n_Delete_FieldQ(n,r) nlDelete(n,r)
80#define n_Mult_FieldQ(n1,n2,r) nlMult(n1,n2,r)
81#define n_Add_FieldQ(n1,n2,r) nlAdd(n1,n2,r)
82#define n_Sub_FieldQ(n1,n2,r) nlSub(n1,n2,r)
83#define n_IsZero_FieldQ(n,r) nlIsZero(n,r)
84#define n_Equal_FieldQ(n1,n2,r) nlEqual(n1,n2,r)
85#define n_Neg_FieldQ(n,r) nlNeg(n,r)
86#define n_InpMult_FieldQ(n1,n2,r) nlInpMult(n1,n2,r)
87#define n_InpAdd_FieldQ(n1,n2,r) nlInpAdd(n1,n2,r)
88
89#endif
All the auxiliary stuff.
int BOOLEAN
Definition: auxiliary.h:87
#define FORCE_INLINE
Definition: auxiliary.h:329
int p
Definition: cfModGcd.cc:4078
Coefficient rings, fields and other domains suitable for Singular polynomials.
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:633
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:448
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:647
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:554
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition: coeffs.h:461
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:652
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:452
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:638
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:457
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:643
The main handler for Singular numbers which are suitable for Singular polynomials.
static FORCE_INLINE BOOLEAN n_Equal_FieldGeneral(number n1, number n2, const coeffs r)
Definition: p_Numbers.h:33
static FORCE_INLINE void n_InpAdd_FieldGeneral(number &n1, number n2, const coeffs r)
Definition: p_Numbers.h:45
static FORCE_INLINE number n_Add_FieldGeneral(number n1, number n2, const coeffs r)
Definition: p_Numbers.h:27
static FORCE_INLINE void n_Delete_FieldGeneral(number *p, const coeffs r)
Definition: p_Numbers.h:21
static FORCE_INLINE number n_Sub_FieldGeneral(number n1, number n2, const coeffs r)
Definition: p_Numbers.h:39
static FORCE_INLINE number n_Mult_FieldGeneral(number n1, number n2, const coeffs r)
Definition: p_Numbers.h:24
static FORCE_INLINE number n_Neg_FieldGeneral(number n, const coeffs r)
Definition: p_Numbers.h:36
static FORCE_INLINE number n_Copy_FieldGeneral(number n, const coeffs r)
Definition: p_Numbers.h:18
static FORCE_INLINE void n_InpMult_FieldGeneral(number &n1, number n2, const coeffs r)
Definition: p_Numbers.h:42
static FORCE_INLINE BOOLEAN n_IsZero_FieldGeneral(number n, const coeffs r)
Definition: p_Numbers.h:30