Skip to content

Commit 38c3400

Browse files
committed
[delaunay-psm] Update to 1.7.6
1 parent 1a8580f commit 38c3400

File tree

4 files changed

+27
-16
lines changed

4 files changed

+27
-16
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.1.3)
22

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

55
set(CMAKE_CXX_STANDARD 11)
66

delaunay-psm/Delaunay_psm.cpp

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,10 @@ namespace {
23892389
if(auto_create_args) {
23902390
CmdLine::declare_arg(argname, argval, "...");
23912391
} else {
2392-
Logger::warn("config") << argname << "=" << argval << " ignored" << std::endl;
2392+
Logger::warn("config") << argname
2393+
<< "=" << argval
2394+
<< " ignored"
2395+
<< std::endl;
23932396
}
23942397
}
23952398
}
@@ -2401,17 +2404,22 @@ namespace {
24012404

24022405
void parse_config_file(int argc, char** argv) {
24032406
geo_assert(argc >= 1);
2404-
std::string program_name = String::to_uppercase(FileSystem::base_name(argv[0]));
2407+
std::string program_name = String::to_uppercase(
2408+
FileSystem::base_name(argv[0])
2409+
);
24052410
static bool init = false;
24062411
if(init) {
24072412
return;
24082413
}
24092414
init = true;
2410-
Logger::out("config") << "Configuration file name:" << config_file_name
2411-
<< std::endl;
2412-
Logger::out("config") << "Home directory:" << FileSystem::home_directory()
2413-
<< std::endl;
2414-
std::string config_filename = FileSystem::home_directory() + "/" + config_file_name;
2415+
Logger::out("config")
2416+
<< "Configuration file name:" << config_file_name
2417+
<< std::endl;
2418+
Logger::out("config")
2419+
<< "Home directory:" << FileSystem::home_directory()
2420+
<< std::endl;
2421+
std::string config_filename =
2422+
FileSystem::home_directory() + "/" + config_file_name;
24152423
parse_config_file(config_filename, program_name);
24162424
}
24172425

@@ -2609,7 +2617,9 @@ namespace GEO {
26092617
return geo_argv;
26102618
}
26112619

2612-
void set_config_file_name(const std::string& filename, bool auto_create) {
2620+
void set_config_file_name(
2621+
const std::string& filename, bool auto_create
2622+
) {
26132623
config_file_name = filename;
26142624
auto_create_args = auto_create;
26152625
}
@@ -6577,10 +6587,11 @@ namespace {
65776587
geo_argused(max_threads);
65786588

65796589
#pragma omp parallel for schedule(dynamic)
6580-
for(index_t i = 0; i < threads.size(); i++) {
6581-
set_thread_id(threads[i],i);
6582-
set_current_thread(threads[i]);
6583-
threads[i]->run();
6590+
for(int i = 0; i < int(threads.size()); i++) {
6591+
index_t ii = index_t(i);
6592+
set_thread_id(threads[ii],ii);
6593+
set_current_thread(threads[ii]);
6594+
threads[ii]->run();
65846595
}
65856596
}
65866597

@@ -22274,7 +22285,7 @@ namespace GEO {
2227422285

2227522286
geo_register_Delaunay_creator(Delaunay2d, "BDEL2d");
2227622287
geo_register_Delaunay_creator(RegularWeightedDelaunay2d, "BPOW2d");
22277-
22288+
2227822289
#ifndef GEOGRAM_PSM
2227922290
geo_register_Delaunay_creator(Delaunay_NearestNeighbors, "NN");
2228022291
#endif

delaunay-psm/Delaunay_psm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4313,7 +4313,7 @@ namespace GEO {
43134313

43144314
inline double cos_angle(const vec3& a, const vec3& b) {
43154315
double lab = ::sqrt(length2(a)*length2(b));
4316-
double result = (lab > 1e-20) ? (dot(a, b) / lab) : 1.0;
4316+
double result = (lab > 1e-50) ? (dot(a, b) / lab) : 1.0;
43174317
// Numerical precision problem may occur, and generate
43184318
// normalized dot products that are outside the valid
43194319
// range of acos.

example/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ int main(int argc, char** argv) {
252252
Stopwatch Wtot("Total time");
253253

254254
std::vector<std::string> filenames;
255-
255+
256256
CmdLine::import_arg_group("standard");
257257
CmdLine::import_arg_group("algo");
258258

0 commit comments

Comments
 (0)