My Project
Loading...
Searching...
No Matches
modulop_inl.h File Reference
#include "misc/auxiliary.h"
#include "coeffs/modulop.h"

Go to the source code of this file.

Macros

#define npIsZeroM(A, B)
 
#define ULONG64   (unsigned long)
 

Functions

static number npMult (number a, number b, const coeffs r)
 
static number npInit (long i, const coeffs r)
 
static BOOLEAN npIsZero (number a, const coeffs r)
 
static number nvMult (number a, number b, const coeffs r)
 

Macro Definition Documentation

◆ npIsZeroM

#define npIsZeroM ( A,
B )
Value:
(0==(long)A)
#define A
Definition sirandom.c:24

Definition at line 37 of file modulop_inl.h.

◆ ULONG64

#define ULONG64   (unsigned long)

Function Documentation

◆ npInit()

static number npInit ( long i,
const coeffs r )
inlinestatic

Definition at line 27 of file modulop_inl.h.

28{
29 long ii=i % (long)r->ch;
30 if (ii < 0L) ii += (long)r->ch;
31
32 number c = (number)ii;
33 n_Test(c, r);
34 return c;
35}
int i
Definition cfEzgcd.cc:132
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition coeffs.h:713

◆ npIsZero()

static BOOLEAN npIsZero ( number a,
const coeffs r )
inlinestatic

Definition at line 38 of file modulop_inl.h.

39{
40 n_Test(a, r);
41
42 return npIsZeroM(a,r);
43}
#define npIsZeroM(A, B)
Definition modulop_inl.h:37

◆ npMult()

static number npMult ( number a,
number b,
const coeffs r )
inlinestatic

Definition at line 12 of file modulop_inl.h.

13{
14 n_Test(a, r);
15 n_Test(b, r);
16
17 if (((long)a == 0) || ((long)b == 0))
18 return (number)0;
19 number c = npMultM(a,b, r);
20 n_Test(c, r);
21 return c;
22}
CanonicalForm b
Definition cfModGcd.cc:4111
static number npMultM(number a, number b, const coeffs r)
Definition modulop.h:71

◆ nvMult()

static number nvMult ( number a,
number b,
const coeffs r )
inlinestatic

Definition at line 50 of file modulop_inl.h.

51{
52 assume( getCoeffType(r) == n_Zp );
53
54#if SIZEOF_LONG == 4
55#define ULONG64 (unsigned long long)(unsigned long)
56#else
57#define ULONG64 (unsigned long)
58#endif
59 return (number)
60 (unsigned long)((ULONG64 a)*(ULONG64 b) % (ULONG64 r->ch));
61}
@ n_Zp
\F{p < 2^31}
Definition coeffs.h:29
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition coeffs.h:429
#define ULONG64
#define assume(x)
Definition mod2.h:389