org.jmat.data
Class AbstractMatrix

java.lang.Object
  |
  +--org.jmat.data.AbstractDoubleArray
        |
        +--org.jmat.data.AbstractMatrix
All Implemented Interfaces:
ClipBoardPrintable, java.lang.Cloneable, CommandLinePrintable, FilePrintable, java.io.Serializable, StringPrintable, XMLPrintable
Direct Known Subclasses:
LightMatrix, MapedMatrix, Matrix, SparseMatrix

public abstract class AbstractMatrix
extends AbstractDoubleArray
implements CommandLinePrintable, StringPrintable, XMLPrintable, FilePrintable, ClipBoardPrintable

Description : Class designed to implement all algebraic, visualisation and others ... methods of the matrix classes.

Copyright : LGPL

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jmat.data.AbstractDoubleArray
m, n
 
Constructor Summary
AbstractMatrix(int _m, int _n)
          Construct an m-by-n matrix of zeros.
 
Method Summary
 CholeskyDecomposition cholesky()
          Cholesky Decomposition
 double condition()
          Matrix condition (2 norm)
 AbstractMatrix copy()
          Copy the Matrix object.
 AbstractMatrix correlation()
          Generate a correlation matrix, each column contains values of a pulling.
 AbstractMatrix covariance()
          Generate a covariance matrix, each column contains values of a pulling.
 AbstractMatrix cumProduct()
          Generate a row matrix, each column contents the product value of the columns.
 AbstractMatrix cumSum()
          Generate a row matrix, each column contents the sum value of the columns.
 AbstractMatrix deleteColumn(int J)
          Delete a Column to Matrix.
 AbstractMatrix deleteColumns(int[] J)
          Delete a Column to Matrix.
 AbstractMatrix deleteColumns(int j0, int j1)
          Delete a Column to Matrix.
 AbstractMatrix deleteRow(int I)
          delete a Row to Matrix.
 AbstractMatrix deleteRows(int[] I)
          delete a Row to Matrix.
 AbstractMatrix deleteRows(int i0, int i1)
          delete a Row to Matrix.
 double determinant()
          Matrix determinant
 AbstractMatrix distance(AbstractDoubleArray B, double pow)
          Generate a matrix, each column contents the N-distance between the columns.
 AbstractMatrix divide(AbstractMatrix B)
          Linear algebraic matrix division, A / B
 AbstractMatrix divide(double s)
          Multiply a matrix by a scalar, C = s*A
 void divideEquals(double s)
          Multiply a matrix by a scalar, C = s*A
 AbstractMatrix ebeAbs()
          Absolute value of each element
 void ebeAbsEquals()
          Element-by-element absolute value
 AbstractMatrix ebeCos()
          Element-by-element cosinus
 void ebeCosEquals()
          Element-by-element cosinus
 AbstractMatrix ebeDivide(AbstractMatrix B)
          Element-by-element right division, C = A.
 void ebeDivideEquals(AbstractMatrix B)
          Element-by-element right division, C = A.
 AbstractMatrix ebeExp()
          Element-by-element exponential
 void ebeExpEquals()
          Element-by-element exponential
 AbstractMatrix ebeFunction(DoubleFunction fun)
          Element-by-element function evaluation
 void ebeFunctionEquals(DoubleFunction fun)
          Element-by-element absolute value
 AbstractMatrix ebeInverse()
          Element-by-element inverse
 void ebeInverseEquals()
          Element-by-element inverse
 AbstractMatrix ebeLog()
          Element-by-element neperian logarithm
 void ebeLogEquals()
          Element-by-element neperian logarithm
 AbstractMatrix ebePower(double p)
          Element-by-element power
 AbstractMatrix ebePower(Matrix B)
          Element-by-element power
 void ebePowerEquals(AbstractMatrix B)
          Element-by-element power
 void ebePowerEquals(double p)
          Element-by-element power
 AbstractMatrix ebeSin()
          Element-by-element sinus
 void ebeSinEquals()
          Element-by-element sinus
 AbstractMatrix ebeSqrt()
          Square root of each element
 void ebeSqrtEquals()
          Element-by-element square root
 AbstractMatrix ebeTimes(AbstractMatrix B)
          Element-by-element multiplication, C = A.
 void ebeTimesEquals(AbstractMatrix B)
          Element-by-element multiplication, C = A.
 EigenvalueDecomposition eig()
          Eigenvalue Decomposition
 Finding find(double min, double max)
          Find an element
 Finding find(java.lang.String test, double val)
          Find an element
