forked from microsoft/SEAL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclipnormal.cpp
More file actions
28 lines (25 loc) · 794 Bytes
/
clipnormal.cpp
File metadata and controls
28 lines (25 loc) · 794 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#include "seal/util/clipnormal.h"
#include <stdexcept>
using namespace std;
namespace seal
{
namespace util
{
ClippedNormalDistribution::ClippedNormalDistribution(
result_type mean, result_type standard_deviation, result_type max_deviation)
: normal_(mean, standard_deviation), max_deviation_(max_deviation)
{
// Verify arguments.
if (standard_deviation < 0)
{
throw invalid_argument("standard_deviation");
}
if (max_deviation < 0)
{
throw invalid_argument("max_deviation");
}
}
} // namespace util
} // namespace seal