visad.matrix
Class JamaMatrix
- java.lang.Object
-
- visad.ThingImpl
-
- visad.DataImpl
-
- visad.FunctionImpl
-
- visad.FieldImpl
-
- visad.FlatField
-
- visad.matrix.JamaMatrix
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Data, Field, FlatFieldIface, Function, Thing
public class JamaMatrix extends FlatField
JamaMatrix is a VisAD wrapper for JAMA matrices. This class requires the JAMA package.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class visad.DataImpl
DataImpl.Syncher
-
-
Field Summary
-
Fields inherited from interface visad.Data
ABS, ACOS, ACOS_DEGREES, ADD, ASIN, ASIN_DEGREES, ATAN, ATAN_DEGREES, ATAN2, ATAN2_DEGREES, CEIL, COS, COS_DEGREES, DEGREES_TO_RADIANS, DEPENDENT, DIVIDE, EXP, FLOOR, INDEPENDENT, INV_ATAN2, INV_ATAN2_DEGREES, INV_DIVIDE, INV_POW, INV_REMAINDER, INV_SUBTRACT, LOG, MAX, MIN, MULTIPLY, NEAREST_NEIGHBOR, NEGATE, NO_ERRORS, NOP, POW, RADIANS_TO_DEGREES, REMAINDER, RINT, ROUND, SIN, SIN_DEGREES, SQRT, SUBTRACT, TAN, TAN_DEGREES, WEIGHTED_AVERAGE
-
-
Constructor Summary
Constructors Constructor and Description JamaMatrix(double[][] entries)Construct a new JamaMatrix from the given matrix entries.JamaMatrix(int rows, int cols)Construct a new JamaMatrix from the given matrix dimensions.JamaMatrix(java.lang.Object matrix)Construct a new JamaMatrix from the given JAMA Matrix.JamaMatrix(java.lang.Object matrix, CoordinateSystem range_coord_sys, CoordinateSystem[] range_coord_syses, Set[] range_sets, Unit[] units)Construct a new JamaMatrix from the specified JAMA Matrix, coordinate systems, range sets and units.JamaMatrix(java.lang.Object matrix, FunctionType type, Gridded2DSet domain_set)Construct a new JamaMatrix from the given JAMA Matrix, MathType and domain set.JamaMatrix(java.lang.Object matrix, FunctionType type, Gridded2DSet domain_set, CoordinateSystem range_coord_sys, CoordinateSystem[] range_coord_syses, Set[] range_sets, Unit[] units)Construct a new JamaMatrix from the specified JAMA Matrix, MathType, domain set, coordinate systems, range sets and units.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description JamaMatrixarrayLeftDivide(JamaMatrix B)Element-by-element left division, C = A.\BJamaMatrixarrayLeftDivideEquals(JamaMatrix B)Element-by-element left division in place, A = A.\BJamaMatrixarrayRightDivide(JamaMatrix B)Element-by-element right division, C = A./BJamaMatrixarrayRightDivideEquals(JamaMatrix B)Element-by-element right division in place, A = A./BJamaMatrixarrayTimes(JamaMatrix B)Element-by-element multiplication, C = A.*BJamaMatrixarrayTimesEquals(JamaMatrix B)Element-by-element multiplication in place, A = A.*BJamaCholeskyDecompositionchol()doublecond()Matrix condition (2 norm).static JamaMatrixconvertToMatrix(FlatField field)Attempt to convert the given VisAD FlatField to a VisAD JamaMatrix Data object.doubledet()Matrix determinant.JamaEigenvalueDecompositioneig()doubleget(int i, int j)Get a single element.intgetColumnDimension()Get column dimension.java.lang.ObjectgetMatrix()Return the associated JAMA Matrix object.JamaMatrixgetMatrix(int[] r, int[] c)Get a submatrix.JamaMatrixgetMatrix(int[] r, int j0, int j1)Get a submatrix.JamaMatrixgetMatrix(int i0, int i1, int[] c)Get a submatrix.JamaMatrixgetMatrix(int i0, int i1, int j0, int j1)Get a submatrix.intgetRowDimension()Get row dimension.static JamaMatrixidentity(int m, int n)Generate identity matrix.JamaMatrixinverse()Matrix inverse or pseudoinverse.JamaLUDecompositionlu()static voidmain(java.lang.String[] args)Test the JamaMatrix class.JamaMatrixminus(JamaMatrix B)C = A - BJamaMatrixminusEquals(JamaMatrix B)A = A - Bdoublenorm1()One norm.doublenorm2()Two norm.doublenormF()Frobenius norm.doublenormInf()Infinity norm.JamaMatrixplus(JamaMatrix B)C = A + BJamaMatrixplusEquals(JamaMatrix B)A = A + Bvoidprint(int w, int d)Print the matrix to stdout.voidprint(java.text.NumberFormat format, int width)Print the matrix to stdout.voidprint(java.io.PrintWriter output, int w, int d)Print the matrix to the output stream.voidprint(java.io.PrintWriter output, java.text.NumberFormat format, int width)Print the matrix to the output stream.JamaQRDecompositionqr()static JamaMatrixrandom(int m, int n)Generate matrix with random elements.intrank()Matrix rank.static JamaMatrixread(java.io.BufferedReader input)Read a matrix from a stream.voidset(int i, int j, double s)Set a single element.voidsetMatrix(double[][] entries)Set this matrix's samples to correspond to the given entries.voidsetMatrix(int[] r, int[] c, JamaMatrix X)Set a submatrix.voidsetMatrix(int[] r, int j0, int j1, JamaMatrix X)Set a submatrix.voidsetMatrix(int i0, int i1, int[] c, JamaMatrix X)Set a submatrix.voidsetMatrix(int i0, int i1, int j0, int j1, JamaMatrix X)Set a submatrix.voidsetMatrix(java.lang.Object matrix)Set this matrix's samples to correspond to those of the given JAMA Matrix.JamaMatrixsolve(JamaMatrix B)Solve A*X = BJamaMatrixsolveTranspose(JamaMatrix B)Solve X*A = B, which is also A'*X' = B'JamaSingularValueDecompositionsvd()JamaMatrixtimes(double s)Multiply a matrix by a scalar, C = s*AJamaMatrixtimes(JamaMatrix B)Linear algebraic matrix multiplication, A * BJamaMatrixtimesEquals(double s)Multiply a matrix by a scalar in place, A = s*Adoubletrace()Matrix trace.JamaMatrixtranspose()Matrix transpose.JamaMatrixuminus()Unary minus.-
Methods inherited from class visad.FlatField
adjustSamplingError, binary, clearMissing, clone, computeRanges, convertToField, derivative, derivative, derivative, derivative, derivative, equals, extract, extract, fillField, getDefaultRangeUnits, getFloats, getFloats, getRangeCoordinateSystem, getRangeCoordinateSystem, getRangeDimension, getRangeErrors, getRangeSets, getRangeUnits, getSample, getSample, getStringValues, getValues, getValues, getValues, grabBytes, isFlatField, isMissing, longString, makeField, makeField1, makeField2, resample, resampleDouble, setRangeErrors, setSample, setSample, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, toString, unary, unpackFloats, unpackValues
-
Methods inherited from class visad.FieldImpl
__getitem__, __len__, __setitem__, __setitem__, combine, combine, combine, combine, combine, domainEnumeration, domainFactor, domainFactor, domainMultiply, domainMultiply, domainMultiply, domainMultiply, extract, extract, getDomainCoordinateSystem, getDomainSet, getDomainUnits, getLength, setSample, setSample, setSample, setSamples
-
Methods inherited from class visad.FunctionImpl
__getitem__, __getitem__, evaluate, evaluate, evaluate, evaluate, getDomainDimension, resample
-
Methods inherited from class visad.DataImpl
__add__, __add__, __div__, __div__, __mod__, __mod__, __mul__, __mul__, __neg__, __pow__, __pow__, __radd__, __rdiv__, __rmod__, __rmul__, __rpow__, __rsub__, __sub__, __sub__, abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, notifyReferences, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, unary
-
Methods inherited from class visad.ThingImpl
addReference, removeReference
-
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface visad.Field
domainEnumeration, domainFactor, domainMultiply, domainMultiply, getDomainSet, getLength, setSample, setSample
-
Methods inherited from interface visad.Function
evaluate, evaluate, evaluate, evaluate, getDomainCoordinateSystem, getDomainDimension, getDomainUnits, resample
-
Methods inherited from interface visad.Data
abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, unary
-
Methods inherited from interface visad.Thing
addReference, removeReference
-
-
-
-
Constructor Detail
-
JamaMatrix
public JamaMatrix(int rows, int cols) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionConstruct a new JamaMatrix from the given matrix dimensions.- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
JamaMatrix
public JamaMatrix(double[][] entries) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionConstruct a new JamaMatrix from the given matrix entries.- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
JamaMatrix
public JamaMatrix(java.lang.Object matrix) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionConstruct a new JamaMatrix from the given JAMA Matrix.- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
JamaMatrix
public JamaMatrix(java.lang.Object matrix, FunctionType type, Gridded2DSet domain_set) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionConstruct a new JamaMatrix from the given JAMA Matrix, MathType and domain set.- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
JamaMatrix
public JamaMatrix(java.lang.Object matrix, CoordinateSystem range_coord_sys, CoordinateSystem[] range_coord_syses, Set[] range_sets, Unit[] units) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionConstruct a new JamaMatrix from the specified JAMA Matrix, coordinate systems, range sets and units.- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
JamaMatrix
public JamaMatrix(java.lang.Object matrix, FunctionType type, Gridded2DSet domain_set, CoordinateSystem range_coord_sys, CoordinateSystem[] range_coord_syses, Set[] range_sets, Unit[] units) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionConstruct a new JamaMatrix from the specified JAMA Matrix, MathType, domain set, coordinate systems, range sets and units.- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
-
Method Detail
-
convertToMatrix
public static JamaMatrix convertToMatrix(FlatField field) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Attempt to convert the given VisAD FlatField to a VisAD JamaMatrix Data object.- Returns:
- The converted object, or null if it could not be converted
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
main
public static void main(java.lang.String[] args) throws VisADException, java.rmi.RemoteExceptionTest the JamaMatrix class.- Throws:
VisADExceptionjava.rmi.RemoteException
-
getMatrix
public java.lang.Object getMatrix()
Return the associated JAMA Matrix object.
-
setMatrix
public void setMatrix(java.lang.Object matrix) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionSet this matrix's samples to correspond to those of the given JAMA Matrix.- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
setMatrix
public void setMatrix(double[][] entries) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionSet this matrix's samples to correspond to the given entries.- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
getRowDimension
public int getRowDimension() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionGet row dimension.- Returns:
- The number of rows
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
getColumnDimension
public int getColumnDimension() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionGet column dimension.- Returns:
- The number of columns
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
get
public double get(int i, int j) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionGet a single element.- Parameters:
i- Row indexj- Column index- Returns:
- A(i,j)
- Throws:
java.lang.ArrayIndexOutOfBoundsExceptionVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
getMatrix
public JamaMatrix getMatrix(int i0, int i1, int j0, int j1) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Get a submatrix.- Parameters:
i0- Initial row indexi1- Final row indexj0- Initial column indexj1- Final column index- Returns:
- A(i0:i1,j0:j1)
- Throws:
java.lang.ArrayIndexOutOfBoundsException- Submatrix indicesVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
getMatrix
public JamaMatrix getMatrix(int[] r, int[] c) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Get a submatrix.- Parameters:
r- Array of row indicesc- Array of column indices- Returns:
- A(r(:),c(:))
- Throws:
java.lang.ArrayIndexOutOfBoundsException- Submatrix indicesVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
getMatrix
public JamaMatrix getMatrix(int i0, int i1, int[] c) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Get a submatrix.- Parameters:
i0- Initial row indexi1- Final row indexc- Array of column indices- Returns:
- A(i0:i1,c(:))
- Throws:
java.lang.ArrayIndexOutOfBoundsException- Submatrix indicesVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
getMatrix
public JamaMatrix getMatrix(int[] r, int j0, int j1) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Get a submatrix.- Parameters:
r- Array of row indicesj0- Initial column indexj1- Final column index- Returns:
- A(r(:),j0:j1)
- Throws:
java.lang.ArrayIndexOutOfBoundsException- Submatrix indicesVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
set
public void set(int i, int j, double s) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionSet a single element.- Parameters:
i- Row indexj- Column indexs- A(i,j)- Throws:
java.lang.ArrayIndexOutOfBoundsExceptionVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
setMatrix
public void setMatrix(int i0, int i1, int j0, int j1, JamaMatrix X) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionSet a submatrix.- Parameters:
i0- Initial row indexi1- Final row indexj0- Initial column indexj1- Final column indexX- A(i0:i1,j0:j1)- Throws:
java.lang.ArrayIndexOutOfBoundsException- Submatrix indicesVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
setMatrix
public void setMatrix(int[] r, int[] c, JamaMatrix X) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionSet a submatrix.- Parameters:
r- Array of row indicesc- Array of column indicesX- A(r(:),c(:))- Throws:
java.lang.ArrayIndexOutOfBoundsException- Submatrix indicesVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
setMatrix
public void setMatrix(int[] r, int j0, int j1, JamaMatrix X) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionSet a submatrix.- Parameters:
r- Array of row indicesj0- Initial column indexj1- Final column indexX- A(r(:),j0:j1)- Throws:
java.lang.ArrayIndexOutOfBoundsException- Submatrix indicesVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
setMatrix
public void setMatrix(int i0, int i1, int[] c, JamaMatrix X) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionSet a submatrix.- Parameters:
i0- Initial row indexi1- Final row indexc- Array of column indicesX- A(i0:i1,c(:))- Throws:
java.lang.ArrayIndexOutOfBoundsException- Submatrix indicesVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
transpose
public JamaMatrix transpose() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Matrix transpose.- Returns:
- A'
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
norm1
public double norm1() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionOne norm.- Returns:
- maximum column sum
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
norm2
public double norm2() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionTwo norm.- Returns:
- maximum singular value
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
normInf
public double normInf() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionInfinity norm.- Returns:
- maximum row sum
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
normF
public double normF() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionFrobenius norm.- Returns:
- sqrt of sum of squares of all elements
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
uminus
public JamaMatrix uminus() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Unary minus.- Returns:
- -A
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
plus
public JamaMatrix plus(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
C = A + B- Parameters:
B- another matrix- Returns:
- A + B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
plusEquals
public JamaMatrix plusEquals(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
A = A + B- Parameters:
B- another matrix- Returns:
- A + B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
minus
public JamaMatrix minus(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
C = A - B- Parameters:
B- another matrix- Returns:
- A - B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
minusEquals
public JamaMatrix minusEquals(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
A = A - B- Parameters:
B- another matrix- Returns:
- A - B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
arrayTimes
public JamaMatrix arrayTimes(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Element-by-element multiplication, C = A.*B- Parameters:
B- another matrix- Returns:
- A.*B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
arrayTimesEquals
public JamaMatrix arrayTimesEquals(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Element-by-element multiplication in place, A = A.*B- Parameters:
B- another matrix- Returns:
- A.*B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
arrayRightDivide
public JamaMatrix arrayRightDivide(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Element-by-element right division, C = A./B- Parameters:
B- another matrix- Returns:
- A./B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
arrayRightDivideEquals
public JamaMatrix arrayRightDivideEquals(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Element-by-element right division in place, A = A./B- Parameters:
B- another matrix- Returns:
- A./B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
arrayLeftDivide
public JamaMatrix arrayLeftDivide(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Element-by-element left division, C = A.\B- Parameters:
B- another matrix- Returns:
- A.\B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
arrayLeftDivideEquals
public JamaMatrix arrayLeftDivideEquals(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Element-by-element left division in place, A = A.\B- Parameters:
B- another matrix- Returns:
- A.\B
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
times
public JamaMatrix times(double s) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Multiply a matrix by a scalar, C = s*A- Parameters:
s- scalar- Returns:
- s*A
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
timesEquals
public JamaMatrix timesEquals(double s) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Multiply a matrix by a scalar in place, A = s*A- Parameters:
s- scalar- Returns:
- replace A by s*A
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
times
public JamaMatrix times(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Linear algebraic matrix multiplication, A * B- Parameters:
B- another matrix- Returns:
- Matrix product, A * B
- Throws:
java.lang.IllegalArgumentException- Matrix inner dimensions must agreeVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
solve
public JamaMatrix solve(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Solve A*X = B- Parameters:
B- right hand side- Returns:
- solution if A is square, least squares solution otherwise
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
solveTranspose
public JamaMatrix solveTranspose(JamaMatrix B) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Solve X*A = B, which is also A'*X' = B'- Parameters:
B- right hand side- Returns:
- solution if A is square, least squares solution otherwise
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
inverse
public JamaMatrix inverse() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Matrix inverse or pseudoinverse.- Returns:
- inverse(A) if A is square, pseudoinverse otherwise
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
det
public double det() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionMatrix determinant.- Returns:
- determinant
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
rank
public int rank() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionMatrix rank.- Returns:
- effective numerical rank, obtained from SVD
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
cond
public double cond() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionMatrix condition (2 norm).- Returns:
- ratio of largest to smallest singular value
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
trace
public double trace() throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionMatrix trace.- Returns:
- sum of the diagonal elements
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
random
public static JamaMatrix random(int m, int n) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Generate matrix with random elements.- Parameters:
m- Number of rowsn- Number of colums- Returns:
- An m-by-n matrix with uniformly distributed random elements
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
identity
public static JamaMatrix identity(int m, int n) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Generate identity matrix.- Parameters:
m- Number of rowsn- Number of colums- Returns:
- An m-by-n matrix with ones on the diagonal and zeros elsewhere
- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
print
public void print(int w, int d) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionPrint the matrix to stdout. Line the elements up in columns with a Fortran-like 'Fw.d' style format- Parameters:
w- Column widthd- Number of digits after the decimal- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
print
public void print(java.io.PrintWriter output, int w, int d) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionPrint the matrix to the output stream. Line the elements up in columns with a Fortran-like 'Fw.d' style format.- Parameters:
output- Output streamw- Column widthd- Number of digits after the decimal- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
print
public void print(java.text.NumberFormat format, int width) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionPrint the matrix to stdout. Line the elements up in columns. Use the format object, and right justify within columns of width characters.- Parameters:
format- Formatting object for individual elementswidth- Field width for each column- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
print
public void print(java.io.PrintWriter output, java.text.NumberFormat format, int width) throws VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionPrint the matrix to the output stream. Line the elements up in columns. Use the format object, and right justify within columns of width characters.- Parameters:
output- the output streamformat- A formatting object to format the matrix elementswidth- Column width- Throws:
VisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
read
public static JamaMatrix read(java.io.BufferedReader input) throws java.io.IOException, VisADException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Read a matrix from a stream. The format is the same the print method, so printed matrices can be read back in. Elements are separated by whitespace, all the elements for each row appear on a single line, the last row is followed by a blank line.- Parameters:
input- the input stream- Throws:
java.io.IOExceptionVisADExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
chol
public JamaCholeskyDecomposition chol() throws VisADException, java.rmi.RemoteException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
- Throws:
VisADExceptionjava.rmi.RemoteExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
eig
public JamaEigenvalueDecomposition eig() throws VisADException, java.rmi.RemoteException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
- Throws:
VisADExceptionjava.rmi.RemoteExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
lu
public JamaLUDecomposition lu() throws VisADException, java.rmi.RemoteException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
- Throws:
VisADExceptionjava.rmi.RemoteExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
qr
public JamaQRDecomposition qr() throws VisADException, java.rmi.RemoteException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
- Throws:
VisADExceptionjava.rmi.RemoteExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
svd
public JamaSingularValueDecomposition svd() throws VisADException, java.rmi.RemoteException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
- Throws:
VisADExceptionjava.rmi.RemoteExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
-
DMelt 3.0 © DataMelt by jWork.ORG