static AbstractMatrix fromASCIIFile(java.io.File file)
          Load the Matrix from a file
static AbstractMatrix fromClipBoard()
          Load the Matrix from the clipboard
static AbstractMatrix fromString(java.lang.String s)
          Load the Matrix from a String
static AbstractMatrix fromXMLElement(org.jdom.Element e)
          Load the Matrix from a MathML (XML) Element
 AbstractMatrix getColumn(int j)
          Copy an internal one-dimensional array from a column.
 AbstractMatrix getColumns(int[] J)
          Copy an internal one-dimensional array from a column.
 AbstractMatrix getColumns(int j0, int j1)
          Copy an internal one-dimensional array from a column.
 AbstractMatrix getDiagonal()
          Matrix diagonal extraction.
 AbstractMatrix getDiagonal(int num)
          Matrix diagonal extraction.
 AbstractDoubleArray getDoubleArrayCopy()
           
abstract  AbstractMatrix getInstance(int _m, int _n)
          Construct an m-by-n matrix of zeros.
 AbstractMatrix getInstanceCopyOf(AbstractMatrix M)
          Construct an m-by-n matrix of zeros.
 AbstractMatrix getRow(int i)
          Copy an internal one-dimensional array from a row.
 AbstractMatrix getRows(int[] I)
          Copy an internal one-dimensional array from many rows.
 AbstractMatrix getRows(int i0, int i1)
          Copy an internal one-dimensional array from many rows.
 AbstractMatrix getSubMatrix(int i0, int i1, int j0, int j1)
          Get a submatrix.
 AbstractMatrix insertColumns(int J, AbstractDoubleArray B)
          Insert a Column into Matrix.
 AbstractMatrix insertRows(int I, AbstractDoubleArray B)
          Insert a Row into Matrix.
 AbstractMatrix inverse()
          Matrix inverse or pseudoinverse
 LUDecomposition lu()
          LU Decomposition
 AbstractMatrix max()
          Generate a row matrix, each column contents the maximum value of the columns.
 AbstractMatrix mean()
          Generate a row matrix, each column contents the mean value of the columns.
 AbstractMatrix mergeColumns(AbstractDoubleArray B)
          Matrix merging.
 AbstractMatrix mergeRows(AbstractDoubleArray B)
          Matrix merging.
 AbstractMatrix min()
          Generate a row matrix, each column contents the minimum value of the columns.
 AbstractMatrix minus(AbstractDoubleArray B)
          C = A - B
 AbstractMatrix minus(double s)
          Sub a scalar to each element of a matrix, C = A .- B
 void minusEquals(AbstractDoubleArray B)
          C = A - B
 void minusEquals(double s)
          Sub a scalar to each element of a matrix, C = A .- B
 double norm1()
          One norm
 double norm2()
          Two norm
 double normFrobenius()
          Frobenius norm
 double normInfinity()
          Infinity norm
 AbstractMatrix plus(AbstractDoubleArray B)
          C = A + B
 AbstractMatrix plus(double s)
          Add a scalar to each element of a matrix, C = A .+ s
 void plusEquals(AbstractDoubleArray B)
          C = A + B
 void plusEquals(double s)
          Add a scalar to each element of a matrix, C = A .+ s
 AbstractMatrix product()
          Generate a row matrix, each column contents the product value of the columns.
 QRDecomposition qr()
          QR Decomposition
 int rank()
          Matrix rank
 AbstractMatrix reshapeColumns(int m2, int n2)
          Matrix reshaping.
 AbstractMatrix reshapeRows(int m2, int n2)
          Matrix reshaping.
 AbstractMatrix resize(int m2, int n2)
          Matrix resizing.
 AbstractMatrix slice(int _n)
          Slice the matrix
 AbstractMatrix slice(int[] N)
          Slice the matrix
 AbstractMatrix solve(AbstractMatrix B)
          Solve A*X = B
 AbstractMatrix sort(int j)
          Generate a row-permuted matrix, rows are permuted in order to sort the column 'c'
 AbstractMatrix sum()
          Generate a row matrix, each column contents the sum value of the columns.
 SingularValueDecomposition svd()
          Singular Value Decomposition
 AbstractMatrix times(AbstractDoubleArray B)
          Linear algebraic matrix multiplication, A * B
 AbstractMatrix times(double s)
          Multiply a matrix by a scalar, C = s*A
 void timesEquals(double s)
          Multiply a matrix by a scalar, C = s*A
 void toASCIIFile(java.io.File file)
          Save the Matrix in a file.
 void toClipBoard()
          Copy the Matrix into the clipboard
 void toCommandLine(java.lang.String title)
          Print the Matrix in the Command Line.
 void toHist2DPanel(Plot2DPanel panel, java.lang.String name, int num)
          Print the Matrix in a JPanel.
 Plot2DPanel toHist2DPanel(java.lang.String name, int num)
          Print the Matrix in an histogram in a JPanel.
 void toHist3DPanel(Plot3DPanel panel, java.lang.String name, int num)
          Print the Matrix in a JPanel.
 Plot3DPanel toHist3DPanel(java.lang.String name, int num)
          Print the Matrix in a JPanel.
 void toPlot2DPanel(Plot2DPanel panel, java.lang.String name, java.lang.String type)
          Print the Matrix in a JPanel.
 Plot2DPanel toPlot2DPanel(java.lang.String name, java.lang.String type)
          Print the Matrix in a JPanel.
 void toPlot3DPanel(Plot3DPanel panel, java.lang.String name, java.lang.String type)
          Print the Matrix in a JPanel.
 Plot3DPanel toPlot3DPanel(java.lang.String name, java.lang.String type)
          Print the Matrix in a JPanel.
 java.lang.String toString()
          Convert the Matrix into a String
 MatrixTablePanel toTablePanel()
          Print the Matrix in a JPanel.
 org.jdom.Element toXMLElement()
          Convert the Matrix into a MathML (XML) Element
 double trace()
          Matrix trace.
 AbstractMatrix transpose()
          Matrix transpose.
 void transposeEquals()
          Matrix transpose.
 AbstractMatrix uminus()
          Unary minus
 void uminusEquals()
          Unary minus
 AbstractMatrix variance()
          Generate a variance matrix, each column contains values of a pulling.
 
