Doxygen 1.9.1
Toolkit for Adaptive Stochastic Modeling and Non-Intrusive ApproximatioN: Tasmanian v8.2 (development)
TasGrid::IO Namespace Reference

Collection of I/O handling templates. More...

Classes

struct  mode_ascii_type
 Type indicating ascii I/O mode. More...
 
struct  mode_binary_type
 Type indicating binary I/O mode. More...
 

Enumerations

enum  IOPad {
  pad_none , pad_rspace , pad_lspace , pad_line ,
  pad_auto
}
 Indicate the type of padding to use, none, space, new-line, etc. More...
 

Functions

template<typename iomode , typename DataType , typename IndexStride , typename IndexNumStrips >
Data2D< DataType > readData2D (std::istream &is, IndexStride stride, IndexNumStrips num_strips)
 Read the Data2D structure from the stream, assumes the given number of strips and stride. More...
 
std::map< std::string, TypeOneDRulegetStringRuleMap ()
 Creates a map with std::string rule names (used by C/Python/CLI) mapped to TypeOneDRule enums.
 
TypeOneDRule getRuleString (std::string const &name)
 Map the string rule name to the enumerate, used in ASCII I/O, command line and Python.
 
std::string getRuleString (TypeOneDRule rule)
 Map the enumerate to a string, used in ASCII I/O, command line and Python.
 
std::vector< TypeOneDRulegetIntRuleMap ()
 Creates a map with int (used by Fortran and binary I/O) mapped to TypeOneDRule enums.
 
TypeOneDRule getRuleInt (int r)
 Map the int rule index to the enumerate, used in Fortran and binary IO.
 
int getRuleInt (TypeOneDRule rule)
 Map the enumerate to an int, used in Fortran and binary IO.
 
std::map< std::string, TypeDepthgetStringToDepthMap ()
 Creates a map with std::string rule names (used by C/Python/CLI) mapped to TypeDepth enums.
 
TypeDepth getDepthTypeString (std::string const &name)
 Map the string to the enumerate multi-index selection strategy, used in command line and Python.
 
TypeDepth getDepthTypeInt (int t)
 Map the integer to the enumerate multi-index selection strategy, used in Fortran.
 
std::map< std::string, TypeRefinementgetStringToRefinementMap ()
 Creates a map with std::string rule names (used by C/Python/CLI) mapped to TypeRefinement enums.
 
TypeRefinement getTypeRefinementString (std::string const &name)
 Map the string to the enumerate hierarchical refinement strategy, used in command line and Python.
 
TypeRefinement getTypeRefinementInt (int refinement)
 Map the integer to the enumerate hierarchical refinement strategy, used by Fortran.
 
template<bool iomode, IOPad pad>
void writeFlag (bool flag, std::ostream &os)
 Write the flag to file, ascii uses 0 and 1, binary uses characters y and n (counter intuitive, I know).
 
template<typename iomode >
bool readFlag (std::istream &os)
 Read a flag, ascii uses 0 and 1, binary uses characters y and n (counter intuitive, I know).
 
template<bool iomode, IOPad pad, typename VecType >
void writeVector (const std::vector< VecType > &x, std::ostream &os)
 Write the vector to the stream, the vector cannot be empty.
 
template<typename iomode , typename VecType >
void readVector (std::istream &is, std::vector< VecType > &x)
 Read the vector from the stream, the size must already be set.
 
template<typename iomode , typename VecType , typename SizeType >
std::vector< VecType > readVector (std::istream &is, SizeType num_entries)
 Read the vector with the specified size.
 
template<bool iomode, IOPad pad, typename... Vals>
void writeNumbers (std::ostream &os, Vals... vals)
 Write a bunch of numbers with the same type.
 
template<typename iomode , typename Val >
Val readNumber (std::istream &is)
 Read a single number, used to read ints (and potentially cast to size_t) or read a double.
 
template<bool iomode>
void writeRule (TypeOneDRule rule, std::ostream &os)
 Write a rule.
 
template<typename iomode >
TypeOneDRule readRule (std::istream &is)
 Read a rule.
 

Detailed Description

Collection of I/O handling templates.