Class GenericStore<N extends Scalar<N>>
- java.lang.Object
-
- org.ojalgo.array.BasicArray<N>
-
- org.ojalgo.array.DenseArray<N>
-
- org.ojalgo.array.PlainArray<N>
-
- org.ojalgo.array.ReferenceTypeArray<N>
-
- org.ojalgo.array.ScalarArray<N>
-
- org.ojalgo.matrix.store.GenericStore<N>
-
- All Implemented Interfaces:
java.util.function.Consumer<Access2D<?>>
,java.util.RandomAccess
,Group
,Group.Additive<MatrixStore<N>>
,NormedVectorSpace<MatrixStore<N>,N>
,Operation
,Operation.Addition<MatrixStore<N>>
,Operation.Multiplication<MatrixStore<N>>
,Operation.Subtraction<MatrixStore<N>>
,ScalarOperation
,ScalarOperation.Addition<MatrixStore<N>,N>
,ScalarOperation.Division<MatrixStore<N>,N>
,ScalarOperation.Multiplication<MatrixStore<N>,N>
,ScalarOperation.Subtraction<MatrixStore<N>,N>
,VectorSpace<MatrixStore<N>,N>
,DecompositionStore<N>
,ExchangeColumns
,NegateColumn
,RotateRight
,Matrix2D<N,MatrixStore<N>>
,ElementsSupplier<N>
,MatrixStore<N>
,PhysicalStore<N>
,TransformableRegion<N>
,Access1D<N>
,Access1D.Aggregatable<N>
,Access1D.Collectable<N,Mutate1D>
,Access1D.Sliceable<N>
,Access1D.Visitable<N>
,Access2D<N>
,Access2D.Aggregatable<N>
,Access2D.Collectable<N,TransformableRegion<N>>
,Access2D.Sliceable<N>
,Access2D.Visitable<N>
,Factory1D.Builder<DenseArray<N>>
,Factory2D.Builder<GenericStore<N>>
,Mutate1D
,Mutate1D.Fillable<N>
,Mutate1D.Modifiable<N>
,Mutate1D.Sortable
,Mutate2D
,Mutate2D.Exchangeable
,Mutate2D.Fillable<N>
,Mutate2D.Modifiable<N>
,Mutate2D.ModifiableReceiver<N>
,Mutate2D.Receiver<N>
,Operate2D<N,ElementsSupplier<N>>
,Structure1D
,Structure2D
,Structure2D.Logical<Access2D<N>,MatrixStore<N>>
,Structure2D.ReducibleTo1D<ElementsSupplier<N>>
public final class GenericStore<N extends Scalar<N>> extends ScalarArray<N> implements PhysicalStore<N>, DecompositionStore<N>, Factory2D.Builder<GenericStore<N>>
A generic implementation of PhysicalStore.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
GenericStore.Factory<N extends Scalar<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Access1D
Access1D.Aggregatable<N extends java.lang.Comparable<N>>, Access1D.Collectable<N extends java.lang.Comparable<N>,R extends Mutate1D>, Access1D.ElementView<N extends java.lang.Comparable<N>>, Access1D.SelectionView<N extends java.lang.Comparable<N>>, Access1D.Sliceable<N extends java.lang.Comparable<N>>, Access1D.Visitable<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Access2D
Access2D.Aggregatable<N extends java.lang.Comparable<N>>, Access2D.Collectable<N extends java.lang.Comparable<N>,R extends Mutate2D>, Access2D.ColumnView<N extends java.lang.Comparable<N>>, Access2D.ElementView<N extends java.lang.Comparable<N>>, Access2D.RowView<N extends java.lang.Comparable<N>>, Access2D.SelectionView<N extends java.lang.Comparable<N>>, Access2D.Sliceable<N extends java.lang.Comparable<N>>, Access2D.Visitable<N extends java.lang.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.structure.Mutate1D
Mutate1D.Fillable<N extends java.lang.Comparable<N>>, Mutate1D.Mixable<N extends java.lang.Comparable<N>>, Mutate1D.Modifiable<N extends java.lang.Comparable<N>>, Mutate1D.ModifiableReceiver<N extends java.lang.Comparable<N>>, Mutate1D.Receiver<N extends java.lang.Comparable<N>>, Mutate1D.Sortable
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Mutate2D
Mutate2D.Exchangeable, Mutate2D.Fillable<N extends java.lang.Comparable<N>>, Mutate2D.Mixable<N extends java.lang.Comparable<N>>, Mutate2D.Modifiable<N extends java.lang.Comparable<N>>, Mutate2D.ModifiableReceiver<N extends java.lang.Comparable<N>>, Mutate2D.Receiver<N extends java.lang.Comparable<N>>
-
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.algebra.ScalarOperation
ScalarOperation.Addition<T,N extends java.lang.Comparable<N>>, ScalarOperation.Division<T,N extends java.lang.Comparable<N>>, ScalarOperation.Multiplication<T,N extends java.lang.Comparable<N>>, ScalarOperation.Subtraction<T,N extends java.lang.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>
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.store.TransformableRegion
TransformableRegion.FillByMultiplying<N extends java.lang.Comparable<N>>
-
-
Field Summary
Fields Modifier and Type Field Description static PhysicalStore.Factory<ComplexNumber,GenericStore<ComplexNumber>>
C128
static PhysicalStore.Factory<Quaternion,GenericStore<Quaternion>>
H256
private MultiplyBoth.Generic<N>
multiplyBoth
private MultiplyLeft.Generic<N>
multiplyLeft
private MultiplyNeither.Generic<N>
multiplyNeither
private MultiplyRight.Generic<N>
multiplyRight
private int
myColDim
private GenericStore.Factory<N>
myFactory
private int
myRowDim
private Array2D<N>
myUtility
private N[]
myWorkerColumn
static PhysicalStore.Factory<RationalNumber,GenericStore<RationalNumber>>
Q128
static PhysicalStore.Factory<Quadruple,GenericStore<Quadruple>>
R128
-
Fields inherited from class org.ojalgo.array.ReferenceTypeArray
data
-
Fields inherited from class org.ojalgo.array.PlainArray
MAX_SIZE
-
Fields inherited from interface org.ojalgo.matrix.decomposition.function.ExchangeColumns
NULL
-
Fields inherited from interface org.ojalgo.matrix.decomposition.function.NegateColumn
NULL
-
Fields inherited from interface org.ojalgo.matrix.decomposition.function.RotateRight
NULL
-
-
Constructor Summary
Constructors Modifier Constructor Description private
GenericStore(GenericStore.Factory<N> factory, int numbRows)
(package private)
GenericStore(GenericStore.Factory<N> factory, int numbRows, int numbCols)
(package private)
GenericStore(GenericStore.Factory<N> factory, int numbRows, int numbCols, N[] dataArray)
private
GenericStore(GenericStore.Factory<N> factory, N[] dataArray)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Access2D<?> supplied)
void
add(long row, long col, double addend)
void
add(long row, long col, java.lang.Comparable<?> addend)
void
applyCholesky(int iterationPoint, BasicArray<N> multipliers)
Cholesky transformationsvoid
applyLDL(int iterationPoint, BasicArray<N> multipliers)
LDL transformationsvoid
applyLU(int iterationPoint, BasicArray<N> multipliers)
LU transformationsArray1D<N>
asList()
GenericStore<N>
build()
private Householder.Generic<N>
cast(Householder<N> transformation)
private Rotation.Generic<N>
cast(Rotation<N> transformation)
private GenericStore<N>
cast(Access1D<?> matrix)
Array1D<ComplexNumber>
computeInPlaceSchur(PhysicalStore<N> transformationCollector, boolean eigenvalue)
MatrixStore<N>
conjugate()
Returns the conjugate transpose of this matrix.GenericStore<N>
copy()
Each call must produce a new instance.long
countColumns()
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.long
countRows()
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.void
divideAndCopyColumn(int row, int column, BasicArray<N> destination)
double
doubleValue(int row, int col)
Extracts one element of this matrix as a double.boolean
equals(java.lang.Object obj)
void
exchangeColumns(long colA, long colB)
void
exchangeHermitian(int indexA, int indexB)
void
exchangeRows(long rowA, long rowB)
void
fillByMultiplying(Access1D<N> left, Access1D<N> right)
void
fillColumn(long row, long col, N value)
void
fillColumn(long row, long col, NullaryFunction<?> supplier)
void
fillColumn(long row, long col, Access1D<N> values)
void
fillDiagonal(long row, long col, N value)
void
fillDiagonal(long row, long col, NullaryFunction<?> supplier)
void
fillMatching(UnaryFunction<N> function, Access1D<N> arguments)
void
fillMatching(Access1D<?> values)
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<N> left, BinaryFunction<N> function, Access1D<N> right)
void
fillRow(long row, long col, N value)
void
fillRow(long row, long col, NullaryFunction<?> supplier)
void
fillRow(long row, long col, Access1D<N> values)
boolean
generateApplyAndCopyHouseholderColumn(int row, int column, Householder<N> destination)
boolean
generateApplyAndCopyHouseholderRow(int row, int column, Householder<N> destination)
MatrixStore<N>
get()
N
get(int row, int col)
int
getColDim()
int
getMaxDim()
int
getMinDim()
int
getRowDim()
private N[]
getWorkerColumn()
int
hashCode()
void
modifyAll(UnaryFunction<N> modifier)
void
modifyColumn(long row, long col, UnaryFunction<N> modifier)
void
modifyDiagonal(long row, long col, UnaryFunction<N> modifier)
void
modifyOne(long row, long col, UnaryFunction<N> modifier)
void
modifyRow(long row, long col, UnaryFunction<N> modifier)
MatrixStore<N>
multiply(MatrixStore<N> right)
N
multiplyBoth(Access1D<N> leftAndRight)
Assumes [leftAndRight] is a vector and will calulate [leftAndRight]H[this][leftAndRight]void
negateColumn(int column)
PhysicalStore.Factory<N,GenericStore<N>>
physical()
TransformableRegion<N>
regionByColumns(int... columns)
TransformableRegion<N>
regionByLimits(int rowLimit, int columnLimit)
TransformableRegion<N>
regionByOffsets(int rowOffset, int columnOffset)
TransformableRegion<N>
regionByRows(int... rows)
TransformableRegion<N>
regionByTransposing()
void
rotateRight(int low, int high, double cos, double sin)
void
set(int row, int col, double value)
void
set(long row, long col, java.lang.Comparable<?> value)
void
setToIdentity(int col)
Array1D<N>
sliceColumn(long row, long col)
Array1D<N>
sliceDiagonal(long row, long col)
Array1D<N>
sliceRange(long first, long limit)
Array1D<N>
sliceRow(long row, long col)
void
substituteBackwards(Access2D<N> 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 triangularvoid
substituteForwards(Access2D<N> 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 triangularScalar<N>
toScalar(int row, int col)
Extracts one element of this matrix as a Scalar.java.lang.String
toString()
void
transformLeft(Householder<N> transformation, int firstColumn)
void
transformLeft(Rotation<N> transformation)
As inMatrixStore.premultiply(Access1D)
where the left/parameter matrix is a plane rotation.void
transformRight(Householder<N> transformation, int firstRow)
void
transformRight(Rotation<N> transformation)
As inMatrixStore.multiply(MatrixStore)
where the right/parameter matrix is a plane rotation.void
transformSymmetric(Householder<N> transformation)
MatrixStore<N>
transpose()
void
tred2(BasicArray<N> mainDiagonal, BasicArray<N> offDiagonal, boolean yesvecs)
void
visitColumn(long row, long col, VoidFunction<N> visitor)
void
visitDiagonal(long row, long col, VoidFunction<N> visitor)
void
visitRow(long row, long col, VoidFunction<N> visitor)
static <N extends Scalar<N>>
GenericStore<N>wrap(GenericStore.Factory<N> factory, N... data)
static <N extends Scalar<N>>
GenericStore<N>wrap(GenericStore.Factory<N> factory, N[] data, int structure)
-
Methods inherited from class org.ojalgo.array.ScalarArray
add, add, axpy, byteValue, doubleValue, fillOne, floatValue, indexOfLargest, intValue, isAbsolute, isSmall, longValue, set, shortValue, sortAscending, sortDescending
-
Methods inherited from class org.ojalgo.array.ReferenceTypeArray
copyOfData, exchange, fill, fill, fillOne, fillOne, get, modify, modify, modify, modifyOne, reset, searchAscending, set, set, set, spliterator, visit, visitOne
-
Methods inherited from class org.ojalgo.array.PlainArray
add, add, add, add, add, add, add, add, add, add, add, add, byteValue, count, doubleValue, exchange, fill, fill, fillAll, fillAll, fillRange, fillRange, floatValue, get, indexOfLargest, intValue, longValue, modify, modify, modify, modifyOne, set, set, set, set, set, set, set, set, set, set, shortValue, size, visit, visitOne
-
Methods inherited from class org.ojalgo.array.BasicArray
aggregateRange, getMathType, indexOfLargest, isPrimitive, modifyMatching, modifyMatching, modifyRange, supplyTo, visitAll, visitRange, wrapInArray1D, wrapInArray2D, wrapInArrayAnyD
-
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.Collectable
collect
-
Methods inherited from interface org.ojalgo.structure.Access1D.Visitable
visitAll, visitRange
-
Methods inherited from interface org.ojalgo.structure.Access2D
asCollectable2D, asKeyed2D, byteValue, byteValue, byteValue, byteValue, columns, doubleValue, doubleValue, doubleValue, elements, floatValue, floatValue, floatValue, floatValue, get, 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.structure.Access2D.Sliceable
sliceDiagonal
-
Methods inherited from interface org.ojalgo.structure.Access2D.Visitable
visitColumn, visitDiagonal, visitOne, visitRow
-
Methods inherited from interface org.ojalgo.matrix.decomposition.DecompositionStore
exchangeColumns, sliceColumn, sliceRow
-
Methods inherited from interface org.ojalgo.matrix.store.ElementsSupplier
onAny, onColumns, onColumns, onMatching, onMatching, onRows, onRows
-
Methods inherited from interface org.ojalgo.matrix.store.MatrixStore
above, above, above, add, add, add, aggregateAll, aggregateColumn, aggregateDiagonal, aggregateRange, aggregateRow, below, below, below, bidiagonal, column, column, columns, columns, diagonal, diagonally, divide, divide, equals, get, hermitian, hessenberg, indexOfLargest, isHermitian, isNormal, isSmall, isSmall, left, left, left, limits, logical, multiply, multiply, multiply, negate, norm, offsets, onAll, operate, power, premultiply, reduceColumns, reduceRows, repeat, right, right, right, row, row, rows, rows, select, select, signum, subtract, subtract, subtract, superimpose, superimpose, symmetric, triangular, tridiagonal, visitOne
-
Methods inherited from interface org.ojalgo.structure.Mutate1D.Fillable
fillAll, fillAll, fillCompatible, fillRange, fillRange
-
Methods inherited from interface org.ojalgo.structure.Mutate1D.Modifiable
modifyMatching, modifyMatching, modifyRange
-
Methods inherited from interface org.ojalgo.structure.Mutate2D
set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set
-
Methods inherited from interface org.ojalgo.structure.Mutate2D.Fillable
fillColumn, fillColumn, fillColumn, fillCompatible, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillRow, fillRow, fillRow
-
Methods inherited from interface org.ojalgo.structure.Mutate2D.Modifiable
add, add, add, add, add, add, add, add, add, add, add, add, modifyColumn, modifyDiagonal, modifyMatchingInColumns, modifyMatchingInColumns, modifyMatchingInRows, modifyMatchingInRows, modifyOne, modifyRow
-
Methods inherited from interface org.ojalgo.structure.Mutate2D.ModifiableReceiver
modifyCompatible, modifyCompatible
-
Methods inherited from interface org.ojalgo.structure.Mutate2D.Receiver
isAcceptable
-
Methods inherited from interface org.ojalgo.structure.Operate2D
onAll, onAll, onAll, onAll, onAll, onCompatible, onCompatible
-
Methods inherited from interface org.ojalgo.matrix.store.PhysicalStore
indexOfLargestInColumn, indexOfLargestInRow, indexOfLargestOnDiagonal, modifyAny, supplyTo
-
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
count, firstInColumn, firstInRow, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
Methods inherited from interface org.ojalgo.matrix.store.TransformableRegion
synchronised
-
-
-
-
Field Detail
-
C128
public static final PhysicalStore.Factory<ComplexNumber,GenericStore<ComplexNumber>> C128
-
H256
public static final PhysicalStore.Factory<Quaternion,GenericStore<Quaternion>> H256
-
Q128
public static final PhysicalStore.Factory<RationalNumber,GenericStore<RationalNumber>> Q128
-
R128
public static final PhysicalStore.Factory<Quadruple,GenericStore<Quadruple>> R128
-
multiplyBoth
private final MultiplyBoth.Generic<N extends Scalar<N>> multiplyBoth
-
multiplyLeft
private final MultiplyLeft.Generic<N extends Scalar<N>> multiplyLeft
-
multiplyNeither
private final MultiplyNeither.Generic<N extends Scalar<N>> multiplyNeither
-
multiplyRight
private final MultiplyRight.Generic<N extends Scalar<N>> multiplyRight
-
myColDim
private final int myColDim
-
myFactory
private final GenericStore.Factory<N extends Scalar<N>> myFactory
-
myRowDim
private final int myRowDim
-
-
Constructor Detail
-
GenericStore
private GenericStore(GenericStore.Factory<N> factory, int numbRows)
-
GenericStore
private GenericStore(GenericStore.Factory<N> factory, N[] dataArray)
-
GenericStore
GenericStore(GenericStore.Factory<N> factory, int numbRows, int numbCols)
-
GenericStore
GenericStore(GenericStore.Factory<N> factory, int numbRows, int numbCols, N[] dataArray)
-
-
Method Detail
-
wrap
public static <N extends Scalar<N>> GenericStore<N> wrap(GenericStore.Factory<N> factory, N... data)
-
wrap
public static <N extends Scalar<N>> GenericStore<N> wrap(GenericStore.Factory<N> factory, N[] data, int structure)
-
accept
public void accept(Access2D<?> supplied)
-
add
public void add(long row, long col, java.lang.Comparable<?> addend)
- Specified by:
add
in interfaceMutate2D.Modifiable<N extends Scalar<N>>
-
add
public void add(long row, long col, double addend)
- Specified by:
add
in interfaceMutate2D.Modifiable<N extends Scalar<N>>
-
applyCholesky
public void applyCholesky(int iterationPoint, BasicArray<N> multipliers)
Description copied from interface:DecompositionStore
Cholesky transformations- Specified by:
applyCholesky
in interfaceDecompositionStore<N extends Scalar<N>>
-
applyLDL
public void applyLDL(int iterationPoint, BasicArray<N> multipliers)
Description copied from interface:DecompositionStore
LDL transformations- Specified by:
applyLDL
in interfaceDecompositionStore<N extends Scalar<N>>
-
applyLU
public void applyLU(int iterationPoint, BasicArray<N> multipliers)
Description copied from interface:DecompositionStore
LU transformations- Specified by:
applyLU
in interfaceDecompositionStore<N extends Scalar<N>>
-
asList
public Array1D<N> asList()
- Specified by:
asList
in interfacePhysicalStore<N extends Scalar<N>>
- Returns:
- The elements of the physical store as a fixed size (1 dimensional) list. The elements may be accessed either row or colomn major.
-
build
public GenericStore<N> build()
- Specified by:
build
in interfaceFactory1D.Builder<N extends Scalar<N>>
- Specified by:
build
in interfaceFactory2D.Builder<N extends Scalar<N>>
- Overrides:
build
in classDenseArray<N extends Scalar<N>>
-
computeInPlaceSchur
public Array1D<ComplexNumber> computeInPlaceSchur(PhysicalStore<N> transformationCollector, boolean eigenvalue)
- Specified by:
computeInPlaceSchur
in interfaceDecompositionStore<N extends Scalar<N>>
-
conjugate
public MatrixStore<N> conjugate()
Description copied from interface:MatrixStore
Returns the conjugate transpose of this matrix. The conjugate transpose is also known as adjoint matrix, adjugate matrix, hermitian adjoint or hermitian transpose. (The conjugate matrix is the complex conjugate of each element. This NOT what is returned here!)- Specified by:
conjugate
in interfaceMatrixStore<N extends Scalar<N>>
- Specified by:
conjugate
in interfaceStructure2D.Logical<Access2D<N extends Scalar<N>>,MatrixStore<N extends Scalar<N>>>
- Specified by:
conjugate
in interfaceVectorSpace<MatrixStore<N extends Scalar<N>>,N extends Scalar<N>>
- See Also:
VectorSpace.conjugate()
-
copy
public GenericStore<N> copy()
Description copied from interface:MatrixStore
Each call must produce a new instance.- Specified by:
copy
in interfaceMatrixStore<N extends Scalar<N>>
- Returns:
- A new PhysicalStore copy.
-
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
-
divideAndCopyColumn
public void divideAndCopyColumn(int row, int column, BasicArray<N> destination)
- Specified by:
divideAndCopyColumn
in interfaceDecompositionStore<N extends Scalar<N>>
-
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 Scalar<N>>
- Specified by:
doubleValue
in interfaceMatrixStore<N extends Scalar<N>>
- Parameters:
row
- A row index.col
- A column index.- Returns:
- One matrix element
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classReferenceTypeArray<N extends Scalar<N>>
-
exchangeColumns
public void exchangeColumns(long colA, long colB)
- Specified by:
exchangeColumns
in interfaceMutate2D.Exchangeable
- Specified by:
exchangeColumns
in interfaceTransformableRegion<N extends Scalar<N>>
-
exchangeHermitian
public void exchangeHermitian(int indexA, int indexB)
- Specified by:
exchangeHermitian
in interfaceDecompositionStore<N extends Scalar<N>>
-
exchangeRows
public void exchangeRows(long rowA, long rowB)
- Specified by:
exchangeRows
in interfaceMutate2D.Exchangeable
- Specified by:
exchangeRows
in interfaceTransformableRegion<N extends Scalar<N>>
-
fillByMultiplying
public void fillByMultiplying(Access1D<N> left, Access1D<N> right)
- Specified by:
fillByMultiplying
in interfaceTransformableRegion<N extends Scalar<N>>
-
fillColumn
public void fillColumn(long row, long col, Access1D<N> values)
- Specified by:
fillColumn
in interfaceMutate2D.Fillable<N extends Scalar<N>>
-
fillColumn
public void fillColumn(long row, long col, N value)
- Specified by:
fillColumn
in interfaceMutate2D.Fillable<N extends Scalar<N>>
-
fillColumn
public void fillColumn(long row, long col, NullaryFunction<?> supplier)
- Specified by:
fillColumn
in interfaceMutate2D.Fillable<N extends Scalar<N>>
-
fillDiagonal
public void fillDiagonal(long row, long col, N value)
- Specified by:
fillDiagonal
in interfaceMutate2D.Fillable<N extends Scalar<N>>
-
fillDiagonal
public void fillDiagonal(long row, long col, NullaryFunction<?> supplier)
- Specified by:
fillDiagonal
in interfaceMutate2D.Fillable<N extends Scalar<N>>
-
fillMatching
public void fillMatching(Access1D<?> values)
Description copied from interface:Mutate1D.Fillable
Will 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)
- Specified by:
fillMatching
in interfaceMutate1D.Fillable<N extends Scalar<N>>
- Overrides:
fillMatching
in classReferenceTypeArray<N extends Scalar<N>>
-
fillMatching
public void fillMatching(Access1D<N> left, BinaryFunction<N> function, Access1D<N> right)
- Specified by:
fillMatching
in interfaceMutate1D.Fillable<N extends Scalar<N>>
- Overrides:
fillMatching
in classReferenceTypeArray<N extends Scalar<N>>
-
fillMatching
public void fillMatching(UnaryFunction<N> function, Access1D<N> arguments)
- Specified by:
fillMatching
in interfaceMutate1D.Fillable<N extends Scalar<N>>
- Overrides:
fillMatching
in classReferenceTypeArray<N extends Scalar<N>>
-
fillRow
public void fillRow(long row, long col, Access1D<N> values)
- Specified by:
fillRow
in interfaceMutate2D.Fillable<N extends Scalar<N>>
-
fillRow
public void fillRow(long row, long col, N value)
- Specified by:
fillRow
in interfaceMutate2D.Fillable<N extends Scalar<N>>
-
fillRow
public void fillRow(long row, long col, NullaryFunction<?> supplier)
- Specified by:
fillRow
in interfaceMutate2D.Fillable<N extends Scalar<N>>
-
generateApplyAndCopyHouseholderColumn
public boolean generateApplyAndCopyHouseholderColumn(int row, int column, Householder<N> destination)
- Specified by:
generateApplyAndCopyHouseholderColumn
in interfaceDecompositionStore<N extends Scalar<N>>
-
generateApplyAndCopyHouseholderRow
public boolean generateApplyAndCopyHouseholderRow(int row, int column, Householder<N> destination)
- Specified by:
generateApplyAndCopyHouseholderRow
in interfaceDecompositionStore<N extends Scalar<N>>
-
get
public MatrixStore<N> get()
- Specified by:
get
in interfaceMatrixStore<N extends Scalar<N>>
-
getColDim
public int getColDim()
- Specified by:
getColDim
in interfaceStructure2D
- Returns:
- The number of columns
-
getMaxDim
public int getMaxDim()
- Specified by:
getMaxDim
in interfaceStructure2D
-
getMinDim
public int getMinDim()
- Specified by:
getMinDim
in interfaceStructure2D
-
getRowDim
public int getRowDim()
- Specified by:
getRowDim
in interfaceStructure2D
- Returns:
- The number of rows
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classReferenceTypeArray<N extends Scalar<N>>
-
modifyAll
public void modifyAll(UnaryFunction<N> modifier)
- Specified by:
modifyAll
in interfaceMutate1D.Modifiable<N extends Scalar<N>>
- Overrides:
modifyAll
in classBasicArray<N extends Scalar<N>>
-
modifyColumn
public void modifyColumn(long row, long col, UnaryFunction<N> modifier)
- Specified by:
modifyColumn
in interfaceMutate2D.Modifiable<N extends Scalar<N>>
-
modifyDiagonal
public void modifyDiagonal(long row, long col, UnaryFunction<N> modifier)
- Specified by:
modifyDiagonal
in interfaceMutate2D.Modifiable<N extends Scalar<N>>
-
modifyOne
public void modifyOne(long row, long col, UnaryFunction<N> modifier)
- Specified by:
modifyOne
in interfaceMutate2D.Modifiable<N extends Scalar<N>>
-
modifyRow
public void modifyRow(long row, long col, UnaryFunction<N> modifier)
- Specified by:
modifyRow
in interfaceMutate2D.Modifiable<N extends Scalar<N>>
-
multiply
public MatrixStore<N> multiply(MatrixStore<N> right)
- Specified by:
multiply
in interfaceMatrixStore<N extends Scalar<N>>
- Specified by:
multiply
in interfaceOperation.Multiplication<N extends Scalar<N>>
- Parameters:
right
- The multiplicand- Returns:
this * multiplicand
.
-
multiplyBoth
public N multiplyBoth(Access1D<N> leftAndRight)
Description copied from interface:MatrixStore
Assumes [leftAndRight] is a vector and will calulate [leftAndRight]H[this][leftAndRight]- Specified by:
multiplyBoth
in interfaceMatrixStore<N extends Scalar<N>>
- Parameters:
leftAndRight
- The argument vector- Returns:
- A scalar (extracted from the resulting 1 x 1 matrix)
-
negateColumn
public void negateColumn(int column)
- Specified by:
negateColumn
in interfaceNegateColumn
-
physical
public PhysicalStore.Factory<N,GenericStore<N>> physical()
- Specified by:
physical
in interfaceMatrixStore<N extends Scalar<N>>
-
regionByColumns
public TransformableRegion<N> regionByColumns(int... columns)
- Specified by:
regionByColumns
in interfaceTransformableRegion<N extends Scalar<N>>
- Returns:
- A consumer (sub)region
-
regionByLimits
public TransformableRegion<N> regionByLimits(int rowLimit, int columnLimit)
- Specified by:
regionByLimits
in interfaceTransformableRegion<N extends Scalar<N>>
- Returns:
- A consumer (sub)region
-
regionByOffsets
public TransformableRegion<N> regionByOffsets(int rowOffset, int columnOffset)
- Specified by:
regionByOffsets
in interfaceTransformableRegion<N extends Scalar<N>>
- Returns:
- A consumer (sub)region
-
regionByRows
public TransformableRegion<N> regionByRows(int... rows)
- Specified by:
regionByRows
in interfaceTransformableRegion<N extends Scalar<N>>
- Returns:
- A consumer (sub)region
-
regionByTransposing
public TransformableRegion<N> regionByTransposing()
- Specified by:
regionByTransposing
in interfaceTransformableRegion<N extends Scalar<N>>
- Returns:
- A transposed consumer region
-
rotateRight
public void rotateRight(int low, int high, double cos, double sin)
- Specified by:
rotateRight
in interfaceRotateRight
-
set
public void set(long row, long col, java.lang.Comparable<?> value)
-
setToIdentity
public void setToIdentity(int col)
- Specified by:
setToIdentity
in interfaceDecompositionStore<N extends Scalar<N>>
-
sliceColumn
public Array1D<N> sliceColumn(long row, long col)
- Specified by:
sliceColumn
in interfaceAccess2D.Sliceable<N extends Scalar<N>>
- Specified by:
sliceColumn
in interfaceDecompositionStore<N extends Scalar<N>>
- Specified by:
sliceColumn
in interfaceMatrixStore<N extends Scalar<N>>
-
sliceDiagonal
public Array1D<N> sliceDiagonal(long row, long col)
- Specified by:
sliceDiagonal
in interfaceAccess2D.Sliceable<N extends Scalar<N>>
- Specified by:
sliceDiagonal
in interfaceDecompositionStore<N extends Scalar<N>>
- Specified by:
sliceDiagonal
in interfaceMatrixStore<N extends Scalar<N>>
-
sliceRange
public Array1D<N> sliceRange(long first, long limit)
- Specified by:
sliceRange
in interfaceAccess1D.Sliceable<N extends Scalar<N>>
- Specified by:
sliceRange
in interfaceDecompositionStore<N extends Scalar<N>>
- Specified by:
sliceRange
in interfaceMatrixStore<N extends Scalar<N>>
-
sliceRow
public Array1D<N> sliceRow(long row, long col)
- Specified by:
sliceRow
in interfaceAccess2D.Sliceable<N extends Scalar<N>>
- Specified by:
sliceRow
in interfaceDecompositionStore<N extends Scalar<N>>
- Specified by:
sliceRow
in interfaceMatrixStore<N extends Scalar<N>>
-
substituteBackwards
public void substituteBackwards(Access2D<N> body, boolean unitDiagonal, boolean conjugated, boolean hermitian)
Description copied from interface:PhysicalStore
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
- Specified by:
substituteBackwards
in interfacePhysicalStore<N extends Scalar<N>>
- See Also:
SubstituteBackwards.invoke(double[], int, int, int, Access2D, boolean, boolean, boolean)
-
substituteForwards
public void substituteForwards(Access2D<N> body, boolean unitDiagonal, boolean conjugated, boolean identity)
Description copied from interface:PhysicalStore
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
- Specified by:
substituteForwards
in interfacePhysicalStore<N extends Scalar<N>>
- See Also:
SubstituteForwards.invoke(double[], int, int, int, Access2D, boolean, boolean, boolean)
-
toScalar
public Scalar<N> toScalar(int row, int col)
Description copied from interface:Matrix2D
Extracts one element of this matrix as a Scalar.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classBasicArray<N extends Scalar<N>>
-
transformLeft
public void transformLeft(Householder<N> transformation, int firstColumn)
- Specified by:
transformLeft
in interfacePhysicalStore<N extends Scalar<N>>
-
transformLeft
public void transformLeft(Rotation<N> transformation)
Description copied from interface: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.
- Specified by:
transformLeft
in interfacePhysicalStore<N extends Scalar<N>>
- See Also:
PhysicalStore.transformRight(Rotation)
-
transformRight
public void transformRight(Householder<N> transformation, int firstRow)
- Specified by:
transformRight
in interfacePhysicalStore<N extends Scalar<N>>
-
transformRight
public void transformRight(Rotation<N> transformation)
Description copied from interface: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).
- Specified by:
transformRight
in interfacePhysicalStore<N extends Scalar<N>>
- See Also:
PhysicalStore.transformLeft(Rotation)
-
transformSymmetric
public void transformSymmetric(Householder<N> transformation)
- Specified by:
transformSymmetric
in interfaceDecompositionStore<N extends Scalar<N>>
-
transpose
public MatrixStore<N> transpose()
- Specified by:
transpose
in interfaceElementsSupplier<N extends Scalar<N>>
- Specified by:
transpose
in interfaceMatrix2D<N extends Scalar<N>,MatrixStore<N extends Scalar<N>>>
- Specified by:
transpose
in interfaceMatrixStore<N extends Scalar<N>>
- Specified by:
transpose
in interfaceStructure2D.Logical<Access2D<N extends Scalar<N>>,MatrixStore<N extends Scalar<N>>>
- Returns:
- A transposed matrix instance.
-
tred2
public void tred2(BasicArray<N> mainDiagonal, BasicArray<N> offDiagonal, boolean yesvecs)
- Specified by:
tred2
in interfaceDecompositionStore<N extends Scalar<N>>
-
visitColumn
public void visitColumn(long row, long col, VoidFunction<N> visitor)
- Specified by:
visitColumn
in interfaceAccess2D.Visitable<N extends Scalar<N>>
-
visitDiagonal
public void visitDiagonal(long row, long col, VoidFunction<N> visitor)
- Specified by:
visitDiagonal
in interfaceAccess2D.Visitable<N extends Scalar<N>>
-
visitRow
public void visitRow(long row, long col, VoidFunction<N> visitor)
- Specified by:
visitRow
in interfaceAccess2D.Visitable<N extends Scalar<N>>
-
cast
private GenericStore<N> cast(Access1D<?> matrix)
-
cast
private Householder.Generic<N> cast(Householder<N> transformation)
-
cast
private Rotation.Generic<N> cast(Rotation<N> transformation)
-
getWorkerColumn
private N[] getWorkerColumn()
-
-