LabVIEW Multicore Analysis and Sparse Matrix Toolkit API Reference

Read from Matrix Market File VI

  • Updated2023-02-21
  • 12 minute(s) read

Read from Matrix Market File VI

Owning Palette: File I/O VIs

Requires: Multicore Analysis and Sparse Matrix Toolkit

Reads a matrix from a file in the Matrix Market exchange format.

You must manually select the polymorphic instance you want to use. The instance you select and the actual matrix stored in the Matrix Market file must match. Otherwise, LabVIEW returns an error.

Details  Example

Read Sparse from Matrix Market (DBL)

Matrix Market file specifies an absolute path to a file from which you want to read the matrix.
matrix info only? specifies whether to read the value of the matrix elements from Matrix Market file. The default is FALSE, which specifies that this VI reads the value of the matrix elements and the matrix information. When matrix info only? is TRUE, this VI reads the value of the matrix information only.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
Matrix Market file out returns Matrix Market file.
Sparse Matrix returns the matrix read from Matrix Market file. This output returns an empty matrix when matrix info only? is TRUE.
matrix info returns the matrix information read from Matrix Market file.
format returns the format of the matrix in Matrix Market file.

0Coordinate—Matrix is formatted in coordinate in the file. This format applies to sparse matrices.
1Array—Matrix is formatted in array in the file. This format applies to dense matrices.
field returns the data type of the matrix and how the Market Matrix file represents the matrix elements.

0Real—The matrix is a real matrix. Elements are represented by a floating number in the file.
1Complex—The matrix is a complex matrix. Elements are represented by two floating numbers, indicating the real and imaginary parts, in the file.
2Integer—The matrix is an integer matrix. Elements are represented an integer.
3Pattern—The matrix shows its sparsity pattern. Row and column indices of elements are stored in the file. Pattern applies to sparse matrices.
matrix type returns the type of the matrix and how the Matrix Market file stores matrix elements.

0General—The matrix is a general matrix.
1Symmetric—The matrix is a symmetric matrix. Only the lower triangular part is stored in the file.
2Skew-symmetric—The matrix is a skew-symmetric matrix. Only the strict lower triangular part is stored in the file.
3Hermitian—The matrix is a Hermitian matrix. Only the lower triangular part is stored in the file. This type applies only to complex matrices.
number of rows returns the number of rows in Sparse Matrix.
number of columns returns the number of columns in Sparse Matrix.
number of elements returns the number of elements stored in the file when matrix info only? is TRUE. When matrix info only? is FALSE, number of elements returns the actual number of elements in Sparse Matrix. The actual number of elements can be determined only when all matrix data have been read from the file.
description returns the description of the matrix in Matrix Market file.
error out contains error information. This output provides standard error out functionality.

Read Sparse from Matrix Market (CDB)

Matrix Market file specifies an absolute path to a file from which you want to read the matrix.
matrix info only? specifies whether to read the value of the matrix elements from Matrix Market file. The default is FALSE, which specifies that this VI reads the value of the matrix elements and the matrix information. When matrix info only? is TRUE, this VI reads the value of the matrix information only.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
Matrix Market file out returns Matrix Market file.
Sparse Matrix returns the matrix read from Matrix Market file. This output returns an empty matrix when matrix info only? is TRUE.
matrix info returns the matrix information read from Matrix Market file.
format returns the format of the matrix in Matrix Market file.

0Coordinate—Matrix is formatted in coordinate in the file. This format applies to sparse matrices.
1Array—Matrix is formatted in array in the file. This format applies to dense matrices.
field returns the data type of the matrix and how the Market Matrix file represents the matrix elements.

0Real—The matrix is a real matrix. Elements are represented by a floating number in the file.
1Complex—The matrix is a complex matrix. Elements are represented by two floating numbers, indicating the real and imaginary parts, in the file.
2Integer—The matrix is an integer matrix. Elements are represented an integer.
3Pattern—The matrix shows its sparsity pattern. Row and column indices of elements are stored in the file. Pattern applies to sparse matrices.
matrix type returns the type of the matrix and how the Matrix Market file stores matrix elements.

0General—The matrix is a general matrix.
1Symmetric—The matrix is a symmetric matrix. Only the lower triangular part is stored in the file.
2Skew-symmetric—The matrix is a skew-symmetric matrix. Only the strict lower triangular part is stored in the file.
3Hermitian—The matrix is a Hermitian matrix. Only the lower triangular part is stored in the file. This type applies only to complex matrices.
number of rows returns the number of rows in Sparse Matrix.
number of columns returns the number of columns in Sparse Matrix.
number of elements returns the number of elements stored in the file when matrix info only? is TRUE. When matrix info only? is FALSE, number of elements returns the actual number of elements in Sparse Matrix. The actual number of elements can be determined only when all matrix data have been read from the file.
description returns the description of the matrix in Matrix Market file.
error out contains error information. This output provides standard error out functionality.

Read Dense from Matrix Market (DBL)