Methods inherited from class org.jmat.data.AbstractDoubleArray
checkColumnDimension, checkColumnDimension, checkDiagonal, checkDimensions, checkDimensions, checkRowDimension, checkRowDimension, checkSymetric, deleteColumnEquals, deleteColumnsEquals, deleteColumnsEquals, deleteRowEquals, deleteRowsEquals, deleteRowsEquals, get, getArrayCopy, getColumnArrayCopy, getColumnDimension, getRowArrayCopy, getRowDimension, insertColumnsEquals, insertRowsEquals, isDiagonal, isEqual, isSymetric, mergeColumnsEquals, mergeRowsEquals, putColumnIn, putColumnsIn, putColumnsIn, putDiagonalIn, putDiagonalIn, putRowIn, putRowsIn, putRowsIn, putSubMatrixIn, reset, reshapeColumnsEquals, reshapeRowsEquals, resizeEquals, set, setAllConstant, setAllDiagonal, setAllIdentity, setAllIncrementColumns, setAllIncrementColumns, setAllIncrementRows, setAllIncrementRows, setAllMergeColumns, setAllMergeRows, setAllRandom, setColumn, setColumn, setColumns, setColumns, setRow, setRow, setRows, setRows, setSubMatrix, setSubMatrix, toDouble, toDouble2DArray, toDoubleArray, toDoubleColumnArray, toDoubleRowArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMatrix

