UQTk: Uncertainty Quantification Toolkit  3.1.1
Functions
arrayio.cpp File Reference

Read/write capabilities from/to matrix or vector form arrays/files. More...

#include "arrayio.h"

Functions

template<typename T >
void read_datafile (Array2D< T > &data, const char *filename)
 Read a datafile from filename in a matrix form and store it in the 2d array data of typename T. More...
 
template void read_datafile (Array2D< double > &data, const char *filename)
 
template void read_datafile (Array2D< int > &data, const char *filename)
 
template<typename T >
void read_datafileVS (Array2D< T > &data, const char *filename)
 Read a datafile from filename in a matrix form and store it in the 2d array data if typename T. More...
 
template void read_datafileVS (Array2D< double > &data, const char *filename)
 
template void read_datafileVS (Array2D< int > &data, const char *filename)
 
template<typename T >
void read_datafileVS (std::vector< T > &data, int &nrows, int &ncols, const char *filename)
 Read a datafile from filename in a matrix form and store it in a std::vector in column-major storage scheme. More...
 
template void read_datafileVS (std::vector< double > &data, int &nrows, int &ncols, const char *filename)
 
template void read_datafileVS (std::vector< int > &data, int &nrows, int &ncols, const char *filename)
 
template<typename T >
void read_datafile_1d (Array1D< T > &data, const char *filename)
 Read a data from filename in a vector form and store it in a 1d array data of typename T. More...
 
template void read_datafile_1d (Array1D< double > &data, const char *filename)
 
template void read_datafile_1d (Array1D< int > &data, const char *filename)
 
template<typename T >
void read_datafileVS (Array1D< T > &data, const char *filename)
 Read a datafile from filename in a vector form and store it in the 1d array data of typename T. More...
 
template void read_datafileVS (Array1D< double > &data, const char *filename)
 
template void read_datafileVS (Array1D< int > &data, const char *filename)
 
template<typename T >
void write_datafile_size (const Array2D< T > &data, const char *filename)
 Write to file filename the number of rows and number of columns on the first line, followed by the contents of a 2d array data of typename T in a matrix form. More...
 
template void write_datafile_size (const Array2D< double > &data, const char *filename)
 
template void write_datafile_size (const Array2D< int > &data, const char *filename)
 
template<typename T >
void write_datafile (const Array2D< T > &data, const char *filename)
 Write the contents of a 2d array data of typename T to file filename in a matrix form. More...
 
template void write_datafile (const Array2D< double > &data, const char *filename)
 
template void write_datafile (const Array2D< int > &data, const char *filename)
 
template<typename T >
void write_datafile (const Array2D< T > &data, const char *filename, const char *action)
 Write/append the contents of a 2d array data of typename T to file filename in a matrix form. More...
 
template void write_datafile (const Array2D< double > &data, const char *filename, const char *action)
 
template void write_datafile (const Array2D< int > &data, const char *filename, const char *action)
 
template<typename T >
void write_datafile (const std::vector< T > &data, const int &nrows, const int &ncols, const char *storage, const char *filename, const char *action)
 Write the contents of a vector of typename T to file filename in a matrix form. More...
 
template void write_datafile (const std::vector< double > &data, const int &nrows, const int &ncols, const char *storage, const char *filename, const char *action)
 
template void write_datafile (const std::vector< int > &data, const int &nrows, const int &ncols, const char *storage, const char *filename, const char *action)
 
template<typename T >
void write_datafile_1d (const Array1D< T > &data, const char *filename)
 Write the contents of a 1d array data of typename T to file filename in a vector form. More...
 
template void write_datafile_1d (const Array1D< double > &data, const char *filename)
 
template void write_datafile_1d (const Array1D< int > &data, const char *filename)
 

Detailed Description

Read/write capabilities from/to matrix or vector form arrays/files.

Function Documentation

◆ read_datafile() [1/3]

template void read_datafile ( Array2D< double > &  data,
const char *  filename 
)

◆ read_datafile() [2/3]

template void read_datafile ( Array2D< int > &  data,
const char *  filename 
)

◆ read_datafile() [3/3]

template<typename T >
void read_datafile ( Array2D< T > &  data,
const char *  filename 
)

Read a datafile from filename in a matrix form and store it in the 2d array data of typename T.

Note
The array data needs to have the correct sizes

◆ read_datafile_1d() [1/3]

template void read_datafile_1d ( Array1D< double > &  data,
const char *  filename 
)

◆ read_datafile_1d() [2/3]

template void read_datafile_1d ( Array1D< int > &  data,
const char *  filename 
)

◆ read_datafile_1d() [3/3]

template<typename T >
void read_datafile_1d ( Array1D< T > &  data,
const char *  filename 
)

