Class BasicMatrix<N extends Comparable<N>, M extends BasicMatrix<N,M> >
java.lang.Object
org.ojalgo.matrix.BasicMatrix<N,M>
- All Implemented Interfaces:
Group, Group.Additive<M>, NormedVectorSpace<M,N>, Operation, Operation.Addition<M>, Operation.Multiplication<M>, Operation.Subtraction<M>, ScalarOperation, ScalarOperation.Addition<M, N>, ScalarOperation.Division<M, N>, ScalarOperation.Multiplication<M, N>, ScalarOperation.Subtraction<M, N>, VectorSpace<M, N>, Matrix2D<N, M>, Provider2D, Provider2D.Condition, Provider2D.Determinant<N>, Provider2D.Eigenpairs, Provider2D.Hermitian, Provider2D.Inverse<M>, Provider2D.Rank, Provider2D.Solution<M>, Provider2D.Symmetric, Provider2D.Trace<N>, Access1D<N>, Access1D.Aggregatable<N>, Access2D<N>, Access2D.Aggregatable<N>, Access2D.Collectable<N, TransformableRegion<N>>, Operate2D<N, M>, Structure1D, Structure2D, Structure2D.Logical<Access2D<N>, M>, Structure2D.ReducibleTo1D<M>, NumberContext.Enforceable<M>
- Direct Known Subclasses:
MatrixC128, MatrixH256, MatrixQ128, MatrixR032, MatrixR064, MatrixR128
public abstract class BasicMatrix<N extends Comparable<N>, M extends BasicMatrix<N,M>>
extends Object
implements Matrix2D<N,M>, Structure2D.ReducibleTo1D<M>, NumberContext.Enforceable<M>, Access2D.Collectable<N, TransformableRegion<N>>, Provider2D.Inverse<M>, Provider2D.Condition, Provider2D.Rank, Provider2D.Symmetric, Provider2D.Hermitian, Provider2D.Trace<N>, Provider2D.Determinant<N>, Provider2D.Solution<M>, Provider2D.Eigenpairs, Structure2D.Logical<Access2D<N>, M>, Operate2D<N,M>
A base class for, easy to use, immutable (thread safe) matrices with a rich feature set. This class handles
a lot of complexity, and makes choices, for you. If you want more control, and to be exposed to all the
implementation details, then look at the various interfaces/classes in the
org.ojalgo.matrix.store and org.ojalgo.matrix.decomposition packages.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Access2D
Access2D.Aggregatable<N>, Access2D.Collectable<N,R>, Access2D.ColumnView<N>, Access2D.ElementView<N>, Access2D.RowView<N>, Access2D.SelectionView<N>, Access2D.Sliceable<N>, Access2D.Visitable<N> Nested classes/interfaces inherited from interface Group
Group.Additive<T>, Group.Multiplicative<T>Nested classes/interfaces inherited from interface Operation
Operation.Addition<T>, Operation.Division<T>, Operation.Multiplication<T>, Operation.Subtraction<T>Nested classes/interfaces inherited from interface Provider2D
Provider2D.Condition, Provider2D.Determinant<N>, Provider2D.Eigenpairs, Provider2D.Hermitian, Provider2D.Inverse<M>, Provider2D.Rank, Provider2D.Solution<M>, Provider2D.Symmetric, Provider2D.Trace<N>Nested classes/interfaces inherited from interface ScalarOperation
ScalarOperation.Addition<T,N>, ScalarOperation.Division<T, N>, ScalarOperation.Multiplication<T, N>, ScalarOperation.Subtraction<T, N> Nested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S,B>, Structure1D.LongIndex, Structure1D.LoopCallback Nested classes/interfaces inherited from interface Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S,B>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R>, Structure2D.Reshapable, Structure2D.RowColumnKey<R, C>, Structure2D.RowColumnMapper<R, C> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final NumberContextprivate MatrixDecomposition<N> private final PhysicalStore.Factory<N, ?> private intprivate Booleanprivate Booleanprivate MatrixStore<N> private final ElementsSupplier<N> private Boolean -
Constructor Summary
ConstructorsConstructorDescriptionBasicMatrix(PhysicalStore.Factory<N, ?> factory, ElementsSupplier<N> supplier) -
Method Summary
Modifier and TypeMethodDescriptionabove(long numberOfRows) add(double scalarAddend) aggregateColumn(long row, long col, Aggregator aggregator) aggregateDiagonal(long row, long col, Aggregator aggregator) aggregateRange(long first, long limit, Aggregator aggregator) aggregateRow(long row, long col, Aggregator aggregator) below(long numberOfRows) bidiagonal(boolean upper) static <M extends BasicMatrix<?,M>>
doublecalculateFrobeniusNorm(M matrix) The Frobenius norm is the square root of the sum of the squares of each element, or the square root of the sum of the square of the singular values.static <M extends BasicMatrix<?,M>>
doublecalculateInfinityNorm(M matrix) static <M extends BasicMatrix<?,M>>
doublecalculateOneNorm(M matrix) column(int column) column(long column) columns(int... columns) A selection (re-ordering) of columns.columns(long... columns) This method will (most likely) be moved to some other interface in the future! Just have to figure out where it fits...abstract DenseMutator2D<N, M> copy()The returned instance can have its elements mutated in various ways, while the size/shape is fixed.longcount()count() == countRows() * countColumns()longOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.longOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.diagonal()diagonally(Access2D<N>... diagonally) divide(double scalarDivisor) doubledoubleValue(int row, int col) Extracts one element of this matrix as a double.doubledoubleValue(long index) enforce(NumberContext context) booleantrue if "other" is anAccess2Dof the same size/shape and the elements are equal to high precision (12 significant digits).get()Deprecated.v50 No need for this!get(long index) get(long row, long col) intdoubleMatrix condition (2-norm)private Provider2D.Conditionprivate Provider2D.Determinant<N> private Provider2D.Eigenpairsprivate Provider2D.Inverse<Optional<MatrixStore<N>>> getInverseProvider(boolean safe) intgetRank()The rank of a matrix is the (maximum) number of linearly independent rows or columns it contains.private Provider2D.Rankintprivate Provider2D.Solution<Optional<MatrixStore<N>>> getSolutionProvider(boolean safe, Access2D<?> rhs) getTrace()The sum of the diagonal elements.inthashCode()hermitian(boolean upper) Similar toStructure2D.Logical.symmetric(boolean)but in addition the mirrored elements are conjugated.hessenberg(boolean upper) longinvert()About inverting matrices:booleanbooleanisSmall(double comparedTo) booleanleft(long numberOfColumns) limits(long rowLimit, long columnLimit) Setting either limit to < 0 is interpreted as "no limit" (useful when you only want to limit either the rows or columns, and don't know the size of the other)final Mlogical()Deprecated.v50 No need for this!multiply(double scalarMultiplicand) negate()The additive inverse of this.newCholesky(Structure2D typical) (package private) abstract DeterminantTask<N> newDeterminantTask(Structure2D template) (package private) abstract Eigenvalue<N> newEigenvalue(Structure2D typical) (package private) abstract MnewInstance(ElementsSupplier<N> store) (package private) abstract InverterTask<N> newInverterTask(Structure2D template) newLDL(Structure2D typical) newLDU(Structure2D typical) newLU(Structure2D typical) newQR(Structure2D typical) (package private) abstract SingularValue<N> newSingularValue(Structure2D typical) (package private) abstract SolverTask<N> newSolverTask(Structure2D templateBody, Structure2D templateRHS) doublenorm()The Frobenius norm is the square root of the sum of the squares of each element, or the square root of the sum of the square of the singular values.offsets(long rowOffset, long columnOffset) onAll(double left, BinaryFunction<N> operator) onAll(N left, BinaryFunction<N> operator) onAll(BinaryFunction<N> operator, double right) onAll(BinaryFunction<N> operator, N right) onAll(ParameterFunction<N> operator, int parameter) onAll(UnaryFunction<N> operator) onAny(Transformation2D<N> operator) onColumns(BinaryFunction<N> operator, Access1D<N> right) onColumns(Access1D<N> left, BinaryFunction<N> operator) onCompatible(BinaryFunction<N> operator, Access2D<N> right) onCompatible(Access2D<N> left, BinaryFunction<N> operator) onMatching(BinaryFunction<N> operator, Access2D<N> right) onMatching(Access2D<N> left, BinaryFunction<N> operator) onRows(BinaryFunction<N> operator, Access1D<N> right) onRows(Access1D<N> left, BinaryFunction<N> operator) power(int power) Multiply by itselfpowertimes.reduceColumns(Aggregator aggregator) reduceRows(Aggregator aggregator) repeat(int rowsRepetitions, int columnsRepetitions) Will repeat this structure creating a new structure with a multiple of rows and columns.right(long numberOfColumns) row(int row) row(long row) rows(int... rows) A selection (re-ordering) of rows.rows(long... rows) select(int[] rows, int[] columns) select(long[] rows, long[] columns) Creates a view of the underlying data structure of only the selected elements.signum()this == this.signum().multiply(this.norm())intsize()size() == getRowDim() * getColDim()This method solves a system of linear equations: [this][X]=[rhs].(package private) MatrixStore<N> store()subtract(double scalarSubtrahend) superimpose(long row, long col, Access2D<N> matrix) (package private) ElementsSupplier<N> supplier()voidsupplyTo(TransformableRegion<N> receiver) symmetric(boolean upper) Defines a symmetricStructure2D(matrix) by mirroring one half (diagonally) on the other.toScalar(int row, int col) Extracts one element of this matrix as a Scalar.toString()Transposes this matrix.triangular(boolean upper, boolean assumeOne) Methods inherited from interface Access1D
asCollectable1D, asKeyed1D, asList, axpy, dot, select, supplyTo, toList, toRawCopy1DMethods inherited from interface Access1D.Aggregatable
aggregateAllMethods inherited from interface Access2D
asCollectable2D, asKeyed2D, byteValue, byteValue, byteValue, byteValue, columns, doubleValue, doubleValue, elements, floatValue, floatValue, floatValue, floatValue, intValue, intValue, intValue, intValue, longValue, longValue, longValue, longValue, nonzeros, rows, shortValue, shortValue, shortValue, shortValue, toRawCopy2DMethods inherited from interface Access2D.Aggregatable
aggregateColumn, aggregateDiagonal, aggregateRow, reduceColumns, reduceRowsMethods inherited from interface Access2D.Collectable
collectMethods inherited from interface ScalarOperation.Addition
addMethods inherited from interface ScalarOperation.Division
divideMethods inherited from interface ScalarOperation.Multiplication
multiplyMethods inherited from interface ScalarOperation.Subtraction
subtractMethods inherited from interface Structure2D
firstInColumn, firstInRow, getMaxDim, getMinDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRowMethods inherited from interface Structure2D.Logical
superimpose
-
Field Details
-
EQUALS
-
myDecomposition
-
myFactory
-
myHashCode
private transient int myHashCode -
myHermitian
-
mySPD
-
myStore
-
mySupplier
-
mySymmetric
-
-
Constructor Details
-
BasicMatrix
BasicMatrix(PhysicalStore.Factory<N, ?> factory, ElementsSupplier<N> supplier)
-
-
Method Details
-
calculateFrobeniusNorm
The Frobenius norm is the square root of the sum of the squares of each element, or the square root of the sum of the square of the singular values.- Returns:
- The matrix' Frobenius norm
-
calculateInfinityNorm
- Returns:
- The inf-norm or maximum row sum
-
calculateOneNorm
- Returns:
- The 1-norm or maximum column sum
-
above
- Specified by:
abovein interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
above
- Specified by:
abovein interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
above
- Specified by:
abovein interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
add
- Specified by:
addin interfaceScalarOperation.Addition<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
this + scalarAddend.
-
add
- Specified by:
addin interfaceOperation.Addition<N extends Comparable<N>>- Parameters:
addend- What to add- Returns:
this + addend
-
add
- Specified by:
addin interfaceScalarOperation.Addition<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
this + scalarAddend.
-
aggregateColumn
- Specified by:
aggregateColumnin interfaceAccess2D.Aggregatable<N extends Comparable<N>>
-
aggregateDiagonal
- Specified by:
aggregateDiagonalin interfaceAccess2D.Aggregatable<N extends Comparable<N>>
-
aggregateRange
- Specified by:
aggregateRangein interfaceAccess1D.Aggregatable<N extends Comparable<N>>
-
aggregateRow
- Specified by:
aggregateRowin interfaceAccess2D.Aggregatable<N extends Comparable<N>>
-
below
- Specified by:
belowin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
below
- Specified by:
belowin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
below
- Specified by:
belowin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
bidiagonal
- Specified by:
bidiagonalin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
column
- Specified by:
columnin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - See Also:
-
column
- Specified by:
columnin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - See Also:
-
columns
Description copied from interface:Structure2D.LogicalA selection (re-ordering) of columns. Note that it's ok to reference the same base column more than once, and any negative column reference/index will translate to a column of zeros. The number of columns in the resulting matrix is the same as the number of elements in the columns index array.- Specified by:
columnsin interfaceAccess2D<N extends Comparable<N>>- Specified by:
columnsin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
columns
- Specified by:
columnsin interfaceAccess2D<N extends Comparable<N>>- Specified by:
columnsin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - See Also:
-
conjugate
Description copied from interface:VectorSpaceThis method will (most likely) be moved to some other interface in the future! Just have to figure out where it fits...
The conjugate transpose of a matrix and/or the conjugate of a scalar/field like ComplexNumber or Quaternion.
The conjugate transpose of a real matrix is simply its transpose.
- Specified by:
conjugatein interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Specified by:
conjugatein interfaceVectorSpace<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
copy
The returned instance can have its elements mutated in various ways, while the size/shape is fixed.- Returns:
- A fully mutable matrix builder with the elements initially set to a copy of this matrix – always creates a full dense copy.
- See Also:
-
count
public long count()Description copied from interface:Structure2Dcount() == countRows() * countColumns()- Specified by:
countin interfaceStructure1D- Specified by:
countin interfaceStructure2D
-
countColumns
public long countColumns()Description copied from interface:Structure2DOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Specified by:
countColumnsin interfaceStructure2D- Returns:
- The number of columns
-
countRows
public long countRows()Description copied from interface:Structure2DOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Specified by:
countRowsin interfaceStructure2D- Returns:
- The number of rows
-
diagonal
- Specified by:
diagonalin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
- A diagonal matrix (main diagonal only)
-
diagonally
- Specified by:
diagonallyin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
divide
- Specified by:
dividein interfaceScalarOperation.Division<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
this / scalarDivisor.
-
divide
- Specified by:
dividein interfaceScalarOperation.Division<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
this / scalarDivisor.
-
doubleValue
public double doubleValue(int row, int col) Description copied from interface:Access2DExtracts one element of this matrix as a double.- Specified by:
doubleValuein interfaceAccess2D<N extends Comparable<N>>- Parameters:
row- A row index.col- A column index.- Returns:
- One matrix element
-
doubleValue
public double doubleValue(long index) - Specified by:
doubleValuein interfaceAccess1D<N extends Comparable<N>>- Specified by:
doubleValuein interfaceAccess2D<N extends Comparable<N>>
-
enforce
- Specified by:
enforcein interfaceNumberContext.Enforceable<N extends Comparable<N>>
-
equals
-
get
Deprecated.v50 No need for this! -
get
-
get
-
getColDim
public int getColDim()- Specified by:
getColDimin interfaceStructure2D- Returns:
- The number of columns
-
getCondition
public double getCondition()Matrix condition (2-norm)- Specified by:
getConditionin interfaceProvider2D.Condition- Returns:
- ratio of largest to smallest singular value.
-
getDeterminant
- Specified by:
getDeterminantin interfaceProvider2D.Determinant<N extends Comparable<N>>- Returns:
- The matrix' determinant.
-
getEigenpairs
- Specified by:
getEigenpairsin interfaceProvider2D.Eigenpairs
-
getRank
public int getRank()The rank of a matrix is the (maximum) number of linearly independent rows or columns it contains. It is also equal to the number of nonzero singular values of the matrix.- Specified by:
getRankin interfaceProvider2D.Rank- Returns:
- The matrix' rank.
- See Also:
-
getRowDim
public int getRowDim()- Specified by:
getRowDimin interfaceStructure2D- Returns:
- The number of rows
-
getTrace
The sum of the diagonal elements.- Specified by:
getTracein interfaceProvider2D.Trace<N extends Comparable<N>>- Returns:
- The matrix' trace.
-
hashCode
-
hermitian
Description copied from interface:Structure2D.LogicalSimilar toStructure2D.Logical.symmetric(boolean)but in addition the mirrored elements are conjugated.- Specified by:
hermitianin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
hessenberg
- Specified by:
hessenbergin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
indexOfLargest
public long indexOfLargest()- Specified by:
indexOfLargestin interfaceAccess1D.Aggregatable<N extends Comparable<N>>
-
invert
About inverting matrices:
- "right inverse": [this][right inverse]=[I]. You may calculate it using solve(Access2D).
- "left inverse": [left inverse][this]=[I]. You may calculate it using solve(Access2D) and transposing.
- "generalised inverse": [this][generalised inverse][this]=[this]. Note that if [this] is singular or non-square, then [generalised inverse] is not unique.
- "pseudoinverse": The generalised inverse (there are typically/possibly many) with the smallest frobenius norm is called the (Moore-Penrose) pseudoinverse. You may calculate it using the QR or SingularValue decompositions.
- "inverse":
- If [left inverse]=[right inverse] then it is also [inverse].
- If [this] is square and has full rank then the [generalised inverse] is unique, with the [pseudoinverse] given, and equal to [inverse].
- Specified by:
invertin interfaceProvider2D.Inverse<N extends Comparable<N>>- Returns:
- The "best possible" inverse....
-
isHermitian
public boolean isHermitian()- Specified by:
isHermitianin interfaceProvider2D.Hermitian
-
isSmall
public boolean isSmall(double comparedTo) - Specified by:
isSmallin interfaceNormedVectorSpace<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Parameters:
comparedTo- What to compare with- Returns:
- true if this is small compared to the magnitude of the input reference value.
-
isSymmetric
public boolean isSymmetric()- Specified by:
isSymmetricin interfaceProvider2D.Symmetric
-
left
- Specified by:
leftin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
left
- Specified by:
leftin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
left
- Specified by:
leftin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
limits
Description copied from interface:Structure2D.LogicalSetting either limit to < 0 is interpreted as "no limit" (useful when you only want to limit either the rows or columns, and don't know the size of the other)- Specified by:
limitsin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
logical
Deprecated.v50 No need for this! -
multiply
- Specified by:
multiplyin interfaceScalarOperation.Multiplication<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
this * scalarMultiplicand.
-
multiply
- Specified by:
multiplyin interfaceOperation.Multiplication<N extends Comparable<N>>- Parameters:
multiplicand- The multiplicand- Returns:
this * multiplicand.
-
multiply
- Specified by:
multiplyin interfaceScalarOperation.Multiplication<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
this * multiplicand.
-
negate
Description copied from interface:Group.AdditiveThe additive inverse of this.- Specified by:
negatein interfaceGroup.Additive<N extends Comparable<N>>- Returns:
-this.
-
norm
public double norm()The Frobenius norm is the square root of the sum of the squares of each element, or the square root of the sum of the square of the singular values. This definition fits the requirements of NormedVectorSpace.norm().- Specified by:
normin interfaceNormedVectorSpace<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
- The matrix' Frobenius norm
-
offsets
- Specified by:
offsetsin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onAll
- Specified by:
onAllin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onAll
- Specified by:
onAllin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onAll
- Specified by:
onAllin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onAll
- Specified by:
onAllin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onAll
- Specified by:
onAllin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onAll
- Specified by:
onAllin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onAny
- Specified by:
onAnyin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onColumns
- Specified by:
onColumnsin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onColumns
- Specified by:
onColumnsin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onCompatible
- Specified by:
onCompatiblein interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onCompatible
- Specified by:
onCompatiblein interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onMatching
- Specified by:
onMatchingin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onMatching
- Specified by:
onMatchingin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onRows
- Specified by:
onRowsin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
onRows
- Specified by:
onRowsin interfaceOperate2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
power
Description copied from interface:Operation.MultiplicationMultiply by itselfpowertimes.- Specified by:
powerin interfaceOperation.Multiplication<N extends Comparable<N>>
-
reduceColumns
- Specified by:
reduceColumnsin interfaceStructure2D.ReducibleTo1D<N extends Comparable<N>>
-
reduceRows
- Specified by:
reduceRowsin interfaceStructure2D.ReducibleTo1D<N extends Comparable<N>>
-
repeat
Description copied from interface:Structure2D.LogicalWill repeat this structure creating a new structure with a multiple of rows and columns.- Specified by:
repeatin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Parameters:
rowsRepetitions- The number of times to repeat the rowscolumnsRepetitions- The number of times to repeat the columns- Returns:
- The builder
-
right
- Specified by:
rightin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
right
- Specified by:
rightin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
right
- Specified by:
rightin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
row
- Specified by:
rowin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - See Also:
-
row
- Specified by:
rowin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - See Also:
-
rows
Description copied from interface:Structure2D.LogicalA selection (re-ordering) of rows. Note that it's ok to reference the same base row more than once, and any negative row reference/index will translate to a row of zeros. The number of rows in the resulting matrix is the same as the number of elements in the rows index array.- Specified by:
rowsin interfaceAccess2D<N extends Comparable<N>>- Specified by:
rowsin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
rows
- Specified by:
rowsin interfaceAccess2D<N extends Comparable<N>>- Specified by:
rowsin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - See Also:
-
select
-
select
Description copied from interface:Access2DCreates a view of the underlying data structure of only the selected elements. If either the rows or columns input arguments are null or empty arrays, then that transaltes to all rows and/or columns.- Specified by:
selectin interfaceAccess2D<N extends Comparable<N>>
-
signum
Description copied from interface:NormedVectorSpacethis == this.signum().multiply(this.norm())- Specified by:
signumin interfaceNormedVectorSpace<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
- A unit "vector"
-
size
public int size()Description copied from interface:Structure2Dsize() == getRowDim() * getColDim()- Specified by:
sizein interfaceStructure1D- Specified by:
sizein interfaceStructure2D
-
solve
This method solves a system of linear equations: [this][X]=[rhs]. A combination of columns in [this] should produce a column(s) in [rhs]. It is ok for [rhs] to have more than 1 column.
- If the problem is over-qualified an approximate solution is returned.
- If the problem is under-qualified one possible solution is returned.
Remember that: [X][this]=[rhs] is equivalent to [this]T[X]T=[rhs]T
- Specified by:
solvein interfaceProvider2D.Solution<N extends Comparable<N>>- Parameters:
rhs- The right hand side of the equation.- Returns:
- The solution, [X].
-
subtract
- Specified by:
subtractin interfaceScalarOperation.Subtraction<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
this - scalarSubtrahend.
-
subtract
- Specified by:
subtractin interfaceOperation.Subtraction<N extends Comparable<N>>- Parameters:
subtrahend- The subtrahend- Returns:
this - subtrahend.
-
subtract
- Specified by:
subtractin interfaceScalarOperation.Subtraction<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
this - scalarSubtrahend.
-
superimpose
- Specified by:
superimposein interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
supplyTo
- Specified by:
supplyToin interfaceAccess2D.Collectable<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
symmetric
Description copied from interface:Structure2D.LogicalDefines a symmetricStructure2D(matrix) by mirroring one half (diagonally) on the other.- Specified by:
symmetricin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Parameters:
upper- From where are the elements read?
-
toScalar
Description copied from interface:Matrix2DExtracts one element of this matrix as a Scalar.- Specified by:
toScalarin interfaceMatrix2D<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Parameters:
row- A row index.col- A column index.- Returns:
- One matrix element as a Scalar.
-
toString
-
transpose
Transposes this matrix. For complex matrices conjugate() and transpose() are NOT EQUAL.- Specified by:
transposein interfaceMatrix2D<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Specified by:
transposein interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>> - Returns:
- A matrix that is the transpose of this matrix.
- See Also:
-
triangular
- Specified by:
triangularin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
tridiagonal
- Specified by:
tridiagonalin interfaceStructure2D.Logical<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
getConditionProvider
-
getDeterminantProvider
-
getEigenpairsProvider
-
getInverseProvider
-
getRankProvider
-
getSolutionProvider
private Provider2D.Solution<Optional<MatrixStore<N>>> getSolutionProvider(boolean safe, Access2D<?> rhs) -
newCholesky
-
newDeterminantTask
-
newEigenvalue
-
newInstance
-
newInverterTask
-
newLDL
-
newLDU
-
newLU
-
newQR
-
newSingularValue
-
newSolverTask
-
store
MatrixStore<N> store() -
supplier
ElementsSupplier<N> supplier()
-