AiLibrary  v1.3.0
A single-header C++ Library from Ailurus Studio
Save Functions

Functions providing the ability to save your data. More...

Functions

template<typename T >
INLINE void ai::saveMatrix (const std::string filename, const std::vector< std::vector< T > > &matrix, std::string comment=std::string(), const bool transpose=false, std::string type=std::string("text"), std::string delimiter=std::string(" "), const std::size_t tokenWidth=14)
 
template<typename T >
INLINE void ai::saveVector (const std::string filename, const std::vector< T > &vector, std::string comment=std::string(), std::string type=std::string("text"), std::string delimiter=std::string("\))
 
INLINE void ai::saveLine (const std::string filename, const std::string line, std::string comment=std::string())
 
template<typename T >
INLINE void ai::save (const std::string filename, const std::vector< std::vector< T > > &matrix, std::string comment=std::string())
 
template<typename T >
INLINE void ai::save (const std::string filename, const std::vector< T > &vector, std::string comment=std::string())
 
template<typename T >
INLINE void ai::save (const std::string filename, const std::string line, std::string comment=std::string())
 
INLINE void ai::saveLog (const std::string filename, std::string log, const bool timestamp=false, const std::string stampSeparator=std::string(" "))
 
INLINE void ai::saveLog (const std::string filename, std::vector< std::string > &logs, const bool timestamp=false, const std::string stampSeparator=std::string(" "))
 
template<typename T >
INLINE bool ai::loadA3R (const std::string filename, std::vector< std::vector< T > > &positions, double &radius)
 
template<typename T >
INLINE bool ai::saveA3R (const std::string filename, const std::vector< std::vector< T > > &positions, const double radius=1)
 
template<typename T >
INLINE void ai::loadXYZ (const std::string filename, std::vector< std::vector< T > > &matrix)
 
template<typename T >
INLINE void ai::saveXYZ (const std::string filename, const std::vector< std::vector< T > > &matrix, const std::vector< T > &tones, std::string elementName="C")
 
template<typename T >
INLINE void ai::saveXYZ (const std::string filename, const std::vector< std::vector< T > > &matrix, std::string elementName="C")
 

Detailed Description

Group of functions that will make saving data much easier by supporting various formats and styles

Function Documentation

◆ loadA3R()

template<typename T >
INLINE bool ai::loadA3R ( const std::string  filename,
std::vector< std::vector< T > > &  positions,
double &  radius 
)
Template Parameters
TA number type
Exceptions
std::runtime_errorIf file could not be open
Here is the call graph for this function:

◆ loadXYZ()

template<typename T >
INLINE void ai::loadXYZ ( const std::string  filename,
std::vector< std::vector< T > > &  matrix 
)
Template Parameters
TAny printable type
Exceptions
std::runtime_errorIf file could not be open
See also
https://en.wikipedia.org/wiki/XYZ_file_format
Here is the call graph for this function:

◆ save() [1/3]

template<typename T >
INLINE void ai::save ( const std::string  filename,
const std::vector< std::vector< T > > &  matrix,
std::string  comment = std::string() 
)
Here is the call graph for this function:

◆ save() [2/3]

template<typename T >
INLINE void ai::save ( const std::string  filename,
const std::vector< T > &  vector,
std::string  comment = std::string() 
)
Here is the call graph for this function:

◆ save() [3/3]

template<typename T >
INLINE void ai::save ( const std::string  filename,
const std::string  line,
std::string  comment = std::string() 
)
Here is the call graph for this function:

◆ saveA3R()

template<typename T >
INLINE bool ai::saveA3R ( const std::string  filename,
const std::vector< std::vector< T > > &  positions,
const double  radius = 1 
)
Template Parameters
TA number type
Exceptions
std::runtime_errorIf file could not be open
Here is the call graph for this function:

◆ saveLine()

INLINE void ai::saveLine ( const std::string  filename,
const std::string  line,
std::string  comment = std::string() 
)
Exceptions
std::runtime_errorIf file could not be open
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveLog() [1/2]

INLINE void ai::saveLog ( const std::string  filename,
std::string  log,
const bool  timestamp = false,
const std::string  stampSeparator = std::string(" ") 
)
Exceptions
std::runtime_errorIf file could not be open

◆ saveLog() [2/2]

INLINE void ai::saveLog ( const std::string  filename,
std::vector< std::string > &  logs,
const bool  timestamp = false,
const std::string  stampSeparator = std::string(" ") 
)
Exceptions
std::runtime_errorIf file could not be open
Here is the call graph for this function:

◆ saveMatrix()

template<typename T >
INLINE void ai::saveMatrix ( const std::string  filename,
const std::vector< std::vector< T > > &  matrix,
std::string  comment = std::string(),
const bool  transpose = false,
std::string  type = std::string("text"),
std::string  delimiter = std::string(" "),
const std::size_t  tokenWidth = 14 
)
Template Parameters
TAny printable type
Exceptions
std::runtime_errorIf file could not be open
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveVector()

template<typename T >
INLINE void ai::saveVector ( const std::string  filename,
const std::vector< T > &  vector,
std::string  comment = std::string(),
std::string  type = std::string("text"),
std::string  delimiter = std::string("\n") 
)
Template Parameters
TAny printable type
Exceptions
std::runtime_errorIf file could not be open
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveXYZ() [1/2]

template<typename T >
INLINE void ai::saveXYZ ( const std::string  filename,
const std::vector< std::vector< T > > &  matrix,
const std::vector< T > &  tones,
std::string  elementName = "C" 
)
Template Parameters
TA number type
Exceptions
std::runtime_errorIf file could not be open
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveXYZ() [2/2]

template<typename T >
INLINE void ai::saveXYZ ( const std::string  filename,
const std::vector< std::vector< T > > &  matrix,
std::string  elementName = "C" 
)
Template Parameters
TAny printable type
Here is the call graph for this function: