public interface BasicMatrix extends Access2D<Number>, Access2D.Elements, Access2D.Aggregatable<Number>, Structure2D.ReducibleTo1D<BasicMatrix>, NormedVectorSpace<BasicMatrix,Number>, Operation.Subtraction<BasicMatrix>, Operation.Multiplication<BasicMatrix>, ScalarOperation.Addition<BasicMatrix,Number>, ScalarOperation.Division<BasicMatrix,Number>, ScalarOperation.Subtraction<BasicMatrix,Number>
This interface declares a set of high level methods for linear algebra. Only the most basic set of matrix functionality is defined here. Various matrix decompositions may be used to do some of the more advanced tasks.
Modifier and Type | Interface and Description |
---|---|
static interface |
BasicMatrix.Builder<I extends BasicMatrix> |
static interface |
BasicMatrix.Factory<I extends BasicMatrix> |
Access2D.Aggregatable<N extends Number>, Access2D.Collectable<N extends Number,R extends Mutate2D.Receiver<N>>, Access2D.Elements, Access2D.ElementView<N extends Number>, Access2D.IndexOf, Access2D.Sliceable<N extends Number>, Access2D.Visitable<N extends Number>
Structure2D.IntRowColumn, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.RowColumnCallback, Structure2D.RowColumnKey<R,C>, Structure2D.RowColumnMapper<R,C>
Structure1D.BasicMapper<T>, Structure1D.IndexCallback, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback
Group.Additive<S>, Group.Multiplicative<S>
Operation.Addition<T>, Operation.Division<T>, Operation.Multiplication<T>, Operation.Subtraction<T>
ScalarOperation.Addition<T,N extends Number>, ScalarOperation.Division<T,N extends Number>, ScalarOperation.Multiplication<T,N extends Number>, ScalarOperation.Subtraction<T,N extends Number>
Modifier and Type | Method and Description |
---|---|
BasicMatrix |
add(int row,
int col,
Access2D<?> addend) |
static double |
calculateFrobeniusNorm(BasicMatrix 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 double |
calculateInfinityNorm(BasicMatrix matrix) |
static double |
calculateOneNorm(BasicMatrix matrix) |
BasicMatrix.Builder<? extends BasicMatrix> |
copy() |
BasicMatrix |
divideElements(Access2D<?> aMtrx)
Divides the elements of this with the elements of aMtrx.
|
BasicMatrix |
enforce(NumberContext context)
Will enforce this number context on the elements
|
boolean |
equals(Access2D<?> aMtrx,
NumberContext aCntxt) |
void |
flushCache()
BasicMatrix instances are intended to be immutable.
|
BasicMatrix |
getColumnsRange(int first,
int limit) |
Scalar<?> |
getCondition()
Deprecated.
v40 Use
SingularValue |
Scalar<?> |
getDeterminant() |
List<ComplexNumber> |
getEigenvalues()
Deprecated.
v40 Use
SingularValue |
int |
getRank()
Deprecated.
v40 Use
SingularValue |
BasicMatrix |
getRowsRange(int first,
int kimit) |
List<? extends Number> |
getSingularValues()
Deprecated.
v40 Use
SingularValue |
Scalar<?> |
getTrace()
The sum of the diagonal elements.
|
BasicMatrix |
invert()
About inverting matrices:
|
boolean |
isFullRank()
Deprecated.
v40
|
boolean |
isHermitian() |
boolean |
isSymmetric() |
BasicMatrix |
mergeColumns(Access2D<?> belowRows)
[belowRows] is appended below [this].
|
BasicMatrix |
mergeRows(Access2D<?> rightColumns)
[rightColumns] is appended to the right of [this].
|
BasicMatrix |
modify(UnaryFunction<? extends Number> aFunc)
Deprecated.
v42
|
BasicMatrix |
multiplyElements(Access2D<?> aMtrx)
Multiplies the elements of this matrix with the elements of aMtrx.
|
BasicMatrix |
selectColumns(int... someCols) |
BasicMatrix |
selectRows(int... someRows) |
BasicMatrix |
solve(Access2D<?> aRHS)
This method solves a system of linear equations: [this][X]=[aRHS].
|
Scalar<?> |
toScalar(long row,
long col)
Extracts one element of this matrix as a Scalar.
|
default String |
toString(int row,
int col)
Deprecated.
v42
|
BasicMatrix |
transpose()
Transposes this matrix.
|
asCollectable2D, asPrimitive2D, columns, doubleValue, doubleValue, elements, equals, get, get, newPrimitiveColumnCollectable, newPrimitiveRowCollectable, rows, toRawCopy2D, toString, wrap, wrap, wrapAccess2D, wrapAccess2D
asCollectable1D, asPrimitive1D, axpy, dot, equals, hashCode, iterator, nonzeros, stream, supplyTo, toRawCopy1D, wrap, wrap, wrap, wrapAccess1D, wrapAccess1D, wrapAccess1D
forEach, spliterator
isAbsolute, isAbsolute, isColumnSmall, isColumnSmall, isRowSmall, isRowSmall, isSmall, isSmall
isAllSmall
aggregateColumn, aggregateColumn, aggregateDiagonal, aggregateRow, aggregateRow, reduceColumns, reduceRows
aggregateAll, aggregateRange
reduceColumns, reduceRows
column, column, column, column, column, count, countColumns, countRows, index, index, isEmpty, isFat, isScalar, isSquare, isTall, isVector, loopAll, loopColumn, loopColumn, loopDiagonal, loopMatching, loopRow, loopRow, mapperOf, row, row, row, row, row
loopAll, loopMatching, loopRange, mapper
isSmall, norm, signum
conjugate
negate
add
multiply, multiply
subtract
multiply
add, add
divide, divide
subtract, subtract
static double calculateFrobeniusNorm(BasicMatrix matrix)
static double calculateInfinityNorm(BasicMatrix matrix)
static double calculateOneNorm(BasicMatrix matrix)
BasicMatrix add(int row, int col, Access2D<?> addend)
row
- The row index of where to superimpose the top left element of the addendcol
- The column index of where to superimpose the top left element of the addendaddend
- A matrix to superimposeBasicMatrix.Builder<? extends BasicMatrix> copy()
BasicMatrix divideElements(Access2D<?> aMtrx)
aMtrx
- The denominator elements.BasicMatrix enforce(NumberContext context)
context
- The contextboolean equals(Access2D<?> aMtrx, NumberContext aCntxt)
void flushCache()
BasicMatrix getColumnsRange(int first, int limit)
first
- The first column to include.limit
- The limit (exclusive) - the first column not to include.@Deprecated Scalar<?> getCondition()
SingularValue
Scalar<?> getDeterminant()
@Deprecated List<ComplexNumber> getEigenvalues()
SingularValue
@Deprecated int getRank()
SingularValue
BasicMatrix getRowsRange(int first, int kimit)
first
- The first row to include.kimit
- The limit (exclusive) - the first row not to include.@Deprecated List<? extends Number> getSingularValues()
SingularValue
Scalar<?> getTrace()
BasicMatrix invert()
About inverting matrices:
@Deprecated boolean isFullRank()
boolean isHermitian()
boolean isSymmetric()
BasicMatrix mergeColumns(Access2D<?> belowRows)
belowRows
- The matrix to merge.BasicMatrix mergeRows(Access2D<?> rightColumns)
rightColumns
- The matrix to merge.@Deprecated BasicMatrix modify(UnaryFunction<? extends Number> aFunc)
BasicMatrix multiplyElements(Access2D<?> aMtrx)
aMtrx
- The elements to multiply by.BasicMatrix selectColumns(int... someCols)
someCols
- An ordered array of column indeces.BasicMatrix selectRows(int... someRows)
someRows
- An ordered array of row indeces.BasicMatrix solve(Access2D<?> aRHS)
This method solves a system of linear equations: [this][X]=[aRHS]. A combination of columns in [this] should produce a column in [aRHS]. It is ok for [aRHS] to have more than 1 column.
Remember that: [X][this]=[aRHS] is equivalent to [this]T[X]T=[aRHS]T
aRHS
- The right hand side of the equation.Scalar<?> toScalar(long row, long col)
row
- A row index.col
- A column index.@Deprecated default String toString(int row, int col)
BasicMatrix transpose()
VectorSpace.conjugate()
Copyright © 2018 Optimatika. All rights reserved.