Input/output¶
Display¶
If Qt5 was detected during Elemental’s configuration process, the following
routines draw data structures on screen; otherwise, they print entries to
the standard output stream (i.e., std::cout
).
Dense matrices¶
C++ API¶
-
void
Display
(const Matrix<T> &A, std::string title = "Matrix")¶
-
void
Display
(const AbstractDistMatrix<T> &A, std::string title = "DistMatrix")¶
C API¶
Graphs and sparse matrices¶
C++ API¶
-
void
Display
(const SparseMatrix<T> &A, std::string title = "SparseMatrix")¶
-
void
Display
(const DistSparseMatrix<T> &A, std::string title = "DistSparseMatrix")¶
C API¶
TODO
Print¶
The following routines print a given matrix or graph to a given output stream
(which defaults to std::cout
).
Dense matrices¶
C++ API¶
-
void
Print
(const Matrix<T> &A, std::string title = "Matrix", std::ostream &os = std::cout)¶
-
void
Print
(const AbstractDistMatrix<T> &A, std::string title = "DistMatrix", std::ostream &os = std::cout)¶
C API¶
Graphs and sparse matrices¶
C++ API¶
-
void
Print
(const SparseMatrix<T> &A, std::string title = "SparseMatrix", std::ostream &os = std::cout)¶
-
void
Print
(const DistSparseMatrix<T> &A, std::string title = "DistSparseMatrix", std::ostream &os = std::cout)¶
C API¶
TODO
Spy¶
If Qt5 was detected during configuration, then the following routines display
a sply plot of the elements of a matrix with absolute values greater than or
equal to a given tolerance, tol
.
Read¶
File formats¶
Note
In the case that a BINARY_FLAT
file is read, the formed matrix should
have already been of the correct size before reading.
C++ API¶
-
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
MATRIX_MARKET
¶ Matrix Market format
-
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)
-
enumerator
C API¶
-
ElFileFormat
¶ An enum that can take on the following values:
EL_AUTO
: attempt to detect format from filename extensionEL_ASCII
: simple ASCII text fileEL_ASCII_ASCII
: MATLAB-ready ASCII text fileEL_BINARY
: column-major binary file with integer height and width headerEL_BINARY_FLAT
: column-major binary file with no header dataEL_BMP
: bitmap image format (requires Qt5)EL_MATRIX_MARKET
: Matrix Market formatEL_JPG
: JPG image format (requires Qt5)EL_JPEG
: JPEG image format (requires Qt5)EL_PNG
: PNG image format (requires Qt5)EL_PPM
: PPM image format (requires Qt5)EL_XBM
: XBM image format (requires Qt5)EL_XPM
: XPM image format (requires Qt5)
Dense matrices¶
Elemental supports reading matrices from several different file formats (at the moment, ASCII
, BINARY
, BINARY_FLAT
and MATRIX_MARKET
).
In the distributed case, the sequential
flag determines whether or not
the data should be read from file by a single process and then afterward
scattered to the entire set of processes.
C++ API¶
-
void
Read
(Matrix<T> &A, std::string filename, FileFormat format = AUTO)¶
-
void
Read
(AbstractDistMatrix<T> &A, std::string filename, FileFormat format = AUTO, bool sequential = false)¶
C API¶
-
ElError
ElRead_i
(ElMatrix_i A, const char* filename, ElFileFormat format)¶
-
ElError
ElRead_s
(ElMatrix_s A, const char* filename, ElFileFormat format)¶
-
ElError
ElRead_d
(ElMatrix_d A, const char* filename, ElFileFormat format)¶
-
ElError
ElRead_c
(ElMatrix_c A, const char* filename, ElFileFormat format)¶
-
ElError
ElRead_z
(ElMatrix_z A, const char* filename, ElFileFormat format)¶
-
ElError
ElReadDist_i
(ElMatrix_i A, const char* filename, ElFileFormat format)¶
-
ElError
ElReadDist_s
(ElMatrix_s A, const char* filename, ElFileFormat format)¶
-
ElError
ElReadDist_d
(ElMatrix_d A, const char* filename, ElFileFormat format)¶
-
ElError
ElReadDist_c
(ElMatrix_c A, const char* filename, ElFileFormat format)¶
-
ElError
ElReadDist_z
(ElMatrix_z A, const char* filename, ElFileFormat format)¶
Write¶
Elemental also supports writing matrices to disk in various file formats. However, please note that Qt5 is currently required for writing to image formats.
Dense matrices¶
C++ API¶
-
void
Write
(const Matrix<T> &A, std::string basename = "Matrix", FileFormat format = BINARY, std::string title = "")¶
-
void
Write
(const AbstractDistMatrix<T> &A, std::string basename = "DistMatrix", FileFormat format = BINARY, std::string title = "")¶
C API¶
-
ElError
ElWrite_i
(ElConstMatrix_i A, const char* basename, ElFileFormat format, const char* title)¶
-
ElError
ElWrite_s
(ElConstMatrix_s A, const char* basename, ElFileFormat format, const char* title)¶
-
ElError
ElWrite_d
(ElConstMatrix_d A, const char* basename, ElFileFormat format, const char* title)¶
-
ElError
ElWrite_c
(ElConstMatrix_c A, const char* basename, ElFileFormat format, const char* title)¶
-
ElError
ElWrite_z
(ElConstMatrix_z A, const char* basename, ElFileFormat format, const char* title)¶
-
ElError
ElWriteDist_i
(ElConstDistMatrix_i A, const char* basename, ElFileFormat format, const char* title)¶
-
ElError
ElWriteDist_s
(ElConstDistMatrix_s A, const char* basename, ElFileFormat format, const char* title)¶
-
ElError
ElWriteDist_d
(ElConstDistMatrix_d A, const char* basename, ElFileFormat format, const char* title)¶
-
ElError
ElWriteDist_c
(ElConstDistMatrix_c A, const char* basename, ElFileFormat format, const char* title)¶
-
ElError
ElWriteDist_z
(ElConstDistMatrix_z A, const char* basename, ElFileFormat format, const char* title)¶