Input/output

enum FileFormat
enumerator AUTO

Attempt to detect format from filename extension

enumerator ASCII

Simple ASCII text file

enumerator ASCII_MATLAB

MATLAB-ready ASCII text file

enumerator BINARY

Column-major binary file with integer height and width header

enumerator BINARY_FLAT

Column-major binary file with no header data

enumerator BMP

Bitmap image format (requires Qt5)

enumerator JPG

JPG image format (requires Qt5)

enumerator JPEG

JPEG image format (requires Qt5)

enumerator PNG

PNG image format (requires Qt5)

enumerator PPM

PPM image format (requires Qt5)

enumerator XBM

XBM image format (requires Qt5)

enumerator XPM

XPM image format (requires Qt5)

Display

void Display(const Matrix<T> &A, std::string title = "Default")
void Display(const DistMatrix<T, U, V> &A, std::string title = "Default")

If Qt5 was detected during configuration, display the matrix on screen. Otherwise, print it to the console.

Print

void Print(const Matrix<T> &A, std::string title = "", std::ostream &os = std::cout)
void Print(const DistMatrix<T, U, V> &A, std::string title = "", std::ostream &os = std::cout)

Prints the matrix to the console.

Spy

void Spy(const Matrix<T> &A, std::string title = "Default", Base<T> tol = 0)
void Spy(const DistMatrix<T, U, V> &A, std::string title = "Default", Base<T> tol = 0)

Only available if Qt5 was detected during configuration. A spy plot of the elements with absolute values greater than or equal to tol is displayed on screen.

Read

void Read(Matrix<T> &A, std::string filename, FileFormat format = AUTO)
void Read(DistMatrix<T, U, V> &A, std::string filename, FileFormat format = AUTO, bool sequential = false)

Read the specified matrix from a file with a supported format. As of now, only the BINARY format is supported In the distributed case, the sequential flag determines whether or not the data should be read from a single process and then scattered to the other processes as necessary.

read namespace

void read::BinaryFlat(Matrix<T> &A, int height, int width, std::string filename)
void read::BinaryFlat(DistMatrix<T, U, V> &A, int height, int width, std::string filename)

Read the matrix of the specified dimensions from the specified flat binary file.

Write

void Write(const Matrix<T> &A, std::string basename = "matrix", FileFormat format = BINARY, std::string title = "")
void Write(const DistMatrix<T, U, V> &A, std::string basename = "matrix", FileFormat format = BINARY, std::string title = "")

The matrix is written to a file (the given basename plus the appropriate extension) in the specified format. Note that Qt5 is required for the image formats.