-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvec.h
More file actions
43 lines (36 loc) · 861 Bytes
/
vec.h
File metadata and controls
43 lines (36 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Ben LeVeque, 2013
* vec.h
*
* Header for the vector class.
* This class is a wrapper for C++ arrays, adding
* arithmetic functions necessary for the choice-based
* cryptosystem.
**/
#ifndef VEC_H
#define VEC_H
#include "common.h"
class vec
{
public:
vec(){len=0;vals=NULL;};
vec(const vec& v);
vec(int size);
vec(int size, bigint initval);
virtual ~vec();
vec& operator=(vec v);
vec operator+(const vec& v);
vec operator-(const vec& v);
vec operator*(bigint b);
bigint operator[](int i);
void clear(void);
int get_len(void);
void printr(void);
void printinfo(std::string name);
bigint prod(void);
void set_val(int index, bigint val);
protected:
int len;
bigint * vals;
};
#endif