Matrix Market file specifies an absolute path to a file from which you want to read the matrix.
matrix info only? specifies whether to read the value of the matrix elements from Matrix Market file. The default is FALSE, which specifies that this VI reads the value of the matrix elements and the matrix information. When matrix info only? is TRUE, this VI reads the value of the matrix information only.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
Matrix Market file out returns Matrix Market file.
Dense Matrix returns the matrix read from Matrix Market file. This output returns an empty matrix when matrix info only? is TRUE.
matrix info returns the matrix information read from Matrix Market file.
format returns the format of the matrix in Matrix Market file.

0Coordinate—Matrix is formatted in coordinate in the file. This format applies to sparse matrices.
1Array—Matrix is formatted in array in the file. This format applies to dense matrices.
field returns the data type of the matrix and how the Market Matrix file represents the matrix elements.

0Real—The matrix is a real matrix. Elements are represented by a floating number in the file.
1Complex—The matrix is a complex matrix. Elements are represented by two floating numbers, indicating the real and imaginary parts, in the file.
2Integer—The matrix is an integer matrix. Elements are represented an integer.
3Pattern—The matrix shows its sparsity pattern. Row and column indices of elements are stored in the file. Pattern applies to sparse matrices.
matrix type returns the type of the matrix and how the Matrix Market file stores matrix elements.

0General—The matrix is a general matrix.
1Symmetric—The matrix is a symmetric matrix. Only the lower triangular part is stored in the file.
2Skew-symmetric—The matrix is a skew-symmetric matrix. Only the strict lower triangular part is stored in the file.
3Hermitian—The matrix is a Hermitian matrix. Only the lower triangular part is stored in the file. This type applies only to complex matrices.
number of rows returns the number of rows in Dense Matrix.
number of columns returns the number of columns in Dense Matrix.
number of elements returns the number of elements in Dense Matrix. The number of elements is equal to the product of number of rows and number of columns in Dense Matrix.
description returns the description of the matrix in Matrix Market file.
error out contains error information. This output provides standard error out functionality.

Read Dense from Matrix Market (CDB)

Matrix Market file specifies an absolute path to a file from which you want to read the matrix.
matrix info only? specifies whether to read the value of the matrix elements from Matrix Market file. The default is FALSE, which specifies that this VI reads the value of the matrix elements and the matrix information. When matrix info only? is TRUE, this VI reads the value of the matrix information only.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
Matrix Market file out returns Matrix Market file.
Dense Matrix returns the matrix read from Matrix Market file. This output returns an empty matrix when matrix info only? is TRUE.
matrix info returns the matrix information read from Matrix Market file.
format returns the format of the matrix in Matrix Market file.

0Coordinate—Matrix is formatted in coordinate in the file. This format applies to sparse matrices.
1Array—Matrix is formatted in array in the file. This format applies to dense matrices.
field returns the data type of the matrix and how the Market Matrix file represents the matrix elements.

0Real—The matrix is a real matrix. Elements are represented by a floating number in the file.
1Complex—The matrix is a complex matrix. Elements are represented by two floating numbers, indicating the real and imaginary parts, in the file.
2Integer—The matrix is an integer matrix. Elements are represented an integer.
3Pattern—The matrix shows its sparsity pattern. Row and column indices of elements are stored in the file. Pattern applies to sparse matrices.
matrix type returns the type of the matrix and how the Matrix Market file stores matrix elements.

0General—The matrix is a general matrix.
1Symmetric—The matrix is a symmetric matrix. Only the lower triangular part is stored in the file.
2Skew-symmetric—The matrix is a skew-symmetric matrix. Only the strict lower triangular part is stored in the file.
3Hermitian—The matrix is a Hermitian matrix. Only the lower triangular part is stored in the file. This type applies only to complex matrices.
number of rows returns the number of rows in Dense Matrix.
number of columns returns the number of columns in Dense Matrix.
number of elements returns the number of elements in Dense Matrix. The number of elements is equal to the product of number of rows and number of columns in Dense Matrix.
description returns the description of the matrix in Matrix Market file.
error out contains error information. This output provides standard error out functionality.

Read from Matrix Market File Details

The following table lists the support characteristics of this VI.

Supported on RT targets Yes
Suitable for bounded execution times on RT No

Refer to the following table to determine the instance to use.

Instance to use Format Field Type
Read Sparse from Matrix Market (DBL) Coordinate Real General
Integer Symmetric
Pattern Skew-symmetric
Read Sparse from Matrix Market (CDB) Coordinate Real General
Complex Symmetric
Integer Skew-symmetric
Pattern Hermitian
Read Dense from Matrix Market (DBL) Array Real General
Integer Symmetric
Skew-symmetric
Read Dense from Matrix Market (CDB) Array Real General
Complex Symmetric
Integer Skew-symmetric
Hermitian

Example

Refer to the Read Matrix from Matrix Market File VI in the labview\examples\Multicore Analysis and Sparse Matrix\Sparse Matrix directory for an example of using the Read from Matrix Market File VI.