Skip to content

Commit

Permalink
[delaunay-psm] Update to 1.7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
simogasp committed Sep 28, 2020
1 parent 1a8580f commit 38c3400
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1.3)

project(delaunay-psm LANGUAGES C CXX VERSION 1.7.5)
project(delaunay-psm LANGUAGES C CXX VERSION 1.7.6)

set(CMAKE_CXX_STANDARD 11)

Expand Down
37 changes: 24 additions & 13 deletions delaunay-psm/Delaunay_psm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,10 @@ namespace {
if(auto_create_args) {
CmdLine::declare_arg(argname, argval, "...");
} else {
Logger::warn("config") << argname << "=" << argval << " ignored" << std::endl;
Logger::warn("config") << argname
<< "=" << argval
<< " ignored"
<< std::endl;
}
}
}
Expand All @@ -2401,17 +2404,22 @@ namespace {

void parse_config_file(int argc, char** argv) {
geo_assert(argc >= 1);
std::string program_name = String::to_uppercase(FileSystem::base_name(argv[0]));
std::string program_name = String::to_uppercase(
FileSystem::base_name(argv[0])
);
static bool init = false;
if(init) {
return;
}
init = true;
Logger::out("config") << "Configuration file name:" << config_file_name
<< std::endl;
Logger::out("config") << "Home directory:" << FileSystem::home_directory()
<< std::endl;
std::string config_filename = FileSystem::home_directory() + "/" + config_file_name;
Logger::out("config")
<< "Configuration file name:" << config_file_name
<< std::endl;
Logger::out("config")
<< "Home directory:" << FileSystem::home_directory()
<< std::endl;
std::string config_filename =
FileSystem::home_directory() + "/" + config_file_name;
parse_config_file(config_filename, program_name);
}

Expand Down Expand Up @@ -2609,7 +2617,9 @@ namespace GEO {
return geo_argv;
}

void set_config_file_name(const std::string& filename, bool auto_create) {
void set_config_file_name(
const std::string& filename, bool auto_create
) {
config_file_name = filename;
auto_create_args = auto_create;
}
Expand Down Expand Up @@ -6577,10 +6587,11 @@ namespace {
geo_argused(max_threads);

#pragma omp parallel for schedule(dynamic)
for(index_t i = 0; i < threads.size(); i++) {
set_thread_id(threads[i],i);
set_current_thread(threads[i]);
threads[i]->run();
for(int i = 0; i < int(threads.size()); i++) {
index_t ii = index_t(i);
set_thread_id(threads[ii],ii);
set_current_thread(threads[ii]);
threads[ii]->run();
}
}

Expand Down Expand Up @@ -22274,7 +22285,7 @@ namespace GEO {

geo_register_Delaunay_creator(Delaunay2d, "BDEL2d");
geo_register_Delaunay_creator(RegularWeightedDelaunay2d, "BPOW2d");

#ifndef GEOGRAM_PSM
geo_register_Delaunay_creator(Delaunay_NearestNeighbors, "NN");
#endif
Expand Down
2 changes: 1 addition & 1 deletion delaunay-psm/Delaunay_psm.h
Original file line number Diff line number Diff line change
Expand Up @@ -4313,7 +4313,7 @@ namespace GEO {

inline double cos_angle(const vec3& a, const vec3& b) {
double lab = ::sqrt(length2(a)*length2(b));
double result = (lab > 1e-20) ? (dot(a, b) / lab) : 1.0;
double result = (lab > 1e-50) ? (dot(a, b) / lab) : 1.0;
// Numerical precision problem may occur, and generate
// normalized dot products that are outside the valid
// range of acos.
Expand Down
2 changes: 1 addition & 1 deletion example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ int main(int argc, char** argv) {
Stopwatch Wtot("Total time");

std::vector<std::string> filenames;

CmdLine::import_arg_group("standard");
CmdLine::import_arg_group("algo");

Expand Down

0 comments on commit 38c3400

Please sign in to comment.