112 void setVector(
const std::vector<double>& vec);
129 void initialize(
const std::vector<double>& vec,
int hashPrecision);
137 void initialize(
const std::vector<double>& vec);
197 void setupVecs(
const std::vector<double>& vec,
int hashPrecision);
220 size_t hashValue = vec.
hash();
Definition indexVector.h:38
friend std::ostream & operator<<(std::ostream &os, const FloatIndexVector &vec)
Overloads the << operator for ostream to print FloatIndexVector.
Definition indexVector.cpp:237
void setupVecs(const std::vector< double > &vec, int hashPrecision)
Sets up the internal representations of the vector and precision.
Definition indexVector.cpp:58
FloatIndexVector & operator=(const FloatIndexVector &other)
Copy assignment operator.
Definition indexVector.cpp:104
int getHashPrecision() const
Gets the current hash precision.
Definition indexVector.cpp:157
std::vector< double > m_vector
The vector of floating-point values.
Definition indexVector.h:199
void setVector(const std::vector< double > &vec)
Sets the vector of floating-point values.
Definition indexVector.cpp:197
size_t hash() const
Computes the hash of the vector.
Definition indexVector.cpp:210
std::vector< uint64_t > m_vectorInt
Internal representation of the vector for hashing, storing scaled integer values.
Definition indexVector.h:200
bool operator!=(const FloatIndexVector &other) const
Inequality operator.
Definition indexVector.cpp:136
void reserve(size_t size)
Reserves memory for the vector and its internal representation.
Definition indexVector.h:150
bool operator==(const FloatIndexVector &other) const
Equality operator.
Definition indexVector.cpp:116
void setHashPrecision(int hashPrecision)
Sets the hash precision.
Definition indexVector.cpp:142
int size() const
Get the size of the index vector.
Definition indexVector.cpp:220
void initialize(const std::vector< double > &vec, int hashPrecision)
Initializes the vector with precision.
Definition indexVector.cpp:166
bool m_initialized
Flag indicating whether the vector and precision have been initialized.
Definition indexVector.h:202
std::vector< double > getVector() const
Gets the current vector of floating-point values.
Definition indexVector.cpp:188
int m_hashPrescision
The precision (number of decimal places) used for rounding and hashing.
Definition indexVector.h:201
FloatIndexVector()
Default constructor.
Definition indexVector.cpp:40
double operator[](const size_t index) const
Access element at a specific index.
Definition indexVector.cpp:227
Specialization of std::hash for FloatIndexVector.
size_t operator()(const FloatIndexVector &vec) const
Computes the hash of a FloatIndexVector.
Definition indexVector.h:219