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)
A
#define A
Definition sirandom.c:24

Definition at line 37 of file modulop_inl.h.

## ULONG64

#define ULONG64 (unsigned long)

## Function Documentation

## npInit()

number npInit | ( | long | i,
|  | const coeffs | r )

inline static

Definition at line 27 of file modulop_inl.h.

{
long ii=i % (long)r->ch;
if (ii < 0L) ii += (long)r->ch;
number c = (number)ii;
n_Test(c, r);
return c;
}
i
int i
Definition cfEzgcd.cc:132
n_Test
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r).
Definition coeffs.h:715

## npIsZero()

BOOLEAN npIsZero | ( | number | a,
|  | const coeffs | r )

inline static

Definition at line 38 of file modulop_inl.h.

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

## npMult()

number npMult | ( | number | a,
|  | number | b,
|  | const coeffs | r )

inline static

Definition at line 12 of file modulop_inl.h.

{
n_Test(a, r);
n_Test(b, r);
if (((long)a == 0) || ((long)b == 0))
return (number)0;
number c = npMultM(a,b, r);
n_Test(c, r);
return c;
}
b
CanonicalForm b
Definition cfModGcd.cc:4111
npMultM
static number npMultM(number a, number b, const coeffs r)
Definition modulop.h:71

## nvMult()

number nvMult | ( | number | a,
|  | number | b,
|  | const coeffs | r )

inline static

Definition at line 50 of file modulop_inl.h.

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