Loading...
Searching...
No Matches
modpk Class Reference

class to do operations mod p^k for int's p and k More...

`#include <fac_util.h>`

## Public Member Functions

| modpk ()
| modpk (int q, int l)
| modpk (const modpk &m)
modpk & | operator= (const modpk &m)
| ~modpk ()
int | getp () const
int | getk () const
CanonicalForm | inverse (const CanonicalForm &f, bool symmetric=true) const
CanonicalForm | getpk () const
CanonicalForm | operator() (const CanonicalForm &f, bool symmetric=true) const
| modpk ()
| modpk (int q, int l)
| modpk (const modpk &m)
modpk & | operator= (const modpk &m)
| ~modpk ()
int | getp () const
int | getk () const
CanonicalForm | inverse (const CanonicalForm &f, bool symmetric=true) const
CanonicalForm | getpk () const
CanonicalForm | operator() (const CanonicalForm &f, bool symmetric=true) const
| modpk ()
| modpk (int q, int l)
| modpk (const modpk &m)
modpk & | operator= (const modpk &m)
| ~modpk ()
int | getp () const
int | getk () const
CanonicalForm | inverse (const CanonicalForm &f, bool symmetric=true) const
CanonicalForm | getpk () const
CanonicalForm | operator() (const CanonicalForm &f, bool symmetric=true) const

## Private Attributes

CanonicalForm | pk
CanonicalForm | pkhalf
int | p
int | k

## Detailed Description

class to do operations mod p^k for int's p and k

Definition at line 22 of file fac_util.h.

## Constructor & Destructor Documentation

## modpk() [1/9]

modpk::modpk | ( |  | ) |

Definition at line 22 of file fac_util.cc.

{
p = 0;
k = 0;
pk = 1;
pkhalf = 0;
}
modpk::p
int p
Definition fac_util.h:27
modpk::pkhalf
CanonicalForm pkhalf
Definition fac_util.h:26
modpk::pk
CanonicalForm pk
Definition fac_util.h:25
modpk::k
int k
Definition fac_util.h:28

## modpk() [2/9]

modpk::modpk | ( | int | q,
|  | int | l )

Definition at line 30 of file fac_util.cc.

{
p = q;
k = l;
pk = power( CanonicalForm( p ), k );
pkhalf = pk / 2;
}
l
int l
Definition cfEzgcd.cc:100
power
CanonicalForm FACTORY_PUBLIC power(const CanonicalForm &f, int n)
exponentiation
Definition canonicalform.cc:1896

## modpk() [3/9]

modpk::modpk | ( | const modpk & | m | ) |

Definition at line 38 of file fac_util.cc.

{
p = m.p;
k = m.k;
pk = m.pk;
pkhalf = m.pkhalf;
}
m
int m
Definition cfEzgcd.cc:128

## ~modpk() [1/3]

modpk::~modpk | ( |  | ) |

inline

Definition at line 34 of file fac_util.h.

{}

## modpk() [4/9]

modpk::modpk | ( |  | ) |

## modpk() [5/9]

modpk::modpk | ( | int | q,
|  | int | l )

## modpk() [6/9]

modpk::modpk | ( | const modpk & | m | ) |

## ~modpk() [2/3]

modpk::~modpk | ( |  | ) |

inline

Definition at line 934 of file factory.h.

{}

## modpk() [7/9]

modpk::modpk | ( |  | ) |

## modpk() [8/9]

modpk::modpk | ( | int | q,
|  | int | l )

## modpk() [9/9]

modpk::modpk | ( | const modpk & | m | ) |

## ~modpk() [3/3]

modpk::~modpk | ( |  | ) |

inline

Definition at line 934 of file factory.h.

{}

## Member Function Documentation

## getk() [1/3]

int modpk::getk | ( |  | ) | const

inline

Definition at line 36 of file fac_util.h.

{ return k; }

## getk() [2/3]

int modpk::getk | ( |  | ) | const

inline

Definition at line 936 of file factory.h.

{ return k; }

## getk() [3/3]

int modpk::getk | ( |  | ) | const

inline

Definition at line 936 of file factory.h.

{ return k; }

## getp() [1/3]

int modpk::getp | ( |  | ) | const

inline

Definition at line 35 of file fac_util.h.

{ return p; }

## getp() [2/3]

int modpk::getp | ( |  | ) | const