public AbstractMatrix(int _m,
                      int _n)
Construct an m-by-n matrix of zeros.

Parameters:
_m - Number of rows.
_n - Number of colums.
Method Detail

getInstance

public abstract AbstractMatrix getInstance(int _m,
                                           int _n)
Construct an m-by-n matrix of zeros.

Parameters:
_m - Number of rows.
_n - Number of colums.
Returns:
AbstractMatrix

getInstanceCopyOf

public AbstractMatrix getInstanceCopyOf(AbstractMatrix M)
Construct an m-by-n matrix of zeros.

Parameters:
M - Matrix to copy
Returns:
AbstractMatrix

getDoubleArrayCopy

public AbstractDoubleArray getDoubleArrayCopy()
Specified by:
getDoubleArrayCopy in class AbstractDoubleArray

copy

public AbstractMatrix copy()
Copy the Matrix object.

Returns:
A matrix.

getSubMatrix

public AbstractMatrix getSubMatrix(int i0,
                                   int i1,
                                   int j0,
                                   int j1)
Get a submatrix.

Parameters:
i0 - Initial row index
i1 - Final row index
j0 - Initial column index
j1 - Final column index
Returns:
A(i0:i1,j0:j1)

getRow

public AbstractMatrix getRow(int i)
Copy an internal one-dimensional array from a row.

Parameters:
i - Row index
Returns:
one-dimensional array copy of matrix elements.

getRows

public AbstractMatrix getRows(int[] I)
Copy an internal one-dimensional array from many rows.

Parameters:
I - Rows indexes
Returns:
one-dimensional array copy of matrix elements.

getRows

public AbstractMatrix getRows(int i0,
                              int i1)
Copy an internal one-dimensional array from many rows.

Parameters:
i0 - First Rows index
i1 - Last Rows index
Returns:
one-dimensional array copy of matrix elements.

getColumn

public AbstractMatrix getColumn(int j)
Copy an internal one-dimensional array from a column.

Parameters:
j - Column index
Returns:
one-dimensional array copy of matrix elements.

getColumns

public AbstractMatrix getColumns(int[] J)
Copy an internal one-dimensional array from a column.

Parameters:
J - Columns indexes
Returns:
one-dimensional array copy of matrix elements.

getColumns

public AbstractMatrix getColumns(int j0,
                                 int j1)
Copy an internal one-dimensional array from a column.

Parameters:
j0 - First Columns index
j1 - Last Columns index
Returns:
one-dimensional array copy of matrix elements.

getDiagonal

public AbstractMatrix getDiagonal()
Matrix diagonal extraction.

Returns:
An d*1 Matrix of diagonal elements, d = min(m,n).

getDiagonal

public AbstractMatrix getDiagonal(int num)
Matrix diagonal extraction.

Parameters:
num - diagonal number.
Returns:
Matrix of the n-th diagonal elements.

resize

public AbstractMatrix resize(int m2,
                             int n2)
Matrix resizing.

Parameters:
m2 - new lines.
n2 - new columns.
Returns:
resized copy of the Matrix.

reshapeRows

public AbstractMatrix reshapeRows(int m2,
                                  int n2)
Matrix reshaping.

Parameters:
m2 - new lines.
n2 - new columns.
Returns:
reshaped copy of the Matrix.

reshapeColumns

public AbstractMatrix reshapeColumns(int m2,
                                     int n2)
