refactor(compiler): Make function getV0Parameter return a pointer to a constant

The function `getV0Parameter()` returns a pointer to a static array,
which is not intended to be mutable. Reflect this in the return type
of the function.
This commit is contained in:
Andi Drebes
2021-09-16 15:27:52 +02:00
committed by Quentin Bourgerie
parent 6a76177a47
commit ddebedd1d6
2 changed files with 4 additions and 4 deletions

View File

@@ -7,8 +7,8 @@
namespace mlir {
namespace zamalang {
V0Parameter *getV0Parameter(V0FHEConstraint constraint);
const V0Parameter *getV0Parameter(V0FHEConstraint constraint);
} // namespace zamalang
} // namespace mlir
#endif
#endif

View File

@@ -12,7 +12,7 @@ using namespace std;
const int NORM2_MAX = 31;
const int P_MAX = 7;
V0Parameter parameters[NORM2_MAX][P_MAX] = {
const static V0Parameter parameters[NORM2_MAX][P_MAX] = {
{V0Parameter(1, 10, 514, 2, 8, 5, 2), V0Parameter(1, 10, 564, 2, 8, 5, 2),
V0Parameter(1, 10, 599, 3, 6, 6, 2), V0Parameter(1, 10, 686, 3, 6, 7, 2),
V0Parameter(1, 11, 736, 1, 23, 5, 3), V0Parameter(1, 12, 830, 1, 23, 4, 4),
@@ -139,7 +139,7 @@ V0Parameter parameters[NORM2_MAX][P_MAX] = {
V0Parameter(0, 0, 0, 0, 0, 0, 0), V0Parameter(0, 0, 0, 0, 0, 0, 0),
V0Parameter(0, 0, 0, 0, 0, 0, 0)}};
V0Parameter *getV0Parameter(V0FHEConstraint constraint) {
const V0Parameter *getV0Parameter(V0FHEConstraint constraint) {
if (constraint.norm2 > NORM2_MAX) {
return nullptr;
}