Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

示例程序编译失败 #12

Open
jiangjiaohao opened this issue Apr 6, 2024 · 0 comments
Open

示例程序编译失败 #12

jiangjiaohao opened this issue Apr 6, 2024 · 0 comments

Comments

@jiangjiaohao
Copy link

jiang@jiang-virtual-machine:~/hehub/examples$ g++ -Wall -g -o ckks ckks_example.cpp
In file included from ckks_example.cpp:1:
/usr/local/include/fhe/ckks/ckks.h: In function ‘hehub::ckks::CkksPt hehub::ckks::encode(hehub::cc_double, const hehub::ckks::CkksParams&)’:
/usr/local/include/fhe/ckks/ckks.h:124:17: error: missing template arguments before ‘datum_rep’
  124 |     std::vector datum_rep(pt_params.dimension / 2, datum);
      |                 ^~~~~~~~~
/usr/local/include/fhe/ckks/ckks.h:125:24: error: ‘datum_rep’ was not declared in this scope
  125 |     return simd_encode(datum_rep, pt_params);
      |                        ^~~~~~~~~
/usr/local/include/fhe/ckks/ckks.h: In function ‘hehub::ckks::CkksPt hehub::ckks::encode(double, const hehub::ckks::CkksParams&)’:
/usr/local/include/fhe/ckks/ckks.h:137:17: error: missing template arguments before ‘datum_rep’
  137 |     std::vector datum_rep(pt_params.dimension / 2, datum);
      |                 ^~~~~~~~~
/usr/local/include/fhe/ckks/ckks.h:138:24: error: ‘datum_rep’ was not declared in this scope
  138 |     return simd_encode(datum_rep, pt_params);
      |                        ^~~~~~~~~

变量初始化问题,vector似乎没法做到double类型和cc_double类型共同初始化一个vector

inline CkksPt encode(const cc_double datum, const CkksParams &pt_params) {
    std::vector datum_rep(pt_params.dimension / 2, datum);
    return simd_encode(datum_rep, pt_params);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant