poet/include/poet/DataStructures.hpp
Max Luebke 0c2597d97f feat: introduce LookupKey and rounding schemes
feat: implement data clustering using PHT

feat: implement interpolation

refactor: use named vector for DHT species definition and significant digits

data: remove unusable input scripts

data: move Phreeqc database to benchmark dir

refactor: rename dolomite benchmark directory

refactor: remove DHT prop type from input script
2023-08-01 18:34:50 +02:00

36 lines
886 B
C++

#ifndef DATASTRUCTURES_H_
#define DATASTRUCTURES_H_
#include <cstddef>
#include <string>
#include <utility>
#include <vector>
namespace poet {
template <typename value_type> class NamedVector {
public:
void insert(std::pair<std::string, value_type> to_insert) {
this->names.push_back(to_insert.first);
this->values.push_back(to_insert.second);
container_size++;
}
bool empty() const { return this->container_size == 0; }
std::size_t size() const { return this->container_size; }
value_type &operator[](std::size_t i) { return values[i]; }
const std::vector<std::string> &getNames() const { return this->names; }
const std::vector<value_type> &getValues() const { return this->values; }
private:
std::size_t container_size{0};
std::vector<std::string> names{};
std::vector<value_type> values{};
};
} // namespace poet
#endif // DATASTRUCTURES_H_