tfhe_libex
src
include
type
integer
integer.hpp
[詳解]
1
5
#ifndef INTEGER
6
#define INTEGER
7
8
#include "../array/array.hpp"
9
#include "../core/integer_core.hpp"
10
#include "../keyset/keyset.hpp"
11
#include "../type.hpp"
12
16
template
<
int
Nbelems>
17
class
TFHEInteger
:
public
TFHEIntegerCore
{
18
public
:
19
friend
class
TFHEArray
<
TFHEInteger
<Nbelems>>;
20
TFHEInteger
(
const
TFHEInteger
& elm) :
TFHEIntegerCore
(elm, Nbelems) {}
21
TFHEInteger
(
const
TFHEIntegerCore
& elm) :
TFHEIntegerCore
(elm, Nbelems) {}
22
26
TFHEInteger
() :
TFHEIntegerCore
(Nbelems) {}
27
32
TFHEInteger
(
int
number) :
TFHEIntegerCore
(Nbelems, number) {}
33
39
TFHEInteger
(
const
char
* path,
int
id
) :
TFHEIntegerCore
(Nbelems, path, id) {}
40
41
protected
:
42
static
void
save_option_forArray(FILE* fp) {
43
int
outbf[2];
44
outbf[0] =
static_cast<
int
>
(TFHEType::TFHEInteger);
45
outbf[1] = Nbelems;
46
fwrite(outbf,
sizeof
(
int
), 2, fp);
47
}
48
49
static
int
array_size(
int
shape_size,
int
array_size) {
50
return
sizeof
(int) * (6 + shape_size) + 2536 * array_size * Nbelems;
51
}
52
53
static
int
array_option_num() {
return
2; }
54
55
void
save_raw(FILE* fp)
override
{ TFHEIntegerCore::save_raw(fp); }
56
void
load_raw(FILE* fp)
override
{ TFHEIntegerCore::load_raw(fp); }
57
};
58
59
#endif
TFHEArray
TFHEの多次元配列のクラス.
Definition:
array.hpp:15
TFHEIntegerCore
TFHEの整数型のcoreクラス.
Definition:
integer_core.hpp:18
TFHEInteger
TFHEの整数型のクラス.
Definition:
integer.hpp:17
TFHEInteger::TFHEInteger
TFHEInteger(int number)
TFHEの整数型を生成するコンストラクタ.
Definition:
integer.hpp:32
TFHEInteger::TFHEInteger
TFHEInteger(const char *path, int id)
TFHEの整数型をファイルから読み込むコンストラクタ.
Definition:
integer.hpp:39
TFHEInteger::TFHEInteger
TFHEInteger()
空のTFHEの整数型を生成するコンストラクタ.
Definition:
integer.hpp:26
構築:
1.8.17