Matrix reshaping.

Parameters:
m2 - new lines.
n2 - new columns.
Returns:
reshaped copy of the Matrix.

mergeRows

public AbstractMatrix mergeRows(AbstractDoubleArray B)
Matrix merging.

Parameters:
B - Matrix to merge.
Returns:
merged Matrix.

mergeColumns

public AbstractMatrix mergeColumns(AbstractDoubleArray B)
Matrix merging.

Parameters:
B - Matrix to merge.
Returns:
merged Matrix.

insertRows

public AbstractMatrix insertRows(int I,
                                 AbstractDoubleArray B)
Insert a Row into Matrix.

Parameters:
I - first row to add index
B - rows to add
Returns:
matrix with inserted rows

insertColumns

public AbstractMatrix insertColumns(int J,
                                    AbstractDoubleArray B)
Insert a Column into Matrix.

Parameters:
J - first column to add index
B - column to add
Returns:
matrix with inserted columns

deleteRow

public AbstractMatrix deleteRow(int I)
delete a Row to Matrix.

Parameters:
I - row number to delete
Returns:
matrix with deleted row

deleteColumn

public AbstractMatrix deleteColumn(int J)
Delete a Column to Matrix.

Parameters:
J - column number to delete
Returns:
matrix with deleted column

deleteRows

public AbstractMatrix deleteRows(int[] I)
delete a Row to Matrix.

Parameters:
I - row number to delete
Returns:
matrix with deleted rows

deleteRows

public AbstractMatrix deleteRows(int i0,
                                 int i1)
delete a Row to Matrix.

Parameters:
i0 - first row index to delete
i1 - last row index to delete
Returns:
matrix with deleted rows

deleteColumns

public AbstractMatrix deleteColumns(int[] J)
Delete a Column to Matrix.

Parameters:
J - column numbers to delete
Returns:
matrix with deleted column

deleteColumns

public AbstractMatrix deleteColumns(int j0,
                                    int j1)
Delete a Column to Matrix.

Parameters:
j0 - first column index to delete
j1 - last column index to delete
Returns:
matrix with deleted column

norm1

public double norm1()
One norm

Returns:
maximum column sum.

norm2

public double norm2()
Two norm

Returns:
maximum singular value.

normInfinity

public double normInfinity()
Infinity norm

Returns:
maximum row sum.

normFrobenius

public double normFrobenius()
Frobenius norm

Returns:
sqrt of sum of squares of all elements.

trace

public double trace()
Matrix trace.

Returns:
sum of the diagonal elements.

determinant

public double determinant()
Matrix determinant

Returns:
determinant

rank

public int rank()
Matrix rank

Returns:
effective numerical rank, obtained from SVD.

condition

public double condition()
Matrix condition (2 norm)

Returns:
ratio of largest to smallest singular value.

min

public AbstractMatrix min()
Generate a row matrix, each column contents the minimum value of the columns.

Returns:
An 1-by-n matrix.

max

public AbstractMatrix max()
Generate a row matrix, each column contents the maximum value of the columns.

Returns:
An 1-by-n matrix.

sum

public AbstractMatrix sum()
Generate a row matrix, each column contents the sum value of the columns.

Returns:
An 1-by-n matrix.

cumSum

public AbstractMatrix cumSum()
Generate a row matrix, each column contents the sum value of the columns.

Returns:
An 1-by-n matrix.

product

public AbstractMatrix product()
Generate a row matrix, each column contents the product value of the columns.

Returns:
An 1-by-n matrix.

cumProduct

public AbstractMatrix cumProduct()
Generate a row matrix, each column contents the product value of the columns.

Returns:
An 1-by-n matrix.

distance

public AbstractMatrix distance(AbstractDoubleArray B,
                               double pow)
Generate a matrix, each column contents the N-distance between the columns.

Parameters:
pow - N
B - Matrix
Returns:
An m-by-B.m matrix.

