template<>
struct params {
typedef uint16_t value_type;
typedef int16_t signed_value_type;
typedef uint32_t greater_value_type;
typedef value_type* poly_t;
// The moduli used in each 16 bit block (14 bits long each)
// They are of the form p = 2*14 - i2*kMaxPolyDegree + 1 for increasing i
static constexpr unsigned int kMaxNbModuli = 2;
static constexpr value_type P[kMaxNbModuli] = { 15361U, 13313U};//有问题
// The associated lower word of their Newton quotients
static constexpr value_type Pn[kMaxNbModuli] = { 17458U, 60470U};//有问题
static constexpr unsigned int kModulusBitsize = 14;
static constexpr unsigned int kModulusRepresentationBitsize = 16;
// A primitive 2*kMaxNbModuli (i.e., 2**10) root of unity for each one of the moduli
static constexpr value_type primitive_roots[kMaxNbModuli] = { 4989U, 10076U};//有问题
// Inverses of kMaxPolyDegree (for the other degrees it can be derived easily)
// for the different moduli
static constexpr value_type invkMaxPolyDegree[kMaxNbModuli] = { 15331U, 13287U};//有问题
// Polynomial related data
static constexpr unsigned int kMaxPolyDegree = 512;
};
vs2015编译时遇到问题:
(代码中标注//有问题的语句都是下面形式的error,我把代码改成 static constexpr int P[2] = { 1,1};也是这样的error)
error C4579: 'nfl::params::P': in-class initialization for type 'const nfl::params::value_type [2]' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported
error C2131: 表达式的计算结果不是常数
note: 遇到非常量(子)表达式