CiFEr
include
cifer
sample
normal_negative.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 XLAB d.o.o.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef CIFER_NORMAL_NEGATIVE_H
18
#define CIFER_NORMAL_NEGATIVE_H
19
20
#include "
cifer/sample/normal.h
"
21
33
typedef
struct
cfe_normal_negative
{
34
cfe_normal
nor;
35
mpz_t cut;
// cut defines from which interval we sample
36
mpz_t twice_cut_plus_one;
// precomputed value so we do not need to calculate it each time
37
}
cfe_normal_negative
;
38
46
void
cfe_normal_negative_init
(
cfe_normal_negative
*s, mpf_t sigma,
size_t
n);
47
55
void
cfe_normal_negative_free
(
cfe_normal_negative
*s);
56
64
void
cfe_normal_negative_sample
(mpz_t res,
cfe_normal_negative
*s);
65
69
void
cfe_normal_negative_sample_vec
(
cfe_vec
*res,
cfe_normal_negative
*s);
70
74
void
cfe_normal_negative_sample_mat
(
cfe_mat
*res,
cfe_normal_negative
*s);
75
76
#endif
cfe_normal_negative_init
void cfe_normal_negative_init(cfe_normal_negative *s, mpf_t sigma, size_t n)
cfe_normal_negative_sample_mat
void cfe_normal_negative_sample_mat(cfe_mat *res, cfe_normal_negative *s)
cfe_normal_negative
struct cfe_normal_negative cfe_normal_negative
cfe_vec
Definition:
vec.h:41
cfe_normal_negative_sample
void cfe_normal_negative_sample(mpz_t res, cfe_normal_negative *s)
cfe_normal_negative
Definition:
normal_negative.h:33
cfe_normal_negative_free
void cfe_normal_negative_free(cfe_normal_negative *s)
cfe_normal_negative_sample_vec
void cfe_normal_negative_sample_vec(cfe_vec *res, cfe_normal_negative *s)
cfe_normal
Definition:
normal.h:34
normal.h
Normal sampler.
cfe_mat
Definition:
mat.h:44
Generated by
1.8.17