Skip to content

Commit 490191b

Browse files
committed
Minor fixes on macos
1 parent 478fcce commit 490191b

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ data/Dummy/dummy-groundtruth*.bin
99
*.bin
1010
.idea
1111
venv
12+
.DS_Store

include/distance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct EuclideanDistanceOrder {
4242
*
4343
* @return True if the first element is closer to the target vector than the second element.
4444
*/
45-
bool operator()(const base_t& a, const base_t& b);
45+
bool operator()(const base_t& a, const base_t& b) const;
4646

4747
};
4848

src/DataReaders/read_vectors.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ vector<DataVector<int>> ReadGroundTruth(const string& filename) {
7878
}
7979

8080
vector<DataVector<int>> dataVectors; // Vector to store DataVector objects
81-
int nb_vectors = 0;
8281

8382
while (file) {
8483
int d; // Dimensionality of the vector (first 4 bytes)
@@ -101,7 +100,6 @@ vector<DataVector<int>> ReadGroundTruth(const string& filename) {
101100

102101
// Add the DataVector object to the vector
103102
dataVectors.push_back(dataVector);
104-
nb_vectors++;
105103
}
106104

107105
file.close();

src/Geometry/distance_functions.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ using namespace std;
1515
*
1616
* @return True if the first element is closer to the target vector than the second element.
1717
*/
18-
template <typename base_t, typename query_t> bool EuclideanDistanceOrder<base_t, query_t>::operator()(const base_t& a, const base_t& b) {
18+
template <typename base_t, typename query_t>
19+
bool EuclideanDistanceOrder<base_t, query_t>::operator()(const base_t& a, const base_t& b) const {
1920

2021
double distanceA, distanceB;
2122

src/Graph/graph_node.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ template <typename node_t> void GraphNode<node_t>::removeNeighbor(node_t data) {
3838

3939
}
4040

41-
template class GraphNode<int>;
42-
template class GraphNode<double>;
43-
template class GraphNode<std::string>;
44-
45-
template class GraphNode<DataVector<float>>;
46-
template class GraphNode<DataVector<double>>;
47-
template class GraphNode<BaseDataVector<float>>;
48-
template class GraphNode<BaseDataVector<double>>;
41+
template struct GraphNode<int>;
42+
template struct GraphNode<double>;
43+
template struct GraphNode<std::string>;
44+
45+
template struct GraphNode<DataVector<float>>;
46+
template struct GraphNode<DataVector<double>>;
47+
template struct GraphNode<BaseDataVector<float>>;
48+
template struct GraphNode<BaseDataVector<double>>;
4949

src/VIA/Algorithms/GreedySearch.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ GreedySearch(const VamanaIndex<graph_t>& index, const GraphNode<graph_t>& s, con
7777

7878
// Calculate initial difference between candidates and visited sets
7979
std::set<graph_t> candidates_minus_visited = getSetDifference(candidates, visited);
80-
unsigned int cnt = 0;
8180
float p_star_distance = 0, currentDistance = 0;
8281

8382
// Main search loop: continue until there are no unvisited candidates
@@ -136,7 +135,6 @@ GreedySearch(const VamanaIndex<graph_t>& index, const GraphNode<graph_t>& s, con
136135

137136
// Update candidates_minus_visited with the new difference after adding p_star to visited
138137
candidates_minus_visited = getSetDifference(candidates, visited);
139-
cnt++; // Increment loop counter for diagnostics if needed
140138
}
141139

142140
// Final selection of k closest candidates after main loop

0 commit comments

Comments
 (0)