mean

public AbstractMatrix mean()
Generate a row matrix, each column contents the mean value of the columns.

Returns:
An 1-by-n matrix.

covariance

public AbstractMatrix covariance()
Generate a covariance matrix, each column contains values of a pulling.

Returns:
An n-by-n matrix.

correlation

public AbstractMatrix correlation()
Generate a correlation matrix, each column contains values of a pulling.

Returns:
An n-by-n matrix.

variance

public AbstractMatrix variance()
Generate a variance matrix, each column contains values of a pulling.

Returns:
An 1-by-n matrix.

transpose

public AbstractMatrix transpose()
Matrix transpose.

Returns:
A'

uminus

public AbstractMatrix uminus()
Unary minus

Returns:
-A

plus

public AbstractMatrix plus(double s)
Add a scalar to each element of a matrix, C = A .+ s

Parameters:
s - double
Returns:
A .+ s

plus

public AbstractMatrix plus(AbstractDoubleArray B)
C = A + B

Parameters:
B - another matrix
Returns:
A + B

minus

public AbstractMatrix minus(double s)
Sub a scalar to each element of a matrix, C = A .- B

Parameters:
s - double
Returns:
A .- s

minus

public AbstractMatrix minus(AbstractDoubleArray B)
C = A - B

Parameters:
B - another matrix
Returns:
A - B

times

public AbstractMatrix times(double s)
Multiply a matrix by a scalar, C = s*A

Parameters:
s - scalar
Returns:
s*A

times

public AbstractMatrix times(AbstractDoubleArray B)
Linear algebraic matrix multiplication, A * B

Parameters:
B - another matrix
Returns:
Matrix product, A * B
Throws:
java.lang.IllegalArgumentException - Matrix inner dimensions must agree.

divide

public AbstractMatrix divide(double s)
Multiply a matrix by a scalar, C = s*A

Parameters:
s - scalar
Returns:
s*A

divide

public AbstractMatrix divide(AbstractMatrix B)
Linear algebraic matrix division, A / B

Parameters:
B - another matrix
Returns:
Matrix division, A / B

solve

public AbstractMatrix solve(AbstractMatrix B)
Solve A*X = B

Parameters:
B - right hand side
Returns:
solution if A is square, least squares solution otherwise

inverse

public AbstractMatrix inverse()
Matrix inverse or pseudoinverse

Returns:
inverse(A) if A is square, pseudoinverse otherwise.

transposeEquals

public void transposeEquals()
Matrix transpose.


uminusEquals

public void uminusEquals()
Unary minus


plusEquals

public void plusEquals(double s)
Add a scalar to each element of a matrix, C = A .+ s

Parameters:
s - double

plusEquals

public void plusEquals(AbstractDoubleArray B)
C = A + B

Parameters:
B - another matrix

minusEquals

public void minusEquals(double s)
Sub a scalar to each element of a matrix, C = A .- B

Parameters:
s - double

minusEquals

public void minusEquals(AbstractDoubleArray B)
C = A - B

Parameters:
B - another matrix

timesEquals

public void timesEquals(double s)
Multiply a matrix by a scalar, C = s*A

Parameters:
s - scalar

divideEquals

public void divideEquals(double s)
Multiply a matrix by a scalar, C = s*A

Parameters:
s - scalar

ebeTimes

public AbstractMatrix ebeTimes(AbstractMatrix B)
Element-by-element multiplication, C = A.*B

Parameters:
B - another matrix
Returns:
A.*B

ebeDivide

public AbstractMatrix ebeDivide(AbstractMatrix B)
Element-by-element right division, C = A./B

Parameters:
B - another matrix
Returns:
A./B

ebeCos

public AbstractMatrix ebeCos()
Element-by-element cosinus

Returns:
cos.(A)

ebeSin

public AbstractMatrix ebeSin()
Element-by-element sinus

Returns:
sin.(A)

ebeExp

public AbstractMatrix ebeExp()
Element-by-element exponential

Returns:
exp.(A)

ebePower

public AbstractMatrix ebePower(double p)
Element-by-element power

Parameters:
p - a double
Returns:
A.^p

ebePower

public AbstractMatrix ebePower(Matrix B)
Element-by-element power

Parameters:
B - a matrix
Returns:
A.^B

ebeLog

public AbstractMatrix ebeLog()
Element-by-element neperian logarithm

Returns:
log.(A)

ebeInverse

public AbstractMatrix ebeInverse()
Element-by-element inverse

Returns:
A.^-1

ebeSqrt

public AbstractMatrix ebeSqrt()
Square root of each element

Returns:
sqrt.(A)

ebeAbs

public AbstractMatrix ebeAbs()
Absolute value of each element

Returns:
|A|

ebeFunction

public AbstractMatrix ebeFunction(DoubleFunction fun)
Element-by-element function evaluation

Parameters:
fun - function to apply : f(Aij)
Returns:
f.(A)

ebeTimesEquals

public void ebeTimesEquals(AbstractMatrix B)
Element-by-element multiplication, C = A.*B

Parameters:
B - another matrix

ebeDivideEquals

public void ebeDivideEquals(AbstractMatrix B)
Element-by-element right division, C = A./B

Parameters:
B - another matrix

ebeCosEquals

public void ebeCosEquals()
Element-by-element cosinus


ebeSinEquals

public void ebeSinEquals()
Element-by-element sinus


ebeExpEquals

public void ebeExpEquals()
Element-by-element exponential


ebePowerEquals

public void ebePowerEquals(double p)
Element-by-element power

Parameters:
p - a double

ebePowerEquals

public void ebePowerEquals(AbstractMatrix B)
Element-by-element power

Parameters:
B - a matrix

ebeLogEquals

public void ebeLogEquals()
Element-by-element neperian logarithm


ebeInverseEquals

public void ebeInverseEquals()
Element-by-element inverse


ebeSqrtEquals

public void ebeSqrtEquals()
Element-by-element square root


ebeAbsEquals

public void ebeAbsEquals()
Element-by-element absolute value


ebeFunctionEquals

public void ebeFunctionEquals(DoubleFunction fun)
Element-by-element absolute value

Parameters:
fun - function to apply : f(Aij)

lu

public LUDecomposition lu()
LU Decomposition

Returns:
LUDecomposition
See Also:
LUDecomposition

qr

public QRDecomposition qr()
QR Decomposition

Returns:
QRDecomposition
See Also:
QRDecomposition

cholesky

public CholeskyDecomposition cholesky()
Cholesky Decomposition

Returns:
CholeskyDecomposition
See Also:
CholeskyDecomposition

svd

public SingularValueDecomposition svd()
Singular Value Decomposition

Returns:
SingularValueDecomposition
See Also:
SingularValueDecomposition

eig

public EigenvalueDecomposition eig()
Eigenvalue Decomposition

Returns:
EigenvalueDecomposition
See Also:
EigenvalueDecomposition

sort

public AbstractMatrix sort(int j)
Generate a row-permuted matrix, rows are permuted in order to sort the column 'c'

Parameters:
j - Number of the colum which leads the permuation
Returns:
A Sort.

find

public Finding find(double min,
                    double max)
Find an element

Parameters:
min - Inf bound of values to find
max - Sup bound of values to find
Returns:
A Find.

find

public Finding find(java.lang.String test,
                    double val)
Find an element

Parameters:
test - Test
val - Element (value) to compare
Returns:
A Find.

slice

public AbstractMatrix slice(int[] N)
Slice the matrix

Parameters:
N - Array of number of slices for each column.
Returns:
A Slice.

slice

public AbstractMatrix slice(int _n)
Slice the matrix

Returns:
A Slice.

toString

public java.lang.String toString()
Convert the Matrix into a String

Specified by:
toString in interface StringPrintable
Overrides:
toString in class java.lang.Object
Returns:
A String

toClipBoard

public void toClipBoard()
Copy the Matrix into the clipboard

Specified by:
toClipBoard in interface ClipBoardPrintable

toXMLElement

public org.jdom.Element toXMLElement()
Convert the Matrix into a MathML (XML) Element

Specified by:
toXMLElement in interface XMLPrintable
Returns:
An XML Element

toASCIIFile

public void toASCIIFile(java.io.File file)
Save the Matrix in a file.

Specified by:
toASCIIFile in interface FilePrintable
Parameters:
file - file to save in.

toCommandLine

public void toCommandLine(java.lang.String title)
Print the Matrix in the Command Line.

Specified by:
toCommandLine in interface CommandLinePrintable
Parameters:
title - title to display in the command line.

toTablePanel

public MatrixTablePanel toTablePanel()
Print the Matrix in a JPanel.

Returns:
A JPanel.

toPlot2DPanel

public Plot2DPanel toPlot2DPanel(java.lang.String name,
                                 java.lang.String type)
Print the Matrix in a JPanel.

Parameters:
name - name of the plot.
type - type of displaying.
Returns:
A JPanel.

toPlot3DPanel

public Plot3DPanel toPlot3DPanel(java.lang.String name,
                                 java.lang.String type)
Print the Matrix in a JPanel.

Parameters:
type - type of displaying.
name - name of the plot.
Returns:
A JPanel.

toPlot2DPanel

public void toPlot2DPanel(Plot2DPanel panel,
                          java.lang.String name,
                          java.lang.String type)
Print the Matrix in a JPanel.

Parameters:
panel - Panel to modify.
name - name of the plot.
type - type of displaying.

toPlot3DPanel

public void toPlot3DPanel(Plot3DPanel panel,
                          java.lang.String name,
                          java.lang.String type)
Print the Matrix in a JPanel.

Parameters:
panel - Panel to modify.
name - name of the plot.
type - type of displaying.

toHist2DPanel

public Plot2DPanel toHist2DPanel(java.lang.String name,
                                 int num)
Print the Matrix in an histogram in a JPanel.

Parameters:
name - name of the plot.
num - number of slices.
Returns:
A JPanel.

toHist3DPanel

public Plot3DPanel toHist3DPanel(java.lang.String name,
                                 int num)
Print the Matrix in a JPanel.

Parameters:
num - number of slices.
name - name of the plot.
Returns:
A JPanel.

toHist2DPanel

public void toHist2DPanel(Plot2DPanel panel,
                          java.lang.String name,
                          int num)
Print the Matrix in a JPanel.

Parameters:
panel - Panel to modify.
name - name of the plot.
num - number of slices.

toHist3DPanel

public void toHist3DPanel(Plot3DPanel panel,
                          java.lang.String name,
                          int num)
Print the Matrix in a JPanel.

Parameters:
panel - Panel to modify.
name - name of the plot.
num - number of slices.

fromASCIIFile

public static AbstractMatrix fromASCIIFile(java.io.File file)
Load the Matrix from a file

Parameters:
file - file to load
Returns:
A matrix

fromString

public static AbstractMatrix fromString(java.lang.String s)
Load the Matrix from a String

Parameters:
s - String to load
Returns:
A matrix

fromClipBoard

public static AbstractMatrix fromClipBoard()
                                    throws java.io.IOException,
                                           java.awt.datatransfer.UnsupportedFlavorException
Load the Matrix from the clipboard

Returns:
A matrix
Throws:
java.io.IOException
java.awt.datatransfer.UnsupportedFlavorException

fromXMLElement

public static AbstractMatrix fromXMLElement(org.jdom.Element e)
Load the Matrix from a MathML (XML) Element

Parameters:
e - Element to load
Returns:
A matrix