Skip to content

Commit 42b9108

Browse files
committed
Merge branch 'master' into libpqxx8
2 parents 85e75c6 + 29fe7f1 commit 42b9108

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

include/pgvector/halfvec.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class HalfVector {
3636
}
3737

3838
/// Creates a half vector from an array.
39+
// TODO remove in 0.3.0
3940
HalfVector(const float* value, size_t n) {
4041
value_ = std::vector<float>{value, value + n};
4142
}

include/pgvector/pqxx.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ template <> struct string_traits<pgvector::Vector> {
3131
throw conversion_error("Malformed vector literal");
3232
}
3333

34-
// TODO don't copy string
3534
std::vector<float> result;
35+
// TODO support empty array
36+
// TODO don't copy string
3637
std::istringstream ss(std::string(text.substr(1, text.size() - 2)));
3738
while (ss.good()) {
3839
std::string substr;
3940
std::getline(ss, substr, ',');
41+
// TODO use pqxx::from_string<float>
4042
result.push_back(std::stof(substr));
4143
}
4244
return pgvector::Vector(result);
@@ -66,12 +68,14 @@ template <> struct string_traits<pgvector::HalfVector> {
6668
throw conversion_error("Malformed halfvec literal");
6769
}
6870

69-
// TODO don't copy string
7071
std::vector<float> result;
72+
// TODO support empty array
73+
// TODO don't copy string
7174
std::istringstream ss(std::string(text.substr(1, text.size() - 2)));
7275
while (ss.good()) {
7376
std::string substr;
7477
std::getline(ss, substr, ',');
78+
// TODO use pqxx::from_string<float>
7579
result.push_back(std::stof(substr));
7680
}
7781
return pgvector::HalfVector(result);

include/pgvector/vector.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Vector {
3636
}
3737

3838
/// Creates a vector from an array.
39+
// TODO remove in 0.3.0
3940
Vector(const float* value, size_t n) {
4041
value_ = std::vector<float>{value, value + n};
4142
}

0 commit comments

Comments
 (0)