Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ option(BUILD_DOC "Build documentation" ON)
option(BUILD_WITH_MARCH_NATIVE "Build with flag march=native" OFF)
option(ENABLE_MKL "Try to use Eigen with MKL" OFF)
option(ENABLE_DIAGNOSTIC_PRINT "Enable printing of diagnostic messages" ON)
option(TEASERPP_USE_EXTERNAL_TINPLY "Use an external tinyply library instead of the internal one." OFF)

if (ENABLE_DIAGNOSTIC_PRINT)
message(STATUS "Enable printing of diagnostic messages.")
Expand Down
15 changes: 0 additions & 15 deletions cmake/pybind11.CMakeLists.txt.in

This file was deleted.

16 changes: 9 additions & 7 deletions teaser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ if (NOT pmc_POPULATED)
add_subdirectory(${pmc_SOURCE_DIR} ${pmc_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

FetchContent_Declare(tinyply
GIT_REPOSITORY https://github.com/ddiakopoulos/tinyply.git
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
if (NOT tinyply_POPULATED)
FetchContent_Populate(tinyply)
if(NOT TEASERPP_USE_EXTERNAL_TINPLY)
FetchContent_Declare(tinyply
GIT_REPOSITORY https://github.com/ddiakopoulos/tinyply.git
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
if (NOT tinyply_POPULATED)
FetchContent_Populate(tinyply)
endif()
endif()

FetchContent_Declare(spectra
Expand Down
1 change: 0 additions & 1 deletion teaser/include/teaser/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class Graph {
adj_list_.resize(adj_list.size());
num_edges_ = 0;
for (const auto& e_list : adj_list) {
const auto& v = e_list.first;
adj_list_[e_list.first] = e_list.second;
num_edges_ += e_list.second.size();
}
Expand Down
4 changes: 2 additions & 2 deletions teaser/src/graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ std::vector<int> teaser::MaxCliqueSolver::findMaxClique(teaser::Graph graph) {
in.heu_strat = "kcore";
in.vertex_search_order = "deg";

// vector to represent max clique
// std::vector to represent max clique
std::vector<int> C;

// upper-bound of max clique
Expand All @@ -69,7 +69,7 @@ std::vector<int> teaser::MaxCliqueSolver::findMaxClique(teaser::Graph graph) {
static_cast<double>(all_vertices.size()))) {
TEASER_DEBUG_INFO_MSG("Using K-core heuristic finder.");
// remove all nodes with core number less than max core number
// k_cores is a vector saving the core number of each vertex
// k_cores is a std::vector saving the core number of each vertex
auto k_cores = G.get_kcores();
for (int i = 1; i < k_cores->size(); ++i) {
// Note: k_core has size equals to num vertices + 1
Expand Down
11 changes: 5 additions & 6 deletions test/teaser/graph-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
*/

#include "gtest/gtest.h"
#include "gmock/gmock.h"

#include <iostream>
#include <map>

#include "pmc/pmc.h"
#include "pmc/pmc_bool_vector.h"
#include "pmc/pmc_input.h"
#include "teaser/graph.h"
#include "test_utils.h"

/**
* A helper function to generate mock input for testing PMC code
Expand Down Expand Up @@ -47,11 +46,11 @@ pmc::input generateMockInput() {
* @param adj a bool** to the adjcency matrix
* @param nodes number of nodes in the graph
*/
void printAdjMatirx(const std::vector<std::vector<pmc::bool_wrapper>>& adj, int nodes) {
void printAdjMatirx(const std::vector<pmc::bool_vector>& adj, int nodes) {
std::cout << "Adjacency matrix: " << std::endl;
for (auto& i : adj) {
for (auto j : i) {
std::cout << j << " ";
for (const auto& row : adj) {
for (std::size_t i = 0; i < row.size(); ++i) {
std::cout << row[i] << " ";
}
std::cout << std::endl;
}
Expand Down
9 changes: 4 additions & 5 deletions test/teaser/registration-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ TEST(RegistrationTest, SolveForRotation) {
params.rotation_gnc_factor = 1.4;
params.rotation_estimation_algorithm =
teaser::RobustRegistrationSolver::ROTATION_ESTIMATION_ALGORITHM::QUATRO;
params.inlier_selection_mode ==
params.inlier_selection_mode =
teaser::RobustRegistrationSolver::INLIER_SELECTION_MODE::PMC_HEU;
params.rotation_cost_threshold = 0.005;

Expand Down Expand Up @@ -454,13 +454,12 @@ TEST(RegistrationTest, OutlierDetection) {

auto solution = solver.getSolution();
EXPECT_LE(teaser::test::getAngularError(T.topLeftCorner(3, 3), solution.rotation), 0.2);
EXPECT_LE((T.topRightCorner(3, 1) - solution.translation).norm(), 0.1);
EXPECT_LE((T.topRightCorner(3, 1) - solution.translation).squaredNorm(), 0.01);

auto final_inliers = solver.getInlierMaxClique();

EXPECT_EQ(expected_inliers.size(), final_inliers.size());
std::sort(expected_inliers.begin(), expected_inliers.end());
std::sort(final_inliers.begin(), final_inliers.end());

ASSERT_EQ(expected_inliers.size(), final_inliers.size());
for (size_t i = 0; i < expected_inliers.size(); ++i) {
EXPECT_EQ(expected_inliers[i], final_inliers[i]);
}
Expand Down