Read a data from filename in a vector form and store it in a 1d array data of typename T.

Note
The array data needs to have the correct size

◆ read_datafileVS() [1/9]

template void read_datafileVS ( Array1D< double > &  data,
const char *  filename 
)

◆ read_datafileVS() [2/9]

template void read_datafileVS ( Array1D< int > &  data,
const char *  filename 
)

◆ read_datafileVS() [3/9]

template<typename T >
void read_datafileVS ( Array1D< T > &  data,
const char *  filename 
)

Read a datafile from filename in a vector form and store it in the 1d array data of typename T.

Note
The array data is resized to match the file contents
This function makes two passes: the first pass figures the no. or rows and columns, then the data array is appropriately resized, and the filename is read during second pass

◆ read_datafileVS() [4/9]

template void read_datafileVS ( Array2D< double > &  data,
const char *  filename 
)

◆ read_datafileVS() [5/9]

template void read_datafileVS ( Array2D< int > &  data,
const char *  filename 
)

◆ read_datafileVS() [6/9]

template<typename T >
void read_datafileVS ( Array2D< T > &  data,
const char *  filename 
)

Read a datafile from filename in a matrix form and store it in the 2d array data if typename T.

Note
The array data is resized to match the file contents
This function makes two passes: the first pass figures the no. or rows and columns, then the data array is appropriately resized, and the filename is read during second pass

◆ read_datafileVS() [7/9]

template void read_datafileVS ( std::vector< double > &  data,
int &  nrows,
int &  ncols,
const char *  filename 
)

◆ read_datafileVS() [8/9]

template void read_datafileVS ( std::vector< int > &  data,
int &  nrows,
int &  ncols,
const char *  filename 
)

◆ read_datafileVS() [9/9]

template<typename T >
void read_datafileVS ( std::vector< T > &  data,
int &  nrows,
int &  ncols,
const char *  filename 
)

Read a datafile from filename in a matrix form and store it in a std::vector in column-major storage scheme.

Note
The vector is resized to match the file contents
This function makes two passes: the first pass figures the no. or rows and columns, then the data vector is appropriately resized, and the filename is read during second pass

◆ write_datafile() [1/9]

template void write_datafile ( const Array2D< double > &  data,
const char *  filename 
)

◆ write_datafile() [2/9]

template void write_datafile ( const Array2D< double > &  data,
const char *  filename,
const char *  action 
)

◆ write_datafile() [3/9]

template void write_datafile ( const Array2D< int > &  data,
const char *  filename 
)

◆ write_datafile() [4/9]

template void write_datafile ( const Array2D< int > &  data,
const char *  filename,
const char *  action 
)

◆ write_datafile() [5/9]

template<typename T >
void write_datafile ( const Array2D< T > &  data,
const char *  filename 
)

Write the contents of a 2d array data of typename T to file filename in a matrix form.

◆ write_datafile() [6/9]

template<typename T >
void write_datafile ( const Array2D< T > &  data,
const char *  filename,
const char *  action 
)

Write/append the contents of a 2d array data of typename T to file filename in a matrix form.

◆ write_datafile() [7/9]

template void write_datafile ( const std::vector< double > &  data,
const int &  nrows,
const int &  ncols,
const char *  storage,
const char *  filename,
const char *  action 
)

◆ write_datafile() [8/9]

template void write_datafile ( const std::vector< int > &  data,
const int &  nrows,
const int &  ncols,
const char *  storage,
const char *  filename,
const char *  action 
)

◆ write_datafile() [9/9]

template<typename T >
void write_datafile ( const std::vector< T > &  data,
const int &  nrows,
const int &  ncols,
const char *  storage,
const char *  filename,
const char *  action 
)

Write the contents of a vector of typename T to file filename in a matrix form.

◆ write_datafile_1d() [1/3]

template void write_datafile_1d ( const Array1D< double > &  data,
const char *  filename 
)

◆ write_datafile_1d() [2/3]

template void write_datafile_1d ( const Array1D< int > &  data,
const char *  filename 
)

◆ write_datafile_1d() [3/3]

template<typename T >
void write_datafile_1d ( const Array1D< T > &  data,
const char *  filename 
)

Write the contents of a 1d array data of typename T to file filename in a vector form.

◆ write_datafile_size() [1/3]

template void write_datafile_size ( const Array2D< double > &  data,
const char *  filename 
)

◆ write_datafile_size() [2/3]

template void write_datafile_size ( const Array2D< int > &  data,
const char *  filename 
)

◆ write_datafile_size() [3/3]

template<typename T >
void write_datafile_size ( const Array2D< T > &  data,
const char *  filename 
)

Write to file filename the number of rows and number of columns on the first line, followed by the contents of a 2d array data of typename T in a matrix form.