public final class RawStore extends Object implements PhysicalStore<Double>, Serializable
PhysicalStore.Factory<N extends Number,I extends PhysicalStore<N>>MatrixStore.LogicalBuilder<N extends Number>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>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>ElementsConsumer.ColumnsRegion<N extends Number>, ElementsConsumer.ConsumerRegion<N extends Number>, ElementsConsumer.FillByMultiplying<N extends Number>, ElementsConsumer.LimitRegion<N extends Number>, ElementsConsumer.OffsetRegion<N extends Number>, ElementsConsumer.RowsRegion<N extends Number>, ElementsConsumer.TransposedRegion<N extends Number>Mutate2D.BiModifiable<N extends Number>, Mutate2D.Exchangeable, Mutate2D.Fillable<N extends Number>, Mutate2D.Mixable<N extends Number>, Mutate2D.Modifiable<N extends Number>, Mutate2D.Receiver<N extends Number>Mutate1D.SortableStructure2D.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| Modifier and Type | Field and Description |
|---|---|
double[][] |
data |
static PhysicalStore.Factory<Double,RawStore> |
FACTORY |
BIG, COMPLEX, PRIMITIVE| Constructor and Description |
|---|
RawStore(Access2D<?> template) |
RawStore(double[][] A)
Construct a matrix from a 2-D array.
|
RawStore(double[][] A,
int m,
int n)
Construct a matrix quickly without checking arguments.
|
RawStore(double[] elements,
int structure)
Construct a matrix from a one-dimensional packed array
|
RawStore(int m,
int n)
Construct an m-by-n matrix of zeros.
|
RawStore(int m,
int n,
double s)
Construct an m-by-n constant matrix.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Access2D<?> supplied) |
void |
add(long row,
long col,
double addend) |
void |
add(long row,
long col,
Number addend) |
Double |
aggregateAll(Aggregator aggregator) |
List<Double> |
asList() |
RawStore |
conjugate()
Returns the conjugate transpose of this matrix.
|
static RawStore |
constructWithCopy(double[][] A)
Construct a matrix from a copy of a 2-D array.
|
RawStore |
copy()
Make a deep copy of a matrix
|
double[][] |
copyOfData()
Copy the internal two-dimensional array.
|
long |
count()
count() == countRows() * countColumns()
|
long |
countColumns() |
long |
countRows() |
double |
doubleValue(long row,
long col)
Extracts one element of this matrix as a double.
|
boolean |
equals(Object other) |
void |
exchangeColumns(long colA,
long colB) |
void |
exchangeRows(long rowA,
long rowB) |
void |
fillAll(Double value) |
void |
fillAll(NullaryFunction<Double> supplier) |
void |
fillByMultiplying(Access1D<Double> leftMatrix,
Access1D<Double> rightMatrix) |
void |
fillColumn(long row,
long col,
Double value) |
void |
fillColumn(long row,
long col,
NullaryFunction<Double> supplier) |
void |
fillDiagonal(long row,
long col,
Double value) |
void |
fillDiagonal(long row,
long col,
NullaryFunction<Double> supplier) |
void |
fillMatching(Access1D<?> source)
Will fill the elements of [this] with the corresponding input values, and in the process (if
necessary) convert the elements to the correct type:
|
void |
fillMatching(Access1D<Double> left,
BinaryFunction<Double> function,
Access1D<Double> right) |
void |
fillMatching(Access1D<Double> left,
BinaryFunction<Double> function,
Double right)
Deprecated.
v39
|
void |
fillMatching(Double left,
BinaryFunction<Double> function,
Access1D<Double> right)
Deprecated.
v39
|
void |
fillOne(long row,
long col,
Access1D<?> values,
long valueIndex) |
void |
fillOne(long row,
long col,
Double value) |
void |
fillOne(long row,
long col,
NullaryFunction<Double> supplier) |
void |
fillRange(long first,
long limit,
Double value) |
void |
fillRange(long first,
long limit,
NullaryFunction<Double> supplier) |
void |
fillRow(long row,
long col,
Double value) |
void |
fillRow(long row,
long col,
NullaryFunction<Double> supplier) |
MatrixStore<Double> |
get() |
Double |
get(long row,
long col) |
RawStore |
getMatrix(int[] r,
int j0,
int j1)
Deprecated.
v39
|
RawStore |
getMatrix(int i0,
int i1,
int j0,
int j1)
Deprecated.
v39
|
int |
hashCode() |
long |
indexOfLargest() |
long |
indexOfLargestInColumn(long row,
long col) |
long |
indexOfLargestInRange(long first,
long limit) |
long |
indexOfLargestInRow(long row,
long col) |
long |
indexOfLargestOnDiagonal(long first) |
boolean |
isAbsolute(long index) |
boolean |
isAbsolute(long row,
long col) |
boolean |
isSmall(long index,
double comparedTo) |
boolean |
isSmall(long row,
long col,
double comparedTo) |
void |
modifyAll(UnaryFunction<Double> modifier) |
void |
modifyColumn(long row,
long col,
UnaryFunction<Double> modifier) |
void |
modifyDiagonal(long row,
long col,
UnaryFunction<Double> modifier) |
void |
modifyMatching(Access1D<Double> left,
BinaryFunction<Double> function) |
void |
modifyMatching(BinaryFunction<Double> function,
Access1D<Double> right) |
void |
modifyOne(long row,
long col,
UnaryFunction<Double> modifier) |
void |
modifyRange(long first,
long limit,
UnaryFunction<Double> modifier) |
void |
modifyRow(long row,
long col,
UnaryFunction<Double> modifier) |
RawStore |
multiply(MatrixStore<Double> right) |
Double |
multiplyBoth(Access1D<Double> leftAndRight)
Assumes [leftAndRight] is a vector and will calulate [leftAndRight]H[this][leftAndRight]
|
PhysicalStore.Factory<Double,RawStore> |
physical() |
static RawStore |
random(int m,
int n)
Generate matrix with random elements
|
static RawStore |
read(BufferedReader input)
Read a matrix from a stream.
|
ElementsConsumer<Double> |
regionByColumns(int... columns) |
ElementsConsumer<Double> |
regionByLimits(int rowLimit,
int columnLimit) |
ElementsConsumer<Double> |
regionByOffsets(int rowOffset,
int columnOffset) |
ElementsConsumer<Double> |
regionByRows(int... rows) |
ElementsConsumer<Double> |
regionByTransposing() |
void |
set(long row,
long col,
double value) |
void |
set(long row,
long col,
Number value) |
void |
substituteBackwards(Access2D<Double> body,
boolean unitDiagonal,
boolean conjugated,
boolean hermitian)
Will solve the equation system [A][X]=[B] where:
[body][this]=[this] is [A][X]=[B] ("this" is the right hand side, and it will be overwritten with
the solution).
[A] is upper/right triangular
|
void |
substituteForwards(Access2D<Double> body,
boolean unitDiagonal,
boolean conjugated,
boolean identity)
Will solve the equation system [A][X]=[B] where:
[body][this]=[this] is [A][X]=[B] ("this" is the right hand side, and it will be overwritten with
the solution).
[A] is lower/left triangular
|
void |
supplyTo(ElementsConsumer<Double> receiver) |
PrimitiveScalar |
toScalar(long row,
long column) |
String |
toString() |
void |
transformLeft(Householder<Double> transformation,
int firstColumn) |
void |
transformLeft(Rotation<Double> transformation)
As in
MatrixStore.premultiply(Access1D) where the left/parameter matrix is a plane rotation. |
void |
transformRight(Householder<Double> transformation,
int firstRow) |
void |
transformRight(Rotation<Double> transformation)
As in
MatrixStore.multiply(MatrixStore) where the right/parameter matrix is a plane rotation. |
RawStore |
transpose()
RawStore transpose.
|
void |
visitAll(VoidFunction<Double> visitor) |
void |
visitColumn(long row,
long col,
VoidFunction<Double> visitor) |
void |
visitDiagonal(long row,
long col,
VoidFunction<Double> visitor) |
void |
visitRange(long first,
long limit,
VoidFunction<Double> visitor) |
void |
visitRow(long row,
long col,
VoidFunction<Double> visitor) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, aggregateColumn, aggregateDiagonal, aggregateRange, aggregateRow, equals, firstInColumn, firstInRow, isSmall, limitOfColumn, limitOfRow, logical, multiply, multiply, multiply, negate, norm, premultiply, reduceColumns, reduceRows, signum, sliceColumn, sliceDiagonal, sliceRange, sliceRow, subtract, visitOneoperateOnAll, operateOnMatching, operateOnMatchingoperateOnAll, operateOnAll, operateOnAll, operateOnAll, operateOnAllcollectasCollectable2D, asPrimitive2D, columns, doubleValue, elements, equals, get, 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, spliteratorisColumnSmall, isColumnSmall, isRowSmall, isRowSmallisAllSmallvisitColumn, visitDiagonal, visitOne, visitRowaggregateColumn, aggregateRow, reduceColumns, reduceRowssliceColumn, sliceRowindexOfLargestInColumn, indexOfLargestInRow, indexOfLargestOnDiagonaltransformisAcceptablefillColumn, fillColumn, fillColumn, fillColumn, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillOne, fillOne, fillOne, fillRow, fillRow, fillRow, fillRowcolumn, column, column, column, column, index, index, isEmpty, isFat, isScalar, isSquare, isTall, isVector, loopAll, loopColumn, loopColumn, loopDiagonal, loopMatching, loopRow, loopRow, mapperOf, row, row, row, row, rowfillMatchingloopAll, loopMatching, loopRange, mappermodifyColumn, modifyDiagonal, modifyOne, modifyRowpublic static PhysicalStore.Factory<Double,RawStore> FACTORY
public final double[][] data
public RawStore(Access2D<?> template)
public RawStore(double[] elements,
int structure)
elements - One-dimensional array of doubles, packed by columns (ala Fortran).structure - Number of rows.IllegalArgumentException - Array length must be a multiple of m.public RawStore(double[][] A)
A - Two-dimensional array of doubles.IllegalArgumentException - All rows must have the same lengthconstructWithCopy(double[][])public RawStore(double[][] A,
int m,
int n)
A - Two-dimensional array of doubles.m - Number of rows.n - Number of colums.public RawStore(int m,
int n)
m - Number of rows.n - Number of colums.public RawStore(int m,
int n,
double s)
m - Number of rows.n - Number of colums.s - Fill the matrix with this scalar value.public static RawStore constructWithCopy(double[][] A)
A - Two-dimensional array of doubles.IllegalArgumentException - All rows must have the same lengthpublic static RawStore random(int m, int n)
m - Number of rows.n - Number of colums.public static RawStore read(BufferedReader input) throws IOException
input - the input stream.IOExceptionpublic void accept(Access2D<?> supplied)
public Double aggregateAll(Aggregator aggregator)
aggregateAll in interface Access1D.Aggregatable<Double>aggregateAll in interface MatrixStore<Double>public List<Double> asList()
asList in interface PhysicalStore<Double>public RawStore conjugate()
MatrixStoreconjugate in interface VectorSpace<MatrixStore<Double>,Double>conjugate in interface MatrixStore<Double>VectorSpace.conjugate()public RawStore copy()
copy in interface MatrixStore<Double>public double[][] copyOfData()
public long count()
Structure2Dcount in interface Structure1Dcount in interface Structure2Dpublic long countColumns()
countColumns in interface Structure2Dpublic long countRows()
countRows in interface Structure2Dpublic double doubleValue(long row,
long col)
Access2DdoubleValue in interface Access2D<Double>doubleValue in interface MatrixStore<Double>row - A row index.col - A column index.public void exchangeColumns(long colA,
long colB)
exchangeColumns in interface Mutate2D.Exchangeablepublic void exchangeRows(long rowA,
long rowB)
exchangeRows in interface Mutate2D.Exchangeablepublic void fillAll(Double value)
fillAll in interface Mutate1D.Fillable<Double>public void fillAll(NullaryFunction<Double> supplier)
fillAll in interface Mutate1D.Fillable<Double>public void fillByMultiplying(Access1D<Double> leftMatrix, Access1D<Double> rightMatrix)
fillByMultiplying in interface ElementsConsumer<Double>public void fillColumn(long row,
long col,
Double value)
fillColumn in interface Mutate2D.Fillable<Double>public void fillColumn(long row,
long col,
NullaryFunction<Double> supplier)
fillColumn in interface Mutate2D.Fillable<Double>public void fillDiagonal(long row,
long col,
Double value)
fillDiagonal in interface Mutate2D.Fillable<Double>public void fillDiagonal(long row,
long col,
NullaryFunction<Double> supplier)
fillDiagonal in interface Mutate2D.Fillable<Double>public void fillMatching(Access1D<?> source)
Mutate1D.FillableWill fill the elements of [this] with the corresponding input values, and in the process (if necessary) convert the elements to the correct type:
this(i) = values(i)fillMatching in interface Mutate1D.Fillable<Double>public void fillMatching(Access1D<Double> left, BinaryFunction<Double> function, Access1D<Double> right)
fillMatching in interface Mutate1D.Fillable<Double>@Deprecated public void fillMatching(Access1D<Double> left, BinaryFunction<Double> function, Double right)
@Deprecated public void fillMatching(Double left, BinaryFunction<Double> function, Access1D<Double> right)
public void fillOne(long row,
long col,
Access1D<?> values,
long valueIndex)
fillOne in interface Mutate2D.Fillable<Double>public void fillOne(long row,
long col,
Double value)
fillOne in interface Mutate2D.Fillable<Double>public void fillOne(long row,
long col,
NullaryFunction<Double> supplier)
fillOne in interface Mutate2D.Fillable<Double>public void fillRange(long first,
long limit,
Double value)
fillRange in interface Mutate1D.Fillable<Double>public void fillRange(long first,
long limit,
NullaryFunction<Double> supplier)
fillRange in interface Mutate1D.Fillable<Double>public void fillRow(long row,
long col,
Double value)
fillRow in interface Mutate2D.Fillable<Double>public void fillRow(long row,
long col,
NullaryFunction<Double> supplier)
fillRow in interface Mutate2D.Fillable<Double>public final MatrixStore<Double> get()
get in interface Supplier<MatrixStore<Double>>get in interface ElementsSupplier<Double>get in interface MatrixStore<Double>@Deprecated public RawStore getMatrix(int i0, int i1, int j0, int j1)
i0 - Initial row indexi1 - Final row indexj0 - Initial column indexj1 - Final column indexArrayIndexOutOfBoundsException - Submatrix indices@Deprecated public RawStore getMatrix(int[] r, int j0, int j1)
r - Array of row indices.j0 - Initial column indexj1 - Final column indexArrayIndexOutOfBoundsException - Submatrix indicespublic long indexOfLargest()
indexOfLargest in interface Access1D.IndexOfpublic long indexOfLargestInColumn(long row,
long col)
indexOfLargestInColumn in interface Access2D.IndexOfrow - First row to investigatecol - The columnpublic long indexOfLargestInRange(long first,
long limit)
indexOfLargestInRange in interface Access1D.IndexOfpublic long indexOfLargestInRow(long row,
long col)
indexOfLargestInRow in interface Access2D.IndexOfrow - The rowcol - The first column to investigatepublic long indexOfLargestOnDiagonal(long first)
indexOfLargestOnDiagonal in interface Access2D.IndexOffirst - The first row/column to investigatepublic boolean isAbsolute(long index)
isAbsolute in interface Access1D.ElementsisAbsolute in interface Access2D.ElementsScalar.isAbsolute()public boolean isAbsolute(long row,
long col)
isAbsolute in interface Access2D.ElementsisAbsolute in interface MatrixStore<Double>Scalar.isAbsolute()public boolean isSmall(long index,
double comparedTo)
isSmall in interface Access1D.ElementsisSmall in interface Access2D.ElementsNormedVectorSpace.isSmall(double)public boolean isSmall(long row,
long col,
double comparedTo)
isSmall in interface Access2D.ElementsisSmall in interface MatrixStore<Double>NormedVectorSpace.isSmall(double)public void modifyAll(UnaryFunction<Double> modifier)
modifyAll in interface Mutate1D.Modifiable<Double>public void modifyColumn(long row,
long col,
UnaryFunction<Double> modifier)
modifyColumn in interface Mutate2D.Modifiable<Double>public void modifyDiagonal(long row,
long col,
UnaryFunction<Double> modifier)
modifyDiagonal in interface Mutate2D.Modifiable<Double>public void modifyMatching(Access1D<Double> left, BinaryFunction<Double> function)
modifyMatching in interface Mutate1D.BiModifiable<Double>public void modifyMatching(BinaryFunction<Double> function, Access1D<Double> right)
modifyMatching in interface Mutate1D.BiModifiable<Double>public void modifyOne(long row,
long col,
UnaryFunction<Double> modifier)
modifyOne in interface Mutate2D.Modifiable<Double>public void modifyRange(long first,
long limit,
UnaryFunction<Double> modifier)
modifyRange in interface Mutate1D.Modifiable<Double>public void modifyRow(long row,
long col,
UnaryFunction<Double> modifier)
modifyRow in interface Mutate2D.Modifiable<Double>public RawStore multiply(MatrixStore<Double> right)
multiply in interface Operation.Multiplication<MatrixStore<Double>>multiply in interface MatrixStore<Double>right - The multiplicandthis * multiplicand.public Double multiplyBoth(Access1D<Double> leftAndRight)
MatrixStoremultiplyBoth in interface MatrixStore<Double>leftAndRight - The argument vectorpublic PhysicalStore.Factory<Double,RawStore> physical()
physical in interface ElementsSupplier<Double>public final ElementsConsumer<Double> regionByColumns(int... columns)
regionByColumns in interface ElementsConsumer<Double>public final ElementsConsumer<Double> regionByLimits(int rowLimit, int columnLimit)
regionByLimits in interface ElementsConsumer<Double>public final ElementsConsumer<Double> regionByOffsets(int rowOffset, int columnOffset)
regionByOffsets in interface ElementsConsumer<Double>public final ElementsConsumer<Double> regionByRows(int... rows)
regionByRows in interface ElementsConsumer<Double>public final ElementsConsumer<Double> regionByTransposing()
regionByTransposing in interface ElementsConsumer<Double>public void substituteBackwards(Access2D<Double> body, boolean unitDiagonal, boolean conjugated, boolean hermitian)
PhysicalStoresubstituteBackwards in interface PhysicalStore<Double>body - The equation system body parameters [A]unitDiagonal - TODOconjugated - true if the upper/right part of body is actually stored in the lower/left part of the
matrix, and the elements conjugated.hermitian - TODOpublic void substituteForwards(Access2D<Double> body, boolean unitDiagonal, boolean conjugated, boolean identity)
PhysicalStoresubstituteForwards in interface PhysicalStore<Double>body - The equation system body parameters [A]unitDiagonal - true if body has ones on the diagonalconjugated - TODOpublic void supplyTo(ElementsConsumer<Double> receiver)
supplyTo in interface Access2D.Collectable<Double,ElementsConsumer<Double>>supplyTo in interface MatrixStore<Double>public PrimitiveScalar toScalar(long row, long column)
toScalar in interface MatrixStore<Double>public void transformLeft(Householder<Double> transformation, int firstColumn)
transformLeft in interface PhysicalStore<Double>public void transformLeft(Rotation<Double> transformation)
PhysicalStore
As in MatrixStore.premultiply(Access1D) where the left/parameter matrix is a plane rotation.
Multiplying by a plane rotation from the left means that [this] gets two of its rows updated to new combinations of those two (current) rows.
There are two ways to transpose/invert a rotation. Either you negate the angle or you interchange the two indeces that define the rotation plane.
transformLeft in interface PhysicalStore<Double>PhysicalStore.transformRight(Rotation)public void transformRight(Householder<Double> transformation, int firstRow)
transformRight in interface PhysicalStore<Double>public void transformRight(Rotation<Double> transformation)
PhysicalStore
As in MatrixStore.multiply(MatrixStore) where the right/parameter matrix is a plane rotation.
Multiplying by a plane rotation from the right means that [this] gets two of its columns updated to new combinations of those two (current) columns.
There result is undefined if the two input indeces are the same (in which case the rotation plane is undefined).
transformRight in interface PhysicalStore<Double>PhysicalStore.transformLeft(Rotation)public RawStore transpose()
transpose in interface Stream2D<Double,MatrixStore<Double>,ElementsConsumer<Double>,ElementsSupplier<Double>>transpose in interface ElementsSupplier<Double>transpose in interface MatrixStore<Double>public void visitAll(VoidFunction<Double> visitor)
visitAll in interface Access1D.Visitable<Double>public void visitColumn(long row,
long col,
VoidFunction<Double> visitor)
visitColumn in interface Access2D.Visitable<Double>public void visitDiagonal(long row,
long col,
VoidFunction<Double> visitor)
visitDiagonal in interface Access2D.Visitable<Double>public void visitRange(long first,
long limit,
VoidFunction<Double> visitor)
visitRange in interface Access1D.Visitable<Double>public void visitRow(long row,
long col,
VoidFunction<Double> visitor)
visitRow in interface Access2D.Visitable<Double>Copyright © 2018 Optimatika. All rights reserved.