com.multicorebsp.util
Class MMobject

java.lang.Object
  extended by com.multicorebsp.util.MMobject

public class MMobject
extends java.lang.Object

Models various matrix-market object types


Nested Class Summary
static class MMobject.FieldType
          All the supported data field types.
static class MMobject.FormatType
          All the supported input format types.
static class MMobject.ObjectType
          All the supported object types.
static class MMobject.SymmetryType
          All the supported symmetry types.
static class MMobject.ViewType
          All the supported view types.
 
Constructor Summary
MMobject()
           
 
Method Summary
 MMobject.FieldType getField()
           
 MMobject.FormatType getFormat()
           
 int getM()
           
 Matrix<?> getMatrix()
          Returns the matrix object itself.
 int getN()
           
 java.lang.String getName()
           
 int getNnz()
           
 MMobject.SymmetryType getSymmetry()
           
 TS<?> getTS()
          Call only if you are sure this is a sparse matrix and not a vector collection.
 MMobject.ObjectType getType()
           
 VectorCollection<?> getVectorCollection()
          Call only if you are sure this is a vector collection, and not a general sparse matrix or a dense vector.
 MMobject.ViewType getView()
           
 void toLocalView(int[][] r, int[][] c)
          Transforms the current matrix to a local view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMobject

public MMobject()
Method Detail

getM

public int getM()
Returns:
Number of matrix rows.

getN

public int getN()
Returns:
Number of matrix columns.

getNnz

public int getNnz()
Returns:
Number of nonzeroes of this matrix.

getName

public java.lang.String getName()
Returns:
The matrix name.

getType

public MMobject.ObjectType getType()
Returns:
The type of matrix (vector, matrix, et cetera).

getFormat

public MMobject.FormatType getFormat()
Returns:
The format type (coordinate or array).

getField

public MMobject.FieldType getField()
Returns:
The field type (integer, real, et cetera).

getSymmetry

public MMobject.SymmetryType getSymmetry()
Returns:
The symmetry type (general matrix, symmetric, et cetera).

getView

public MMobject.ViewType getView()
Returns:
The view type (original, global or local view).

getMatrix

public Matrix<?> getMatrix()
Returns the matrix object itself. Note that this can be either a Triplet-Scheme based matrix, or a vector- collection. Use the field type to determine which. If you are sure if it is a TS type or a variable collection, you can use the getTS() and getVectorCollection() functions instead to avoid casting.

Returns:
The matrix object.

getTS

public TS<?> getTS()
Call only if you are sure this is a sparse matrix and not a vector collection. An exception will be thrown when this is not the case.

Returns:
The triplet scheme datastructure storing this matrix.

getVectorCollection

public VectorCollection<?> getVectorCollection()
Call only if you are sure this is a vector collection, and not a general sparse matrix or a dense vector. An exception will be thrown when this matrix is not a vector collection.

Returns:
A variable matrix datastructure containing the vector collection.

toLocalView

public void toLocalView(int[][] r,
                        int[][] c)
Transforms the current matrix to a local view. Current view should be global, or the object type should be distributed. If the object is not distributed and not global, this method will be ineffective (it does not throw an error).

Parameters:
r - The row-wise translation vector collection.
c - The column-wise translation vector collection.