inline

Definition at line 935 of file factory.h.

{ return p; }

## getp() [3/3]

int modpk::getp | ( |  | ) | const

inline

Definition at line 935 of file factory.h.

{ return p; }

## getpk() [1/3]

CanonicalForm modpk::getpk | ( |  | ) | const

inline

Definition at line 38 of file fac_util.h.

{ return pk; }

## getpk() [2/3]

CanonicalForm modpk::getpk | ( |  | ) | const

inline

Definition at line 938 of file factory.h.

{ return pk; }

## getpk() [3/3]

CanonicalForm modpk::getpk | ( |  | ) | const

inline

Definition at line 938 of file factory.h.

{ return pk; }

## inverse() [1/3]

CanonicalForm modpk::inverse | ( | const CanonicalForm & | f,
|  | bool | symmetric = true ) const

Definition at line 59 of file fac_util.cc.

{
CanonicalForm u, r0 = this->operator()( f, false ), r1 = pk, q0 = 1, q1 = 0;
while ( ( r0 > 0 ) && ( r1 > 0 ) ) {
u = r0 / r1;
r0 = r0 % r1;
q0 = u*q1 + q0;
if ( r0 > 0 ) {
u = r1 / r0;
r1 = r1 % r0;
q1 = u*q0 + q1;
}
}
if ( r0 == 0 )
return this->operator()( pk-q1, symmetric );
else
return this->operator()( q0, symmetric );
}
f
FILE * f
Definition checklibs.c:9
modpk::operator()
CanonicalForm operator()(const CanonicalForm &f, bool symmetric=true) const
Definition fac_util.cc:79

## inverse() [2/3]

CanonicalForm modpk::inverse | ( | const CanonicalForm & | f,
|  | bool | symmetric = true ) const

## inverse() [3/3]

CanonicalForm modpk::inverse | ( | const CanonicalForm & | f,
|  | bool | symmetric = true ) const

## operator()() [1/3]

CanonicalForm modpk::operator() | ( | const CanonicalForm & | f,
|  | bool | symmetric = true ) const

Definition at line 79 of file fac_util.cc.

{
PKHALF = pkhalf;
PK = pk;
if ( symmetric )
return mapdomain( f, mappksymmetric );
else
return mapdomain( f, mappk );
}
mappksymmetric
static CanonicalForm mappksymmetric(const CanonicalForm &)
Definition fac_util.cc:99
PKHALF
STATIC_INST_VAR CanonicalForm PKHALF
Definition fac_util.cc:15
PK
STATIC_INST_VAR CanonicalForm PK
Definition fac_util.cc:15
mappk
static CanonicalForm mappk(const CanonicalForm &)
Definition fac_util.cc:109
mapdomain
CanonicalForm mapdomain(const CanonicalForm &f, CanonicalForm(*mf)(const CanonicalForm &))
CanonicalForm mapdomain ( const CanonicalForm & f, CanonicalForm (*mf)( const CanonicalForm & ) ).
Definition cf_ops.cc:440

## operator()() [2/3]

CanonicalForm modpk::operator() | ( | const CanonicalForm & | f,
|  | bool | symmetric = true ) const

## operator()() [3/3]

CanonicalForm modpk::operator() | ( | const CanonicalForm & | f,
|  | bool | symmetric = true ) const

## operator=() [1/3]

modpk & modpk::operator= | ( | const modpk & | m | ) |

Definition at line 47 of file fac_util.cc.

{
if ( this != &m ) {
p = m.p;
k = m.k;
pk = m.pk;
pkhalf = m.pkhalf;
}
return *this;
}

## operator=() [2/3]

modpk & modpk::operator= | ( | const modpk & | m | ) |

## operator=() [3/3]

modpk & modpk::operator= | ( | const modpk & | m | ) |

## Field Documentation

## k

int modpk::k

private

Definition at line 28 of file fac_util.h.

## p

int modpk::p

private

Definition at line 27 of file fac_util.h.

## pk

CanonicalForm modpk::pk

private

Definition at line 25 of file fac_util.h.

## pkhalf

CanonicalForm modpk::pkhalf

private

Definition at line 26 of file fac_util.h.

The documentation for this class was generated from the following files:

- factory/fac_util.h
- factory/factory.h
- factory/include/factory/factory.h
- factory/fac_util.cc