tfhe_libex
mux.hpp
[詳解]
1 
5 #ifndef MUX
6 #define MUX
7 
8 #include "../../../type/core/bool_core.hpp"
9 
17 template <typename Type>
18 Type mux(TFHEBoolCore condition, Type true_value, Type false_value) {
19  Type true_result;
20  printf("debug -1\n");
21  std::thread tv([&true_result, &true_value, &condition]() {
22  true_result = true_value * condition;
23  });
24  tv.join();
25  printf("debug 0\n");
26  Type false_result = false_value * !condition;
27  printf("debug 1\n");
28 
29  return true_result + false_result;
30 };
31 
32 #endif
TFHEBoolCore
TFHEのBool型のcoreクラス.
Definition: bool_core.hpp:14
mux
Type mux(TFHEBoolCore condition, Type true_value, Type false_value)
条件式conditionに応じて、真式true_valueか偽式false_valueを返す関数.
Definition: mux.hpp:18