Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
g-arakelov committed Dec 3, 2024
1 parent fae0687 commit 068b76f
Show file tree
Hide file tree
Showing 20 changed files with 1,549 additions and 1,513 deletions.
33 changes: 33 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# Manual run to reformat a file "foo.cpp": clang-format -i --style=file foo.cpp
#######################################################################
BasedOnStyle: Google
#######################################################################
Language: Cpp
# DisableFormat: true
AccessModifierOffset: -4
# AlignArrayOfStructures: Right (enable this if clang-format-13 or newer is installed)
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: true
#AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
BreakBeforeBraces: Custom
BraceWrapping:
BeforeCatch: true
BeforeElse: true
BreakBeforeTernaryOperators: false
BreakStringLiterals: false
ColumnLimit: 120
DerivePointerAlignment: false
#EmptyLineBeforeAccessModifier: true (enable this if clang-format-13 or newer is installed)
IndentPPDirectives: BeforeHash
IndentWidth: 4
PointerAlignment: Left
ReflowComments: false
SortIncludes: false
UseTab: Never
8 changes: 4 additions & 4 deletions examples/cifar10/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ minimim required CKKS params
"level_budget": [0,0]
}
*/
int main(int argc, char *argv[]) try {
int main(int argc, char* argv[]) try {
polycircuit::ckks::Cifar10 cifar10Evaluator;

cifar10Evaluator.GenerateCryptoContext();
cifar10Evaluator.KeyGen();

std::ifstream ifs(
"/Users/gg/projects/fairmath/polycircuit_new/examples/"
"Cifar10/images/class1.txt");
"/Users/gg/projects/fairmath/polycircuit_new/examples/"
"Cifar10/images/class1.txt");
if (!ifs.is_open()) {
throw std::runtime_error("Unable to read input file.");
}
Expand Down Expand Up @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) try {
return EXIT_SUCCESS;
}

catch (const std::exception &ex) {
catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;
return EXIT_FAILURE;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/logreg/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ minimim required CKKS params
"level_budget": [0,0]
}
*/
int main(int argc, char *argv[]) try { return EXIT_SUCCESS; }
int main(int argc, char* argv[]) try { return EXIT_SUCCESS; }

catch (const std::exception &ex) {
catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;
return EXIT_FAILURE;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/lut/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ minimim required CKKS params
"level_budget": [0,0]
}
*/
int main(int argc, char *argv[]) try { return EXIT_SUCCESS; }
int main(int argc, char* argv[]) try { return EXIT_SUCCESS; }

catch (const std::exception &ex) {
catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;
return EXIT_FAILURE;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/matrix_mul/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ minimim required CKKS params
"level_budget": [0,0]
}
*/
int main(int argc, char *argv[]) try { return EXIT_SUCCESS; }
int main(int argc, char* argv[]) try { return EXIT_SUCCESS; }

catch (const std::exception &ex) {
catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;
return EXIT_FAILURE;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/max/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ minimim required CKKS params
"level_budget": [0,0]
}
*/
int main(int argc, char *argv[]) try { return EXIT_SUCCESS; }
int main(int argc, char* argv[]) try { return EXIT_SUCCESS; }

catch (const std::exception &ex) {
catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;
return EXIT_FAILURE;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/parity/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ minimim required CKKS params
"level_budget": [0,0]
}
*/
int main(int argc, char *argv[]) try { return EXIT_SUCCESS; }
int main(int argc, char* argv[]) try { return EXIT_SUCCESS; }

catch (const std::exception &ex) {
catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;
return EXIT_FAILURE;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/shl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ minimim required CKKS params
"level_budget": [0,0]
}
*/
int main(int argc, char *argv[]) try { return EXIT_SUCCESS; }
int main(int argc, char* argv[]) try { return EXIT_SUCCESS; }

catch (const std::exception &ex) {
catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;
return EXIT_FAILURE;
}
Expand Down
Loading

0 comments on commit 068b76f

Please sign in to comment.