From 8eaa08aeae638f459003683ec7e2c6308a34eec1 Mon Sep 17 00:00:00 2001 From: Ricardo Fabbri Date: Sun, 16 Jun 2024 05:35:20 -0700 Subject: [PATCH] linecircle in the build system --- cmd/CMakeLists.txt | 4 ++++ cmd/minus-linecircle.cxx | 10 +++++----- minus/CMakeLists.txt | 4 ++++ ...necircle-alltypes-allformulations+double.cxx | 17 +++++++++++++++++ minus/problem-defs.h | 16 ++++++++++++++++ 5 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 minus/Templates/minus-linecircle-alltypes-allformulations+double.cxx diff --git a/cmd/CMakeLists.txt b/cmd/CMakeLists.txt index bd9d846..7c9d3ff 100644 --- a/cmd/CMakeLists.txt +++ b/cmd/CMakeLists.txt @@ -1,8 +1,12 @@ # minus/cmd/CMakeLists.txt find_package(Threads REQUIRED) link_libraries(minus) + add_executable(minus-chicago minus-chicago.cxx) target_link_libraries(minus-chicago Threads::Threads) +add_executable(minus-linecircle minus-linecircle.cxx) +target_link_libraries(minus-linecircle Threads::Threads) + # add_executable(minus-cleveland minus-cleveland.cxx) # target_link_libraries(minus-cleveland Threads::Threads) diff --git a/cmd/minus-linecircle.cxx b/cmd/minus-linecircle.cxx index a23c6fd..f35f183 100644 --- a/cmd/minus-linecircle.cxx +++ b/cmd/minus-linecircle.cxx @@ -10,11 +10,11 @@ #include #include #include -#include +#include using namespace MiNuS; #define Float double -typedef minus_core M; +typedef minus_core M; static constexpr Float tol = 1e-3; typedef std::complex complex; using namespace std::chrono; @@ -138,7 +138,7 @@ print_usage() id0 id1 # id \in {0,1,2} of the point to consider the tangent # One way to use this is - # synthdata | minus-chicago -i + # synthdata | minus-linecircle -i # where synthdata is provided in minus/scripts)"; exit(1); @@ -301,7 +301,7 @@ iread(std::istream &in) } // reads into the global variable params_ -// Format is just like P01 variable in solveChicago in chicago.m2 +// Format is just like P01 variable in solvelinecircle in linecircle.m2 // and contains the concatenated parameters of the start system // and of the target system, with some randomization to improve conditioning. // But here there is no imaginary 'i' string: @@ -473,7 +473,7 @@ process_args(int argc, char **argv) } } -// Simplest possible command to compute the Chicago problem +// Simplest possible command to compute the linecircle problem // for estimating calibrated trifocal geometry from points and lines at points // // This is to be kept very simple C with only minimal C++ with Templates. diff --git a/minus/CMakeLists.txt b/minus/CMakeLists.txt index 82b1c3c..aab99c8 100644 --- a/minus/CMakeLists.txt +++ b/minus/CMakeLists.txt @@ -6,6 +6,10 @@ set(minus_sources # chicago14a.h chicago-default.h chicago14a-default-data.h chicago14a-io.h chicago14a.hxx chicago14a-default-data.hxx + + linecircle2a.h linecircle-default.h linecircle2a-default-data.h linecircle2a-io.h + linecircle2a.hxx linecircle2a-default-data.hxx + # # Work in progress: builds but needs more testing for production # cleveland14a.h cleveland-default.h cleveland14a-default-data.h cleveland14a-io.h diff --git a/minus/Templates/minus-linecircle-alltypes-allformulations+double.cxx b/minus/Templates/minus-linecircle-alltypes-allformulations+double.cxx new file mode 100644 index 0000000..b9c83b2 --- /dev/null +++ b/minus/Templates/minus-linecircle-alltypes-allformulations+double.cxx @@ -0,0 +1,17 @@ +// Helps instantiate and reuse code, +// when including the .hxx directly causes inefficiencies and slowdown +// +// \author Ricardo Fabbri +// \date Created: Fri Feb 8 17:42:49 EST 2019 +#include +#include + +namespace MiNuS { + +template class minus_core; +template struct minus_io_14a; +template struct minus_io; +template struct minus; +template struct minus_data; + +} diff --git a/minus/problem-defs.h b/minus/problem-defs.h index 1bf0956..7b2c77b 100644 --- a/minus/problem-defs.h +++ b/minus/problem-defs.h @@ -56,4 +56,20 @@ struct minus { unsigned *nsols_final); }; #undef P +#define P linecircle2a +template +struct minus { + typedef minus_core M; + typedef minus_io io; + typedef problem_parameters

pp; + + static bool solve( + const C params_final, // p1 in linecircle2a-end.m2 + F solutions[M::nsols], // first camera is always [I | 0] + unsigned id_sols[M::nsols], + unsigned *nsols_final, + unsigned nthreads + ); +}; +#undef P #endif // problem_defs_h_