sim.util.mantissa.linalg
Class MatrixFactory

java.lang.Object
  extended by sim.util.mantissa.linalg.MatrixFactory

public class MatrixFactory
extends java.lang.Object

This class is a factory for the linear algebra package.

This class is devoted to building the right type of matrix according to the structure of the non null elements.

This is a utility class, no instance of this class should be built, so the constructor is explicitly made private.

This file is from the "Mantissa" Java software package found at http://www.spaceroots.org/software/mantissa/index.html. The license is included at the end of the source file.


Method Summary
static Matrix buildMatrix(int rows, int columns, double[] data)
          Build a matrix of the right subtype.
static Matrix buildMatrix(int rows, int columns, double[] data, int lowerElements, int upperElements)
          Build a matrix of the right subtype.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildMatrix

public static Matrix buildMatrix(int rows,
                                 int columns,
                                 double[] data,
                                 int lowerElements,
                                 int upperElements)
Build a matrix of the right subtype. Build the right subtype of matrix according to the structure of the non null elements of the instance. Note that the information provided does not allow to build instances of the SymetricalMatrix class. When the data corresponding to a symetrical matrix is given, this method can only build an instance of the GeneralSquareMatrix class.

Parameters:
rows - number of row of the matrix
columns - number of columns of the matrix
data - table of the matrix elements (stored row after row)
lowerElements - number of non null elements in the lower triangle
upperElements - number of non null elements in the upper triangle
Returns:
a matrix containing the instance

buildMatrix

public static Matrix buildMatrix(int rows,
                                 int columns,
                                 double[] data)
Build a matrix of the right subtype. Build the right subtype of matrix according to the dimensions.

Parameters:
rows - number of row of the matrix
columns - number of columns of the matrix
data - table of the matrix elements (stored row after row)
Returns:
a matrix containing the instance