Skip to content

Commit

Permalink
fix uninitialized parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
masajiro committed Jan 6, 2023
1 parent b54d97b commit edcc94d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.8
2.0.9
11 changes: 6 additions & 5 deletions lib/NGT/Clustering.h
Original file line number Diff line number Diff line change
Expand Up @@ -954,8 +954,9 @@ namespace NGT {
break;
}
default:
std::cerr << "proper initMode is not specified." << std::endl;
exit(1);
std::stringstream msg;
msg << " kmeans: invalid initialization mode. " << initializationMode;
NGTThrowException(msg);
}
}
}
Expand Down Expand Up @@ -990,9 +991,9 @@ namespace NGT {
break;
#endif
default:
cerr << "kmeans::fatal error!. invalid clustering type. " << clusteringType << endl;
abort();
break;
std::stringstream msg;
msg << " kmeans: invalid clustering type. " << clusteringType;
NGTThrowException(msg);
}
}

Expand Down
4 changes: 4 additions & 0 deletions lib/NGT/NGTQ/QuantizedBlobGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace QBG {
creation.localIndexType = NGT::Property::GraphAndTree;
creation.localInsertionRadiusCoefficient = 1.1;
creation.localGraphType = NGT::NeighborhoodGraph::GraphTypeANNG;

hierarchicalClustering.maxSize = 1000;
hierarchicalClustering.numOfObjects = 0;
hierarchicalClustering.numOfClusters = 2;
Expand All @@ -75,6 +76,8 @@ namespace QBG {
hierarchicalClustering.extractCentroid = false;
hierarchicalClustering.threeLayerClustering = true;

optimization.clusteringType = NGT::Clustering::ClusteringTypeKmeansWithoutNGT;
optimization.initMode = NGT::Clustering::InitializationModeHead;
optimization.timelimit = 24 * 1 * 60.0 * 60.0;
optimization.iteration = 100;
optimization.clusterIteration = 100;
Expand All @@ -92,6 +95,7 @@ namespace QBG {
optimization.rotation = true;
optimization.globalType = QBG::Optimizer::GlobalTypeNone;
optimization.randomizedObjectExtraction = true;
optimization.showClusterInfo = false;
}

void setProperties(NGTQ::Property &property, NGT::Property &globalProperty,
Expand Down

0 comments on commit edcc94d

Please sign in to comment.