maspack.matrix
Enum Matrix.WriteFormat

java.lang.Object
  extended by java.lang.Enum<Matrix.WriteFormat>
      extended by maspack.matrix.Matrix.WriteFormat
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Matrix.WriteFormat>
Enclosing interface:
Matrix

public static enum Matrix.WriteFormat
extends java.lang.Enum<Matrix.WriteFormat>

Describes the general format for writing matrix values.


Enum Constant Summary
CRS
          Compressed row storage (CRS) format.
Dense
          Usual dense matrix format, as in
MatrixMarket
          MatrixMarket format.
Sparse
          Sparse format consisting of the non-zero entries, in row-major order, each written as a 3-tuples containing the i and j indices (0-based) and the associated value.
SYMMETRIC_CRS
          Same as CRS, except that the matrix is assumed to be symmetric and only the upper triangular values are stored.
 
Method Summary
static Matrix.WriteFormat valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Matrix.WriteFormat[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Dense

public static final Matrix.WriteFormat Dense
Usual dense matrix format, as in
 1.00  0.00  0.50
 2.30  4.10  0.00
 0.00  2.00  3.00
 


Sparse

public static final Matrix.WriteFormat Sparse
Sparse format consisting of the non-zero entries, in row-major order, each written as a 3-tuples containing the i and j indices (0-based) and the associated value. The example shown for Dense would be output as
 ( 0 0 1 )
 ( 0 2 0.50 )
 ( 1 0 2.30 )
 ( 1 1 4.10 )
 ( 2 1 2.00 )
 ( 2 2 3.00 )
 


MatrixMarket

public static final Matrix.WriteFormat MatrixMarket
MatrixMarket format. The example shown for Dense would be output as
 %%MatrixMarket matrix coordinate real general
 3 3 6
 1 1 1
 1 3 0.50
 2 1 2.30
 2 2 4.10
 3 2 2.00
 3 3 3.00


CRS

public static final Matrix.WriteFormat CRS
Compressed row storage (CRS) format. Row one gives the number of rows. Row two gives the starting offsets (one-based) for the first non-zero element in each row, followed by total number of non-zero values plus one. Rows three and four give, respectively, the column index (one-based) and value for each non-zero value, in row-major order. The example shown for Dense would be output as
 3
 1 3 5 7
 1 3 1 2 2 3
 1.00 0.50 2.30 4.10 2.00 3.00


SYMMETRIC_CRS

public static final Matrix.WriteFormat SYMMETRIC_CRS
Same as CRS, except that the matrix is assumed to be symmetric and only the upper triangular values are stored.

Method Detail

values

public static Matrix.WriteFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Matrix.WriteFormat c : Matrix.WriteFormat.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Matrix.WriteFormat valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null