PDF Clown
0.0.8

it.stefanochizzolini.clown.util.math
Class SquareMatrix

java.lang.Object
  extended by it.stefanochizzolini.clown.util.math.SquareMatrix
All Implemented Interfaces:
Cloneable

public final class SquareMatrix
extends Object
implements Cloneable

Square matrix providing fundamental operations of linear algebra.

Remarks

This class is a specialized adaptation from the original JAMA (Java Matrix Package) project, brought to the public domain by The MathWorks, Inc. and the National Institute of Standards and Technology.

Since:
0.0.4
Version:
0.0.4
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Constructor Summary
SquareMatrix(double[][] data)
          Construct a matrix from a 2-D array.
SquareMatrix(int size)
           
 
Method Summary
 Object clone()
           
 double[][] getData()
          Gets the internal two-dimensional array.
 double getDet()
          Gets the matrix determinant.
static SquareMatrix getIdentity(int size)
          Gets the identity matrix.
 SquareMatrix getInverse()
          Gets the matrix inverse.
 SquareMatrix getMatrix(int[] rowIndexes, int startColumnIndex)
          Gets a submatrix.
 int getSize()
          Gets the matrix size.
 SquareMatrix solve(SquareMatrix target)
          Solves [this] * [return] = [target]
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SquareMatrix

public SquareMatrix(int size)

SquareMatrix

public SquareMatrix(double[][] data)
Construct a matrix from a 2-D array.

Parameters:
data - Two-dimensional array of doubles.
Throws:
IllegalArgumentException - All rows must have the same length
Method Detail

getIdentity

public static SquareMatrix getIdentity(int size)
Gets the identity matrix.

Parameters:
size - Matrix size.

clone

public Object clone()
Overrides:
clone in class Object

getData

public double[][] getData()
Gets the internal two-dimensional array.


getMatrix

public SquareMatrix getMatrix(int[] rowIndexes,
                              int startColumnIndex)
Gets a submatrix.

Parameters:
rowIndexes - Array of row indices.
startColumnIndex - Initial column index.
Throws:
ArrayIndexOutOfBoundsException - Submatrix indices

getDet

public double getDet()
Gets the matrix determinant.


getInverse

public SquareMatrix getInverse()
Gets the matrix inverse.


getSize

public int getSize()
Gets the matrix size.


solve

public SquareMatrix solve(SquareMatrix target)
Solves [this] * [return] = [target]

Parameters:
target - Resulting matrix.
Returns:
Solution.

PDF Clown
0.0.8

Project home page

Copyright © 2006-2010 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.