Skip to content

Commit

Permalink
fix minor bugs of QG and QBG
Browse files Browse the repository at this point in the history
  • Loading branch information
masajiro committed Dec 15, 2022
1 parent 2e7a78c commit a95c4b5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ if(${UNIX})
set(BASE_OPTIONS "${BASE_OPTIONS} -fopenmp")
endif()

if(${NGT_ASSERT_DISABLED})
message(STATUS "assert() is disabled.")
set(BASE_OPTIONS "${BASE_OPTIONS} -DNDEBUG")
endif()

set(CMAKE_CXX_FLAGS_DEBUG "-g ${BASE_OPTIONS}")

if(${NGT_MARCH_NATIVE_DISABLED})
Expand Down
4 changes: 2 additions & 2 deletions lib/NGT/Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,15 @@ namespace NGT {
case NeighborhoodGraph::GraphTypeBKNNG: p.set("GraphType", "BKNNG"); break;
case NeighborhoodGraph::GraphTypeONNG: p.set("GraphType", "ONNG"); break;
case NeighborhoodGraph::GraphTypeIANNG: p.set("GraphType", "IANNG"); break;
default: std::cerr << "Graph::exportProperty: Fatal error! Invalid Graph Type." << std::endl; abort();
default: std::cerr << "Graph::exportProperty: Fatal error! Invalid Graph Type. " << graphType << std::endl; abort();
}
switch (seedType) {
case NeighborhoodGraph::SeedTypeRandomNodes: p.set("SeedType", "RandomNodes"); break;
case NeighborhoodGraph::SeedTypeFixedNodes: p.set("SeedType", "FixedNodes"); break;
case NeighborhoodGraph::SeedTypeFirstNode: p.set("SeedType", "FirstNode"); break;
case NeighborhoodGraph::SeedTypeNone: p.set("SeedType", "None"); break;
case NeighborhoodGraph::SeedTypeAllLeafNodes: p.set("SeedType", "AllLeafNodes"); break;
default: std::cerr << "Graph::exportProperty: Fatal error! Invalid Seed Type." << std::endl; abort();
default: std::cerr << "Graph::exportProperty: Fatal error! Invalid Seed Type. " << seedType << std::endl; abort();
}
}
void importProperty(NGT::PropertySet &p) {
Expand Down
8 changes: 2 additions & 6 deletions lib/NGT/NGTQ/QuantizedBlobGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ namespace QBG {
creation.globalEdgeSizeForSearch = 40;
creation.globalIndexType = NGT::Property::GraphAndTree;
creation.globalInsertionRadiusCoefficient = 1.1;
creation.globalGraphType = NGT::NeighborhoodGraph::GraphTypeANNG;
creation.localIndexType = NGT::Property::GraphAndTree;
creation.localInsertionRadiusCoefficient = 1.1;
creation.localGraphType = NGT::NeighborhoodGraph::GraphTypeANNG;
hierarchicalClustering.maxSize = 1000;
hierarchicalClustering.numOfObjects = 0;
hierarchicalClustering.numOfClusters = 2;
Expand Down Expand Up @@ -336,9 +338,6 @@ namespace QBG {
buildParameters.setProperties(property, globalProperty, localProperty);
property.quantizerType = NGTQ::QuantizerTypeQBG;
NGTQ::Index::create(index, property, globalProperty, localProperty, rotation, objectFile);
try {
NGT::Index::mkdir(index + getWorkspaceName());
} catch(...) {}
}
#endif

Expand All @@ -354,9 +353,6 @@ namespace QBG {
property.quantizerType = NGTQ::QuantizerTypeQBG;
#ifdef NGTQ_QBG
NGTQ::Index::create(index, property, globalProperty, localProperty, rotation, objectFile);
try {
NGT::Index::mkdir(index + getWorkspaceName());
} catch(...) {}
#else
NGTQ::Index::create(index, property, globalProperty, localProperty);
#endif
Expand Down
1 change: 0 additions & 1 deletion lib/NGT/NGTQ/Quantizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3643,7 +3643,6 @@ class QuantizerInstance : public Quantizer {
lp.treeSharedMemorySize = 128; // MB
lp.objectSharedMemorySize = 128; // MB 128 is for up to 5M objects?
#endif

gp.set(globalProperty);
lp.set(localProperty);

Expand Down

0 comments on commit a95c4b5

Please sign in to comment.