elmt.cpp
Go to the documentation of this file.
1 
12 #include "group.hpp"
13 #include "elmt.hpp"
14 #include "arrayofelmts.hpp"
15 
16 using namespace arithm;
17 
18 
19 Elmt::Elmt(mpz_class v, Group * grp)
20 {
21  value = v;
22  group = grp;
23 }
24 
25 
27 {
28  if (!bt->isLeaf())
29  {
30  std::cout<<"ERROR: in Elmt(bt,grp), bt is not a Leaf."
31  <<"\nbt=";
32  bt->prettyPrint("");
33  std::cout<<std::endl;
34  exit(1);
35  }
36  value = bt->toInteger();
37  group = grp;
38 }
39 
40 
42 {
43  return new verifierUtils::Leaf(value,
44  group->getLeafSize());
45 }
46 
47 
48 mpz_class Elmt::getValue()
49 {
50  return value;
51 }
52 
53 
55 {
56  return group;
57 }