OpenLB 1.7
Loading...
Searching...
No Matches
Functions
Load/save auxiliary functions
+ Collaboration diagram for Load/save auxiliary functions:

Functions

template<typename T >
void nanoflann::save_value (FILE *stream, const T &value, size_t count=1)
 
template<typename T >
void nanoflann::save_value (FILE *stream, const std::vector< T > &value)
 
template<typename T >
void nanoflann::load_value (FILE *stream, T &value, size_t count=1)
 
template<typename T >
void nanoflann::load_value (FILE *stream, std::vector< T > &value)
 

Detailed Description

Function Documentation

◆ load_value() [1/2]

template<typename T >
void nanoflann::load_value ( FILE * stream,
std::vector< T > & value )

Definition at line 283 of file nanoflann.hpp.

283 {
284 size_t size;
285 size_t read_cnt = fread(&size, sizeof(size_t), 1, stream);
286 if (read_cnt != 1) {
287 throw std::runtime_error("Cannot read from file");
288 }
289 value.resize(size);
290 read_cnt = fread(&value[0], sizeof(T), size, stream);
291 if (read_cnt != size) {
292 throw std::runtime_error("Cannot read from file");
293 }
294}
typename std::integral_constant< TYPE, VALUE >::type value
Identity type to wrap non-type template arguments.
Definition meta.h:96

References nanoflann::KNNResultSet< DistanceType, IndexType, CountType >::size().

+ Here is the call graph for this function:

◆ load_value() [2/2]

template<typename T >
void nanoflann::load_value ( FILE * stream,
T & value,
size_t count = 1 )

Definition at line 275 of file nanoflann.hpp.

275 {
276 size_t read_cnt = fread(&value, sizeof(value), count, stream);
277 if (read_cnt != count) {
278 throw std::runtime_error("Cannot read from file");
279 }
280}
+ Here is the caller graph for this function:

◆ save_value() [1/2]

template<typename T >
void nanoflann::save_value ( FILE * stream,
const std::vector< T > & value )

Definition at line 268 of file nanoflann.hpp.

268 {
269 size_t size = value.size();
270 fwrite(&size, sizeof(size_t), 1, stream);
271 fwrite(&value[0], sizeof(T), size, stream);
272}

References nanoflann::KNNResultSet< DistanceType, IndexType, CountType >::size().

+ Here is the call graph for this function:

◆ save_value() [2/2]

template<typename T >
void nanoflann::save_value ( FILE * stream,
const T & value,
size_t count = 1 )

Definition at line 263 of file nanoflann.hpp.

263 {
264 fwrite(&value, sizeof(value), count, stream);
265}
+ Here is the caller graph for this function: