Skip to content
Snippets Groups Projects
Verified Commit 47df24dd authored by Herbers, Maik's avatar Herbers, Maik
Browse files

weil: Add command `DS-info'.

* src/weil.cpp (ds_info): New function.
parent 69496392
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,8 @@ print_help(bool error) ...@@ -26,6 +26,8 @@ print_help(bool error)
"\tweil [options] <command> [arguments]\n" "\tweil [options] <command> [arguments]\n"
"\n" "\n"
"Commands:\n" "Commands:\n"
" DS-info <file> output some information about the discriminant form associated\n"
" to the gram matrix in `file'\n"
" DS-c-kernel <file> <c> compute `D_c' where `D' is the discriminant form associated\n" " DS-c-kernel <file> <c> compute `D_c' where `D' is the discriminant form associated\n"
" to the gram matrix in `file'\n" " to the gram matrix in `file'\n"
" DS-c-image <file> <c> compute `D^c' where `D' is the discriminant form associated\n" " DS-c-image <file> <c> compute `D^c' where `D' is the discriminant form associated\n"
...@@ -470,6 +472,29 @@ transformation_matrix(int argc, const char** argv, weil::IOFormat style) ...@@ -470,6 +472,29 @@ transformation_matrix(int argc, const char** argv, weil::IOFormat style)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
int
ds_info(int argc, const char** argv, weil::IOFormat style)
{
// FIXME: merge with DS-get-orbits?
(void)style;
if (argc != 1) {
return print_help(true);
}
auto m{ read_square_mpz_matrix(argv[0]) };
if (!m) {
return EXIT_FAILURE;
}
weil::DiscriminantForm D{ *m };
std::cout << "cardinality: " << D.cardinality << "\n";
std::cout << "level: " << D.level() << "\n";
return EXIT_SUCCESS;
}
int int
main(int argc, const char** argv) main(int argc, const char** argv)
{ {
...@@ -523,6 +548,8 @@ main(int argc, const char** argv) ...@@ -523,6 +548,8 @@ main(int argc, const char** argv)
} }
}; };
check_option("DS-info", ds_info);
#define ds_c_action(action_type) \ #define ds_c_action(action_type) \
[]<typename... Ts>(Ts... args) { \ []<typename... Ts>(Ts... args) { \
return ds_c_action_common( \ return ds_c_action_common( \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment