10 template <
typename IndexType =
int,
typename ValueType =
float>
17 index_buffer_.clear();
18 value_buffer_.clear();
20 inline auto get_current_size() -> std::size_t {
return index_buffer_.size() + value_buffer_.size(); }
21 inline void add_entry(IndexType index, ValueType value)
23 index_buffer_.emplace_back(index);
24 value_buffer_.emplace_back(value);
29 auto get_values() ->
const auto& {
return value_buffer_; }
32 std::vector<IndexType> index_buffer_;
33 std::vector<ValueType> value_buffer_;
39 explicit Mille(std::string_view outFileName,
bool asBinary =
true,
bool writeZero =
false);
43 void special(
const std::vector<std::pair<int, float>>& special_data);
47 has_special_done_ =
false;
53 bool has_special_done_ =
false;
54 bool is_binary_ =
true;
55 bool is_zero_written_ =
false;
58 static constexpr unsigned int max_label_size_ = (0xFFFFFFFF - (1U << 31U));
59 std::ofstream output_file_;
61 void check_buffer_size(std::size_t nLocal, std::size_t nGlobal);
62 void write_to_binary();
63 void write_to_non_binary();
void add_entry(IndexType index, ValueType value)
auto get_indices() -> const auto &
auto get_current_size() -> std::size_t
auto get_values() -> const auto &
void mille(const MilleDataPoint &data_point)
Mille(std::string_view outFileName, bool asBinary=true, bool writeZero=false)
void set_buffer_size(std::size_t buffer_size)
void special(const std::vector< std::pair< int, float > > &special_data)
constexpr auto DEFAULT_BUFFER_SIZE