arithm::Elmt Class Reference

Implements an element of any group. More...

#include <elmt.hpp>

+ Collaboration diagram for arithm::Elmt:

Public Member Functions

 Elmt (mpz_class v, Group *grp)
 Initializes all the attributes of this instance.
 Elmt (verifierUtils::ByteTree *bt, Group *grp)
 Initializes this instance from a ByteTree.
verifierUtils::ByteTreetoByteTree ()
 Returns a leaf of the size specified in the base group containing the value of this element.
mpz_class getValue ()
 Returns the value of this element.
GroupgetGroup ()
 Returns the group this element is in.

Private Attributes

mpz_class value
 The value of this element.
Groupgroup
 The group it is in.

Detailed Description

Implements an element of any group.

Definition at line 29 of file elmt.hpp.

Constructor & Destructor Documentation

Elmt::Elmt ( mpz_class  v,
Group grp 
)

Initializes all the attributes of this instance.

Parameters
vThe value to give to value.
grpThe value to give to group.

Definition at line 19 of file elmt.cpp.

{
value = v;
group = grp;
}
Elmt::Elmt ( verifierUtils::ByteTree bt,
Group grp 
)

Initializes this instance from a ByteTree.

Parameters
btA leaf representing the value.
grpThe Group this element is in.

Definition at line 26 of file elmt.cpp.

{
if (!bt->isLeaf())
{
std::cout<<"ERROR: in Elmt(bt,grp), bt is not a Leaf."
<<"\nbt=";
bt->prettyPrint("");
std::cout<<std::endl;
exit(1);
}
value = bt->toInteger();
group = grp;
}

Member Function Documentation

Group * Elmt::getGroup ( )

Returns the group this element is in.

Definition at line 54 of file elmt.cpp.

{
return group;
}
mpz_class Elmt::getValue ( )

Returns the value of this element.

Definition at line 48 of file elmt.cpp.

{
return value;
}
verifierUtils::ByteTree * Elmt::toByteTree ( )

Returns a leaf of the size specified in the base group containing the value of this element.

Definition at line 41 of file elmt.cpp.

Member Data Documentation

Group* arithm::Elmt::group
private

The group it is in.

Definition at line 40 of file elmt.hpp.

mpz_class arithm::Elmt::value
private

The value of this element.

Definition at line 35 of file elmt.hpp.


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