Skip to content

Commit

Permalink
linecircle in the build system
Browse files Browse the repository at this point in the history
  • Loading branch information
rfabbri committed Jun 16, 2024
1 parent fa482f8 commit 8eaa08a
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 5 deletions.
4 changes: 4 additions & 0 deletions cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 5 additions & 5 deletions cmd/minus-linecircle.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include <thread>
#include <minus/minus.h>
#include <minus/linecircle-io.h>
#include <minus/chicago-default.h>
#include <minus/linecircle-default.h>

using namespace MiNuS;
#define Float double
typedef minus_core<chicago> M;
typedef minus_core<linecircle> M;
static constexpr Float tol = 1e-3;
typedef std::complex<Float> complex;
using namespace std::chrono;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions minus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <minus/minus.hxx>
#include <minus/linecircle2a-default-data.hxx>

namespace MiNuS {

template class minus_core<linecircle2a, double>;
template struct minus_io_14a<linecircle2a, double>;
template struct minus_io<linecircle2a, double>;
template struct minus<linecircle2a, double>;
template struct minus_data<linecircle2a, double>;

}
16 changes: 16 additions & 0 deletions minus/problem-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,20 @@ struct minus <P, F> {
unsigned *nsols_final);
};
#undef P
#define P linecircle2a
template <typename F>
struct minus <P, F> {
typedef minus_core<P, F> M;
typedef minus_io<P, F> io;
typedef problem_parameters<P> pp;

static bool solve(
const C<F> 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_

0 comments on commit 8eaa08a

Please sign in to comment.