Package org.ojalgo.matrix
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 org.ojalgo.structure.Access2D
Access2D.Aggregatable<N extends Comparable<N>>, Access2D.Collectable<N extends Comparable<N>,
R extends Mutate2D>, Access2D.ColumnView<N extends Comparable<N>>, Access2D.ElementView<N extends Comparable<N>>, Access2D.RowView<N extends Comparable<N>>, Access2D.SelectionView<N extends Comparable<N>>, Access2D.Sliceable<N extends Comparable<N>>, Access2D.Visitable<N extends Comparable<N>> Nested classes/interfaces inherited from interface org.ojalgo.algebra.Group
Group.Additive<T>, Group.Multiplicative<T>
Nested classes/interfaces inherited from interface org.ojalgo.algebra.Operation
Operation.Addition<T>, Operation.Division<T>, Operation.Multiplication<T>, Operation.Subtraction<T>
Nested classes/interfaces inherited from interface org.ojalgo.matrix.Provider2D
Provider2D.Condition, Provider2D.Determinant<N extends Comparable<N>>, Provider2D.Eigenpairs, Provider2D.Hermitian, Provider2D.Inverse<M>, Provider2D.Rank, Provider2D.Solution<M>, Provider2D.Symmetric, Provider2D.Trace<N extends Comparable<N>>
Nested classes/interfaces inherited from interface org.ojalgo.algebra.ScalarOperation
ScalarOperation.Addition<T,
N extends Comparable<N>>, ScalarOperation.Division<T, N extends Comparable<N>>, ScalarOperation.Multiplication<T, N extends Comparable<N>>, ScalarOperation.Subtraction<T, N extends Comparable<N>> Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S extends Structure1D,
B extends Structure1D.Logical<S, B>>, Structure1D.LongIndex, Structure1D.LoopCallback Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S extends Structure2D,
B extends Structure2D.Logical<S, B>>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.Reshapable, Structure2D.RowColumnKey<R, C>, Structure2D.RowColumnMapper<R, C> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final NumberContext
private MatrixDecomposition
<N> private final PhysicalStore.Factory
<N, ?> private int
private Boolean
private Boolean
private 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.long
count()
count() == countRows() * countColumns()long
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.long
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.diagonal()
diagonally
(Access2D<N>... diagonally) divide
(double scalarDivisor) double
doubleValue
(int row, int col) Extracts one element of this matrix as a double.double
doubleValue
(long index) enforce
(NumberContext context) boolean
true if "other" is anAccess2D
of 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) int
double
Matrix condition (2-norm)private Provider2D.Condition
private Provider2D.Determinant
<N> private Provider2D.Eigenpairs
private Provider2D.Inverse
<Optional<MatrixStore<N>>> getInverseProvider
(boolean safe) int
getRank()
The rank of a matrix is the (maximum) number of linearly independent rows or columns it contains.private Provider2D.Rank
int
private Provider2D.Solution
<Optional<MatrixStore<N>>> getSolutionProvider
(boolean safe, Access2D<?> rhs) getTrace()
The sum of the diagonal elements.int
hashCode()
hermitian
(boolean upper) Similar toStructure2D.Logical.symmetric(boolean)
but in addition the mirrored elements are conjugated.hessenberg
(boolean upper) long
invert()
About inverting matrices:boolean
boolean
isSmall
(double comparedTo) boolean
left
(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 M
logical()
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 M
newInstance
(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) 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.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 itselfpower
times.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())
int
size()
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()
void
supplyTo
(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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ojalgo.structure.Access1D
asCollectable1D, asKeyed1D, axpy, dot, select, supplyTo, toRawCopy1D
Methods inherited from interface org.ojalgo.structure.Access1D.Aggregatable
aggregateAll
Methods inherited from interface org.ojalgo.structure.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, toRawCopy2D
Methods inherited from interface org.ojalgo.structure.Access2D.Aggregatable
aggregateColumn, aggregateDiagonal, aggregateRow, reduceColumns, reduceRows
Methods inherited from interface org.ojalgo.structure.Access2D.Collectable
collect
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Addition
add
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Division
divide
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Multiplication
multiply
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Subtraction
subtract
Methods inherited from interface org.ojalgo.structure.Structure2D
firstInColumn, firstInRow, getMaxDim, getMinDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow
Methods inherited from interface org.ojalgo.structure.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:
above
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
above
- Specified by:
above
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
above
- Specified by:
above
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
add
- Specified by:
add
in interfaceScalarOperation.Addition<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
this + scalarAddend
.
-
add
- Specified by:
add
in interfaceOperation.Addition<N extends Comparable<N>>
- Parameters:
addend
- What to add- Returns:
this + addend
-
add
- Specified by:
add
in interfaceScalarOperation.Addition<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
this + scalarAddend
.
-
aggregateColumn
- Specified by:
aggregateColumn
in interfaceAccess2D.Aggregatable<N extends Comparable<N>>
-
aggregateDiagonal
- Specified by:
aggregateDiagonal
in interfaceAccess2D.Aggregatable<N extends Comparable<N>>
-
aggregateRange
- Specified by:
aggregateRange
in interfaceAccess1D.Aggregatable<N extends Comparable<N>>
-
aggregateRow
- Specified by:
aggregateRow
in interfaceAccess2D.Aggregatable<N extends Comparable<N>>
-
below
- Specified by:
below
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
below
- Specified by:
below
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
below
- Specified by:
below
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
bidiagonal
- Specified by:
bidiagonal
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
column
- Specified by:
column
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - See Also:
-
column
- Specified by:
column
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - See Also:
-
columns
Description copied from interface:Structure2D.Logical
A 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:
columns
in interfaceAccess2D<N extends Comparable<N>>
- Specified by:
columns
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
columns
- Specified by:
columns
in interfaceAccess2D<N extends Comparable<N>>
- Specified by:
columns
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - See Also:
-
conjugate
Description copied from interface:VectorSpace
This 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:
conjugate
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Specified by:
conjugate
in 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:Structure2D
count() == countRows() * countColumns()- Specified by:
count
in interfaceStructure1D
- Specified by:
count
in interfaceStructure2D
-
countColumns
public long countColumns()Description copied from interface:Structure2D
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Specified by:
countColumns
in interfaceStructure2D
- Returns:
- The number of columns
-
countRows
public long countRows()Description copied from interface:Structure2D
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Specified by:
countRows
in interfaceStructure2D
- Returns:
- The number of rows
-
diagonal
- Specified by:
diagonal
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
- A diagonal matrix (main diagonal only)
-
diagonally
- Specified by:
diagonally
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
divide
- Specified by:
divide
in interfaceScalarOperation.Division<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
this / scalarDivisor
.
-
divide
- Specified by:
divide
in 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:Access2D
Extracts one element of this matrix as a double.- Specified by:
doubleValue
in 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:
doubleValue
in interfaceAccess1D<N extends Comparable<N>>
- Specified by:
doubleValue
in interfaceAccess2D<N extends Comparable<N>>
-
enforce
- Specified by:
enforce
in interfaceNumberContext.Enforceable<N extends Comparable<N>>
-
equals
true if "other" is anAccess2D
of the same size/shape and the elements are equal to high precision (12 significant digits). -
get
Deprecated.v50 No need for this! -
get
- Specified by:
get
in interfaceAccess1D<N extends Comparable<N>>
- Specified by:
get
in interfaceAccess2D<N extends Comparable<N>>
-
get
- Specified by:
get
in interfaceAccess2D<N extends Comparable<N>>
-
getColDim
public int getColDim()- Specified by:
getColDim
in interfaceStructure2D
- Returns:
- The number of columns
-
getCondition
public double getCondition()Matrix condition (2-norm)- Specified by:
getCondition
in interfaceProvider2D.Condition
- Returns:
- ratio of largest to smallest singular value.
-
getDeterminant
- Specified by:
getDeterminant
in interfaceProvider2D.Determinant<N extends Comparable<N>>
- Returns:
- The matrix' determinant.
-
getEigenpairs
- Specified by:
getEigenpairs
in 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:
getRank
in interfaceProvider2D.Rank
- Returns:
- The matrix' rank.
- See Also:
-
getRowDim
public int getRowDim()- Specified by:
getRowDim
in interfaceStructure2D
- Returns:
- The number of rows
-
getTrace
The sum of the diagonal elements.- Specified by:
getTrace
in interfaceProvider2D.Trace<N extends Comparable<N>>
- Returns:
- The matrix' trace.
-
hashCode
public int hashCode() -
hermitian
Description copied from interface:Structure2D.Logical
Similar toStructure2D.Logical.symmetric(boolean)
but in addition the mirrored elements are conjugated.- Specified by:
hermitian
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
hessenberg
- Specified by:
hessenberg
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
indexOfLargest
public long indexOfLargest()- Specified by:
indexOfLargest
in 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:
invert
in interfaceProvider2D.Inverse<N extends Comparable<N>>
- Returns:
- The "best possible" inverse....
-
isHermitian
public boolean isHermitian()- Specified by:
isHermitian
in interfaceProvider2D.Hermitian
-
isSmall
public boolean isSmall(double comparedTo) - Specified by:
isSmall
in 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:
isSymmetric
in interfaceProvider2D.Symmetric
-
left
- Specified by:
left
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
left
- Specified by:
left
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
left
- Specified by:
left
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
limits
Description copied from interface:Structure2D.Logical
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)- Specified by:
limits
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
logical
Deprecated.v50 No need for this! -
multiply
- Specified by:
multiply
in interfaceScalarOperation.Multiplication<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
this * scalarMultiplicand
.
-
multiply
- Specified by:
multiply
in interfaceOperation.Multiplication<N extends Comparable<N>>
- Parameters:
multiplicand
- The multiplicand- Returns:
this * multiplicand
.
-
multiply
- Specified by:
multiply
in interfaceScalarOperation.Multiplication<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
this * multiplicand
.
-
negate
Description copied from interface:Group.Additive
The additive inverse of this.- Specified by:
negate
in 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:
norm
in interfaceNormedVectorSpace<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
- The matrix' Frobenius norm
-
offsets
- Specified by:
offsets
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onAll
- Specified by:
onAll
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onAll
- Specified by:
onAll
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onAll
- Specified by:
onAll
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onAll
- Specified by:
onAll
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onAll
- Specified by:
onAll
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onAll
- Specified by:
onAll
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onAny
- Specified by:
onAny
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onColumns
- Specified by:
onColumns
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onColumns
- Specified by:
onColumns
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onCompatible
- Specified by:
onCompatible
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onCompatible
- Specified by:
onCompatible
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onMatching
- Specified by:
onMatching
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onMatching
- Specified by:
onMatching
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onRows
- Specified by:
onRows
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
onRows
- Specified by:
onRows
in interfaceOperate2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
power
Description copied from interface:Operation.Multiplication
Multiply by itselfpower
times.- Specified by:
power
in interfaceOperation.Multiplication<N extends Comparable<N>>
-
reduceColumns
- Specified by:
reduceColumns
in interfaceStructure2D.ReducibleTo1D<N extends Comparable<N>>
-
reduceRows
- Specified by:
reduceRows
in interfaceStructure2D.ReducibleTo1D<N extends Comparable<N>>
-
repeat
Description copied from interface:Structure2D.Logical
Will repeat this structure creating a new structure with a multiple of rows and columns.- Specified by:
repeat
in 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:
right
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
right
- Specified by:
right
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
right
- Specified by:
right
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
row
- Specified by:
row
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - See Also:
-
row
- Specified by:
row
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - See Also:
-
rows
Description copied from interface:Structure2D.Logical
A 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:
rows
in interfaceAccess2D<N extends Comparable<N>>
- Specified by:
rows
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
rows
- Specified by:
rows
in interfaceAccess2D<N extends Comparable<N>>
- Specified by:
rows
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - See Also:
-
select
- Specified by:
select
in interfaceAccess2D<N extends Comparable<N>>
-
select
Description copied from interface:Access2D
Creates 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:
select
in interfaceAccess2D<N extends Comparable<N>>
-
signum
Description copied from interface:NormedVectorSpace
this == this.signum().multiply(this.norm())
- Specified by:
signum
in interfaceNormedVectorSpace<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
- A unit "vector"
-
size
public int size()Description copied from interface:Structure2D
size() == getRowDim() * getColDim()- Specified by:
size
in interfaceStructure1D
- Specified by:
size
in 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:
solve
in interfaceProvider2D.Solution<N extends Comparable<N>>
- Parameters:
rhs
- The right hand side of the equation.- Returns:
- The solution, [X].
-
subtract
- Specified by:
subtract
in interfaceScalarOperation.Subtraction<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
this - scalarSubtrahend
.
-
subtract
- Specified by:
subtract
in interfaceOperation.Subtraction<N extends Comparable<N>>
- Parameters:
subtrahend
- The subtrahend- Returns:
this - subtrahend
.
-
subtract
- Specified by:
subtract
in interfaceScalarOperation.Subtraction<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Returns:
this - scalarSubtrahend
.
-
superimpose
- Specified by:
superimpose
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
supplyTo
- Specified by:
supplyTo
in interfaceAccess2D.Collectable<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
symmetric
Description copied from interface:Structure2D.Logical
Defines a symmetricStructure2D
(matrix) by mirroring one half (diagonally) on the other.- Specified by:
symmetric
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Parameters:
upper
- From where are the elements read?
-
toScalar
Description copied from interface:Matrix2D
Extracts one element of this matrix as a Scalar.- Specified by:
toScalar
in 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:
transpose
in interfaceMatrix2D<N extends Comparable<N>,
M extends BasicMatrix<N, M>> - Specified by:
transpose
in 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:
triangular
in interfaceStructure2D.Logical<N extends Comparable<N>,
M extends BasicMatrix<N, M>>
-
tridiagonal
- Specified by:
tridiagonal
in 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()
-