public final class RationalMatrix extends Object
BasicMatrix.Builder<I extends BasicMatrix>, 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.LoopCallbackGroup.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 | Field and Description |
|---|---|
static BasicMatrix.Factory<RationalMatrix> |
FACTORY |
| Modifier and Type | Method and Description |
|---|---|
I |
add(BasicMatrix addend) |
I |
add(double scalarAddend) |
I |
add(int row,
int col,
Access2D<?> addend) |
I |
add(Number scalarAddend) |
N |
aggregateColumn(long row,
long col,
Aggregator aggregator) |
N |
aggregateDiagonal(long row,
long col,
Aggregator aggregator) |
N |
aggregateRange(long first,
long limit,
Aggregator aggregator) |
N |
aggregateRow(long row,
long col,
Aggregator aggregator) |
I |
conjugate()
This method will (most likely) be moved to some other interface in the future! Just have to figure
out where it fits...
|
BasicMatrix.Builder<I> |
copy() |
long |
count()
count() == countRows() * countColumns()
|
long |
countColumns() |
long |
countRows() |
I |
divide(double scalarDivisor) |
I |
divide(Number scalarDivisor) |
I |
divideElements(Access2D<?> divisor)
Divides the elements of this with the elements of aMtrx.
|
double |
doubleValue(long index) |
double |
doubleValue(long i,
long j)
Extracts one element of this matrix as a double.
|
I |
enforce(NumberContext context)
Will enforce this number context on the elements
|
boolean |
equals(Access2D<?> aMtrx,
NumberContext aCntxt) |
boolean |
equals(Object obj) |
void |
flushCache()
BasicMatrix instances are intended to be immutable.
|
N |
get(long index) |
N |
get(long aRow,
long aColumn) |
I |
getColumnsRange(int first,
int limit) |
Scalar<N> |
getCondition()
Matrix condition (2-norm)
|
Scalar<N> |
getDeterminant() |
List<ComplexNumber> |
getEigenvalues() |
Scalar<N> |
getFrobeniusNorm() |
Scalar<N> |
getInfinityNorm() |
Scalar<N> |
getKyFanNorm(int k) |
Scalar<N> |
getOneNorm() |
Scalar<N> |
getOperatorNorm()
Deprecated.
v40 Use
SingularValue |
int |
getRank()
The rank of a matrix is the (maximum) number of linearly independent rows or columns it contains.
|
I |
getRowsRange(int first,
int limit) |
List<Double> |
getSingularValues() |
Scalar<N> |
getTrace()
The sum of the diagonal elements.
|
Scalar<N> |
getTraceNorm() |
Scalar<N> |
getVectorNorm(int degree)
Deprecated.
|
int |
hashCode() |
I |
invert()
About inverting matrices:
|
boolean |
isAbsolute(long row,
long col) |
boolean |
isFullRank() |
boolean |
isHermitian() |
boolean |
isSmall(double comparedTo) |
boolean |
isSmall(long row,
long col,
double comparedTo) |
boolean |
isSymmetric() |
I |
mergeColumns(Access2D<?> belowRows)
[belowRows] is appended below [this].
|
I |
mergeRows(Access2D<?> rightColumns)
[rightColumns] is appended to the right of [this].
|
I |
modify(UnaryFunction<? extends Number> modifier) |
I |
multiply(BasicMatrix multiplicand) |
I |
multiply(double scalarMultiplicand) |
I |
multiply(Number scalarMultiplicand) |
I |
multiplyElements(Access2D<?> multiplicand)
Multiplies the elements of this matrix with the elements of aMtrx.
|
I |
negate()
The additive inverse of this.
|
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.
|
I |
reduceColumns(Aggregator aggregator) |
I |
reduceRows(Aggregator aggregator) |
I |
selectColumns(int... someCols) |
I |
selectRows(int... someRows) |
I |
signum()
this == this.signum().multiply(this.norm()) |
I |
solve(Access2D<?> rhs)
This method solves a system of linear equations: [this][X]=[aRHS].
|
I |
subtract(BasicMatrix subtrahend) |
BasicMatrix |
subtract(double scalarSubtrahend) |
I |
subtract(Number scalarSubtrahend) |
Scalar<N> |
toScalar(long row,
long col)
Extracts one element of this matrix as a Scalar.
|
String |
toString() |
I |
transpose()
Transposes this matrix.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcalculateFrobeniusNorm, calculateInfinityNorm, calculateOneNorm, toStringasCollectable2D, asPrimitive2D, columns, elements, equals, newPrimitiveColumnCollectable, newPrimitiveRowCollectable, rows, toRawCopy2D, toString, wrap, wrap, wrapAccess2D, wrapAccess2DasCollectable1D, asPrimitive1D, axpy, dot, equals, hashCode, iterator, nonzeros, stream, supplyTo, toRawCopy1D, wrap, wrap, wrap, wrapAccess1D, wrapAccess1D, wrapAccess1DforEach, spliteratorisAbsolute, isColumnSmall, isColumnSmall, isRowSmall, isRowSmall, isSmallisAllSmallaggregateColumn, aggregateRow, reduceColumns, reduceRowsaggregateAllcolumn, column, column, column, column, index, index, isEmpty, isFat, isScalar, isSquare, isTall, isVector, loopAll, loopColumn, loopColumn, loopDiagonal, loopMatching, loopRow, loopRow, mapperOf, row, row, row, row, rowloopAll, loopMatching, loopRange, mapperpublic static final BasicMatrix.Factory<RationalMatrix> FACTORY
public I add(BasicMatrix addend)
add in interface Operation.Addition<BasicMatrix>addend - What to addthis + addendpublic I add(double scalarAddend)
add in interface ScalarOperation.Addition<BasicMatrix,Number>this + scalarAddend.public I add(int row,
int col,
Access2D<?> addend)
add in interface BasicMatrixrow - 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 superimposepublic I add(Number scalarAddend)
add in interface ScalarOperation.Addition<BasicMatrix,Number>this + scalarAddend.public N aggregateColumn(long row,
long col,
Aggregator aggregator)
aggregateColumn in interface Access2D.Aggregatable<Number>public N aggregateDiagonal(long row,
long col,
Aggregator aggregator)
aggregateDiagonal in interface Access2D.Aggregatable<Number>public N aggregateRange(long first,
long limit,
Aggregator aggregator)
aggregateRange in interface Access1D.Aggregatable<Number>public N aggregateRow(long row,
long col,
Aggregator aggregator)
aggregateRow in interface Access2D.Aggregatable<Number>public I conjugate()
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.
conjugate in interface VectorSpace<BasicMatrix,Number>public BasicMatrix.Builder<I> copy()
copy in interface BasicMatrixpublic long count()
Structure2Dcount in interface Structure1Dcount in interface Structure2Dpublic long countColumns()
countColumns in interface Structure2Dpublic long countRows()
countRows in interface Structure2Dpublic I divide(double scalarDivisor)
divide in interface ScalarOperation.Division<BasicMatrix,Number>this / scalarDivisor.public I divide(Number scalarDivisor)
divide in interface ScalarOperation.Division<BasicMatrix,Number>this / scalarDivisor.public I divideElements(Access2D<?> divisor)
BasicMatrixdivideElements in interface BasicMatrixdivisor - The denominator elements.public double doubleValue(long index)
doubleValue in interface Access1D<Number>doubleValue in interface Access2D<Number>public double doubleValue(long i,
long j)
Access2DdoubleValue in interface Access2D<Number>i - A row index.j - A column index.public I enforce(NumberContext context)
BasicMatrixenforce in interface BasicMatrixcontext - The contextpublic boolean equals(Access2D<?> aMtrx, NumberContext aCntxt)
equals in interface BasicMatrixpublic void flushCache()
BasicMatrixflushCache in interface BasicMatrixpublic N get(long index)
public I getColumnsRange(int first,
int limit)
getColumnsRange in interface BasicMatrixfirst - The first column to include.limit - The limit (exclusive) - the first column not to include.public Scalar<N> getCondition()
BasicMatrixgetCondition in interface BasicMatrixpublic Scalar<N> getDeterminant()
getDeterminant in interface BasicMatrixpublic List<ComplexNumber> getEigenvalues()
getEigenvalues in interface BasicMatrixpublic Scalar<N> getFrobeniusNorm()
public Scalar<N> getInfinityNorm()
public Scalar<N> getKyFanNorm(int k)
public Scalar<N> getOneNorm()
@Deprecated public Scalar<N> getOperatorNorm()
SingularValuepublic int getRank()
BasicMatrixgetRank in interface BasicMatrixpublic I getRowsRange(int first,
int limit)
getRowsRange in interface BasicMatrixfirst - The first row to include.limit - The limit (exclusive) - the first row not to include.public List<Double> getSingularValues()
getSingularValues in interface BasicMatrixpublic Scalar<N> getTrace()
BasicMatrixgetTrace in interface BasicMatrixpublic Scalar<N> getTraceNorm()
@Deprecated public Scalar<N> getVectorNorm(int degree)
Access1D.Aggregatable.aggregateAll(org.ojalgo.function.aggregator.Aggregator)public I invert()
BasicMatrixAbout inverting matrices:
invert in interface BasicMatrixpublic boolean isAbsolute(long row,
long col)
isAbsolute in interface Access2D.ElementsScalar.isAbsolute()public boolean isFullRank()
isFullRank in interface BasicMatrixpublic boolean isHermitian()
isHermitian in interface BasicMatrixpublic boolean isSmall(double comparedTo)
isSmall in interface NormedVectorSpace<BasicMatrix,Number>comparedTo - What to compare withpublic boolean isSmall(long row,
long col,
double comparedTo)
isSmall in interface Access2D.ElementsNormedVectorSpace.isSmall(double)public boolean isSymmetric()
isSymmetric in interface BasicMatrixpublic I mergeColumns(Access2D<?> belowRows)
BasicMatrixmergeColumns in interface BasicMatrixbelowRows - The matrix to merge.public I mergeRows(Access2D<?> rightColumns)
BasicMatrixmergeRows in interface BasicMatrixrightColumns - The matrix to merge.public I modify(UnaryFunction<? extends Number> modifier)
modify in interface BasicMatrixpublic I multiply(BasicMatrix multiplicand)
multiply in interface Operation.Multiplication<BasicMatrix>multiplicand - The multiplicandthis * multiplicand.public I multiply(double scalarMultiplicand)
multiply in interface ScalarOperation.Multiplication<BasicMatrix,Number>this * scalarMultiplicand.public I multiply(Number scalarMultiplicand)
multiply in interface ScalarOperation.Multiplication<BasicMatrix,Number>this * multiplicand.public I multiplyElements(Access2D<?> multiplicand)
BasicMatrixmultiplyElements in interface BasicMatrixmultiplicand - The elements to multiply by.public I negate()
Group.Additivenegate in interface Group.Additive<BasicMatrix>-this.public double norm()
norm in interface NormedVectorSpace<BasicMatrix,Number>public I reduceColumns(Aggregator aggregator)
reduceColumns in interface Structure2D.ReducibleTo1D<BasicMatrix>public I reduceRows(Aggregator aggregator)
reduceRows in interface Structure2D.ReducibleTo1D<BasicMatrix>public I selectColumns(int... someCols)
selectColumns in interface BasicMatrixsomeCols - An ordered array of column indeces.public I selectRows(int... someRows)
selectRows in interface BasicMatrixsomeRows - An ordered array of row indeces.public I signum()
NormedVectorSpacethis == this.signum().multiply(this.norm())signum in interface NormedVectorSpace<BasicMatrix,Number>public I solve(Access2D<?> rhs)
BasicMatrixThis 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
solve in interface BasicMatrixrhs - The right hand side of the equation.public I subtract(BasicMatrix subtrahend)
subtract in interface Operation.Subtraction<BasicMatrix>subtrahend - The subtrahendthis - subtrahend.public BasicMatrix subtract(double scalarSubtrahend)
subtract in interface ScalarOperation.Subtraction<BasicMatrix,Number>this - scalarSubtrahend.public I subtract(Number scalarSubtrahend)
subtract in interface ScalarOperation.Subtraction<BasicMatrix,Number>this - scalarSubtrahend.public Scalar<N> toScalar(long row, long col)
BasicMatrixtoScalar in interface BasicMatrixrow - A row index.col - A column index.public I transpose()
BasicMatrixtranspose in interface BasicMatrixVectorSpace.conjugate()Copyright © 2018 Optimatika. All rights reserved.