Skip to content

Commit 3ddb79d

Browse files
authored
Small type alias fix in matrix_with_ids.h (#259)
1 parent 913a73f commit 3ddb79d

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

src/benchmarks/setup.bash

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
# Two possible locations of TileDB-Vector-Search root -- edit as necessary
35-
tdb_vector_search_root_1="${HOME}/TileDB-Vector-Search"
35+
tdb_vector_search_root_1="${HOME}/TileDB/TileDB-Vector-Search"
3636
tdb_vector_search_root_2="${HOME}/TileDB/TileDB-Vector-Search"
3737

3838
# AWS information
@@ -44,10 +44,10 @@ elif [ -f ./awsrc.bash ]; then
4444
. ./awsrc.bash
4545
fi
4646

47-
ivf_flat_tail="src/cmake-build-release/libtiledbvectorsearch/src/ivf_flat"
47+
ivf_flat_tail="src/cmake-build-release/libtiledbvectorsearch/src/ivf/ivf_query"
4848
ivf_flat_1=${tdb_vector_search_root_1}/${ivf_flat_tail}
4949
ivf_flat_2=${tdb_vector_search_root_2}/${ivf_flat_tail}
50-
flat_l2_tail="src/cmake-build-release/libtiledbvectorsearch/src/flat_l2"
50+
flat_l2_tail="src/cmake-build-release/libtiledbvectorsearch/src/flat/flat_l2"
5151
flat_l2_1=${tdb_vector_search_root_1}/${flat_l2_tail}
5252
flat_l2_2=${tdb_vector_search_root_2}/${flat_l2_tail}
5353

@@ -58,7 +58,7 @@ elif [ -f "${ivf_flat_1}" ]; then
5858
elif [ -f "${ivf_flat_2}" ]; then
5959
ivf_query="${ivf_flat_2}"
6060
else
61-
echo "Neither ivf_flat executable file exists"
61+
echo "Neither ivf_flat executable file exists ${ivf_query} ${ivf_flat_1} ${ivf_flat_2}"
6262
fi
6363

6464
if [ -f flat_query ]; then
@@ -73,8 +73,8 @@ fi
7373

7474
nvme_root=/mnt/ssd
7575

76-
ec2_root="/home/lums/TileDB-Vector-Search/external/data/gp3"
77-
m1_root="/Users/lums/TileDB/TileDB-Vector-Search/external/data/gp3"
76+
ec2_root="/home/lums/TileDB/TileDB-Vector-Search/external/test_data/arrays"
77+
m1_root="/Users/lums/TileDB/TileDB-Vector-Search/external/test_data/arrays"
7878

7979
if [ -d "${gp3_root}" ]; then
8080
gp3_root=${gp3_root}
@@ -83,7 +83,7 @@ elif [ -d "${ec2_root}" ]; then
8383
elif [ -d "${m1_root}" ]; then
8484
gp3_root=${m1_root}
8585
else
86-
echo "gp3 directory does not exist"
86+
echo "gp3 directory ${gp3_root} does not exist -- ${ec2_root} -- ${m1_root}"
8787
fi
8888

8989
db_uri="not_set"
@@ -108,6 +108,7 @@ function init_1M_s3 () {
108108
}
109109

110110
function init_1M_gp3 () {
111+
group_uri="${gp3_root}/bigann1M/group""
111112
db_uri="${gp3_root}/1M/bigann1M_base"
112113
centroids_uri="${gp3_root}/1M/centroids.tdb"
113114
parts_uri="${gp3_root}/1M/parts.tdb"

src/include/detail/linalg/matrix_with_ids.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class MatrixWithIds : public Matrix<T, LayoutPolicy, I> {
6060

6161
public:
6262
using ids_type = IdsType;
63+
using size_type = typename Base::size_type;
6364

6465
MatrixWithIds() noexcept = default;
6566

@@ -74,17 +75,17 @@ class MatrixWithIds : public Matrix<T, LayoutPolicy, I> {
7475
virtual ~MatrixWithIds() = default;
7576

7677
MatrixWithIds(
77-
typename Base::size_type nrows,
78-
typename Base::size_type ncols,
78+
size_type nrows,
79+
size_type ncols,
7980
LayoutPolicy policy = LayoutPolicy()) noexcept
8081
requires(std::is_same_v<LayoutPolicy, stdx::layout_right>)
8182
: Base(nrows, ncols, policy)
8283
, ids_(this->num_rows_) {
8384
}
8485

8586
MatrixWithIds(
86-
typename Base::size_type nrows,
87-
typename Base::size_type ncols,
87+
size_type nrows,
88+
size_type ncols,
8889
LayoutPolicy policy = LayoutPolicy()) noexcept
8990
requires(std::is_same_v<LayoutPolicy, stdx::layout_left>)
9091
: Base(nrows, ncols, policy)
@@ -94,8 +95,8 @@ class MatrixWithIds : public Matrix<T, LayoutPolicy, I> {
9495
MatrixWithIds(
9596
std::unique_ptr<T[]>&& storage,
9697
std::vector<IdsType>&& ids,
97-
typename Base::size_type nrows,
98-
typename Base::size_type ncols,
98+
size_type nrows,
99+
size_type ncols,
99100
LayoutPolicy policy = LayoutPolicy()) noexcept
100101
: Base(std::move(storage), nrows, ncols, policy)
101102
, ids_{std::move(ids)} {

src/include/test/unit_vamana_index.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ TEST_CASE("vamana: diskann", "[vamana]") {
153153
}
154154
float sum = 0.0;
155155
for (size_t i = 0; i < centroid.size(); ++i) {
156-
sum += abs(centroid[i]);
156+
sum += std::abs(centroid[i]);
157157
centroid[i] /= (float)num_vectors(f);
158158
}
159159
CHECK(sum > 0);

0 commit comments

Comments
 (0)