public class RealSquareMatrix extends RealMatrix
| Modifier and Type | Class and Description |
|---|---|
static class |
RealSquareMatrix.Type
type
|
cols, flmat, rowsC_AMP, C_APOS, C_ATSIGN, C_BACKSLASH, C_BACKSPACE, C_CARET, C_COLON, C_COMMA, C_DEL, C_DOLLAR, C_EQUALS, C_FORMFEED, C_HASH, C_LANGLE, C_LBRAK, C_LCURLY, C_LSQUARE, C_MINUS, C_NBSP, C_NEWLINE, C_NL, C_PERCENT, C_PERIOD, C_PIPE, C_PLUS, C_POUND, C_QUERY, C_QUOT, C_RANGLE, C_RBRAK, C_RCURLY, C_RETURN, C_RSQUARE, C_SEMICOLON, C_SHRIEK, C_SLASH, C_SPACE, C_STAR, C_TAB, C_TILDE, C_UNDER, EPS, F_S, NONWHITEPUNC, NONWHITEPUNC0, NONWHITEPUNC0REGEX, ONE_THIRD, PUNC, S_AMP, S_APOS, S_ATSIGN, S_BACKSLASH, S_CARET, S_COLON, S_COMMA, S_DOLLAR, S_EMPTY, S_EQUALS, S_FORMFEED, S_HASH, S_LANGLE, S_LBRAK, S_LCURLY, S_LSQUARE, S_MINUS, S_NEWLINE, S_NL, S_PERCENT, S_PERIOD, S_PIPE, S_PLUS, S_POUND, S_QUERY, S_QUOT, S_RANGLE, S_RBRAK, S_RCURLY, S_RETURN, S_RSQUARE, S_SEMICOLON, S_SHRIEK, S_SLASH, S_SPACE, S_STAR, S_TAB, S_TILDE, S_UNDER, S_WHITEREGEX, TWO_THIRDS, U_S, WHITESPACE| Constructor and Description |
|---|
RealSquareMatrix()
Constructor.
|
RealSquareMatrix(double[][] matrix)
constructor from array.
|
RealSquareMatrix(int rows)
Constructor.
|
RealSquareMatrix(int rows,
double f)
Creates real square matrix with all elements initialized to double value.
|
RealSquareMatrix(int rows,
double[] array)
Creates real square matrix from array
THE COLUMN IS THE FASTEST MOVING
INDEX, that is the matrix is filled as mat(0,0), mat(0,1) ...
|
RealSquareMatrix(RealMatrix m)
shallow copy from RealMatrix
the array values are not copied (only the reference)
|
RealSquareMatrix(RealMatrix m,
int lowrow,
int lowcol,
int rows)
Constructor for submatrix of another matrix.
|
RealSquareMatrix(RealSquareMatrix m)
copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
RealArray |
calculateEigenvalues() |
RealSquareMatrix |
calculateEigenvectors()
V is an orthogonal matrix, i.e.
|
RealSquareMatrix |
calculateInverse() |
RealSquareMatrix |
copyLowerToUpper()
copy lower triangle into upper triangle.
|
RealSquareMatrix |
copyUpperToLower()
copy upper triangle into lower triangle.
|
double |
determinant()
determinant.
|
static RealSquareMatrix |
diagonal(RealArray f)
create diagonal matrix from real matrix.
|
int |
diagonaliseAndReturnRank(RealArray eigenvalues,
RealSquareMatrix eigenvectors,
EuclidRuntimeException illCond)
diagonalisation returns eigenvalues and vectors as MODIFIED arguments;
'this' is NOT affected USE JAMA INSTEAD Note that IllCondMatrixException
is RETURNED and not thrown
|
static RealSquareMatrix |
fromLowerTriangle(RealArray f)
create square matrix from lower triangle values
upper triangle is filled with zeros
|
static RealSquareMatrix |
fromUpperTriangle(RealArray f)
create square matrix from lower triangle
lower triangle is filled with zeros
|
static RealSquareMatrix |
getCrystallographicOrthogonalisation(double[] celleng,
double[] angle)
create orthogonlisation matrix from cell lengths and angles.
|
RealSquareMatrix |
getInverse()
inversion of matrix.
|
boolean |
isEqualTo(RealSquareMatrix r)
are two matrices identical
|
boolean |
isImproperRotation()
is matrix an improper rotation.
|
boolean |
isLowerTriangular()
is matrix LowerTriangular.
|
boolean |
isOrthogonal()
is matrix orthogonal.
|
boolean |
isOrthonormal()
is matrix unitary.
|
boolean |
isSymmetric()
is matrix symmetric.
|
boolean |
isUnit()
is it a unit matrix.
|
boolean |
isUnitary()
is matrix unitary.
|
boolean |
isUpperTriangular()
is matrix UpperTriangular.
|
RealArray |
lowerTriangle()
copy lower triangle into linear array; order: 0,0; 1,0; 1,1; 2,0
|
RealSquareMatrix |
multiply(RealSquareMatrix m)
matrix multiplication.
|
void |
orthogonalise()
orthogonalise matrix.
|
RealSquareMatrix |
orthonormalize()
orthonormalise matrix.
|
static RealSquareMatrix |
outerProduct(RealArray f)
Creates square matrix from real matrix.
|
RealSquareMatrix |
plus(RealSquareMatrix m)
matrix addition.
|
void |
resetEigenDecomposition() |
void |
shallowCopy(RealSquareMatrix m)
shallowCopy an existing square matrix.
|
RealSquareMatrix |
subtract(RealSquareMatrix m)
matrix subtraction.
|
double |
trace()
trace.
|
void |
transpose()
transpose.
|
appendColumnData, appendColumnData, appendRowData, appendRowData, checkNonEmptyMatrix, clearMatrix, columnwiseDivide, createMatrixWithOriginShifted, deleteColumn, deleteColumns, deleteRow, deleteRows, elementAt, elementAt, elementsInRange, euclideanColumnLength, euclideanColumnLengths, euclideanRowLength, euclideanRowLengths, extractColumnData, extractColumns, extractRowData, extractRows, extractSubMatrixData, format, getCols, getFormat, getIntMatrix, getMatrix, getMatrixAsArray, getRows, getTranspose, indexOfLargestElement, indexOfLargestElementInColumn, indexOfLargestElementInRow, indexOfSmallestElement, indexOfSmallestElementInColumn, indexOfSmallestElementInRow, insertColumnData, insertColumnData, insertRowData, insertRowData, insertRows, isEqualTo, isSquare, isZero, largestElement, largestElementInColumn, largestElementInRow, makeSpaceForNewColumns, multiply, multiply, multiplyBy, multiplyEquals, negative, normaliseByColumns, normaliseByRows, plus, reorderColumnsBy, reorderRowsBy, replaceColumnData, replaceColumnData, replaceColumnData, replaceRowData, replaceRowData, replaceRowData, replaceSubMatrixData, scaleAndInterpolate, setAllElements, setElementAt, setFormat, shallowCopy, smallestElement, smallestElementInColumn, smallestElementInRow, subtract, toString, translateByColumn, writeXMLpublic RealSquareMatrix()
public RealSquareMatrix(int rows)
rows - number of rows and columns values are set to zeropublic RealSquareMatrix(int rows,
double[] array)
throws EuclidRuntimeException
rows - the final rows and cols of real square matrixarray - of size (rows * rows)EuclidRuntimeException - array size must be multiple of rowspublic RealSquareMatrix(int rows,
double f)
rows - size of square matrixf - value of all elementspublic RealSquareMatrix(RealMatrix m, int lowrow, int lowcol, int rows) throws EuclidRuntimeException
m - matrix to slice (need not be square)lowrow - the start row inclusive (count from 0)lowcol - the start column inclusive (count from 0)rows - size of final matrixEuclidRuntimeException - lowrow, lowcol or rows are not consistent with size of
mpublic RealSquareMatrix(RealSquareMatrix m)
m - matrix to copypublic RealSquareMatrix(RealMatrix m) throws EuclidRuntimeException
m - matrix to copy reference fromEuclidRuntimeException - m must be square (that is cols = rows)public RealSquareMatrix(double[][] matrix)
throws EuclidRuntimeException
matrix - to copyEuclidRuntimeException - matrix is not square (might even not be
rectangular!)public static RealSquareMatrix outerProduct(RealArray f)
f - real array (length rows) multiplied to give outer productpublic static RealSquareMatrix diagonal(RealArray f)
f - real array (length rows)public void shallowCopy(RealSquareMatrix m) throws EuclidRuntimeException
m - matrix to shallow copyEuclidRuntimeException - m must have the same number of rows and cols as
thispublic static RealSquareMatrix fromLowerTriangle(RealArray f)
f - real array (length rows * (rows+1) / 2)public static RealSquareMatrix fromUpperTriangle(RealArray f)
f - real array (length rows * (rows+1) / 2)public boolean isEqualTo(RealSquareMatrix r)
r - matrix to comparepublic RealSquareMatrix plus(RealSquareMatrix m) throws EuclidRuntimeException
m - matrix to addEuclidRuntimeException - m must have the same number of rows and cols as
thispublic RealSquareMatrix subtract(RealSquareMatrix m) throws EuclidRuntimeException
m - matrix to subtract from thisEuclidRuntimeException - m must have the same number of rows and cols as
thispublic RealSquareMatrix multiply(RealSquareMatrix m) throws EuclidRuntimeException
this*m m - matrix to multiply byEuclidRuntimeException - m must have the same number of rows as this
has colspublic double determinant()
public double trace()
public boolean isUnit()
public boolean isSymmetric()
public RealSquareMatrix orthonormalize()
EuclidRuntimeException - I have only written this for this.rows up to 3.
If anyone can find a routine, this will disappear ... -(public boolean isOrthonormal()
public boolean isUpperTriangular()
public boolean isLowerTriangular()
public boolean isOrthogonal()
isOrthogonal in class RealMatrixpublic boolean isImproperRotation()
public boolean isUnitary()
public RealSquareMatrix copyUpperToLower()
public RealSquareMatrix copyLowerToUpper()
public RealArray lowerTriangle()
public void transpose()
public int diagonaliseAndReturnRank(RealArray eigenvalues, RealSquareMatrix eigenvectors, EuclidRuntimeException illCond) throws EuclidRuntimeException
eigenvalues - eigenvectors - illCond - EuclidRuntimeException - must have at least order 2public void orthogonalise()
throws EuclidRuntimeException
EuclidRuntimeException - I have only written this for this.rows up to 3.
If anyone can find a routine, this will disappear ... -(public RealArray calculateEigenvalues()
public RealSquareMatrix calculateInverse()
public RealSquareMatrix calculateEigenvectors()
public void resetEigenDecomposition()
public static RealSquareMatrix getCrystallographicOrthogonalisation(double[] celleng, double[] angle)
celleng - 3 lengthsangle - 3 angles in degreespublic RealSquareMatrix getInverse() throws EuclidRuntimeException
EuclidRuntimeException - singular matrix (or worse!)Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.