Class MatrixTensor<N extends Comparable<N>>
- All Implemented Interfaces:
Consumer<Access2D<?>>, Group, Group.Additive<MatrixTensor<N>>, NormedVectorSpace<MatrixTensor<N>, N>, Operation, Operation.Addition<MatrixTensor<N>>, ScalarOperation, ScalarOperation.Multiplication<MatrixTensor<N>, N>, VectorSpace<MatrixTensor<N>, N>, Access1D<N>, Access2D<N>, Mutate1D, Mutate1D.Fillable<N>, Mutate2D, Mutate2D.Fillable<N>, Mutate2D.Receiver<N>, Structure1D, Structure2D, Tensor<N, MatrixTensor<N>>
public final class MatrixTensor<N extends Comparable<N>>
extends ArrayBasedTensor<N, MatrixTensor<N>>
implements Access2D<N>, Mutate2D.Receiver<N>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classMatrixTensor.Factory<N extends Comparable<N>>Nested classes/interfaces inherited from interface Access2D
Access2D.Aggregatable<N>, Access2D.Collectable<N,R>, Access2D.ColumnView<N>, Access2D.ElementView<N>, Access2D.RowView<N>, Access2D.SelectionView<N>, Access2D.Sliceable<N>, Access2D.Visitable<N> Nested classes/interfaces inherited from interface Group
Group.Additive<T>, Group.Multiplicative<T>Nested classes/interfaces inherited from interface Mutate1D
Mutate1D.Fillable<N>, Mutate1D.Mixable<N>, Mutate1D.Modifiable<N>, Mutate1D.ModifiableReceiver<N>, Mutate1D.Receiver<N>, Mutate1D.SortableNested classes/interfaces inherited from interface Mutate2D
Mutate2D.Exchangeable, Mutate2D.Fillable<N>, Mutate2D.Mixable<N>, Mutate2D.Modifiable<N>, Mutate2D.ModifiableReceiver<N>, Mutate2D.Receiver<N>Nested classes/interfaces inherited from interface Operation
Operation.Addition<T>, Operation.Division<T>, Operation.Multiplication<T>, Operation.Subtraction<T>Nested classes/interfaces inherited from interface ScalarOperation
ScalarOperation.Addition<T,N>, ScalarOperation.Division<T, N>, ScalarOperation.Multiplication<T, N>, ScalarOperation.Subtraction<T, N> Nested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S,B>, Structure1D.LongIndex, Structure1D.LoopCallback Nested classes/interfaces inherited from interface Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S,B>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R>, Structure2D.Reshapable, Structure2D.RowColumnKey<R, C>, Structure2D.RowColumnMapper<R, C> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(MatrixTensor<N> addend) bytebyteValue(int row, int col) bytebyteValue(long row, long col) This method will (most likely) be moved to some other interface in the future! Just have to figure out where it fits...longcount()count() == countRows() * countColumns()longOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.longOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.doubledoubleValue(int row, int col) Extracts one element of this matrix as a double.doubledoubleValue(long row, long col) booleanstatic <N extends Comparable<N>>
TensorFactory2D<N, MatrixTensor<N>> factory(DenseArray.Factory<N, ?> arrayFactory) floatfloatValue(int row, int col) floatfloatValue(long row, long col) get(long row, long col) getArray()intintinthashCode()intintValue(int row, int col) intintValue(long row, long col) longlongValue(int row, int col) longlongValue(long row, long col) multiply(double scalarMultiplicand) negate()The additive inverse of this.(package private) MatrixTensor<N> doublenorm()this == this.signum().multiply(this.norm())voidset(int row, int col, byte value) voidset(int row, int col, double value) voidset(int row, int col, float value) voidset(int row, int col, int value) voidset(int row, int col, long value) voidset(int row, int col, short value) voidset(long row, long col, byte value) voidset(long row, long col, double value) voidset(long row, long col, float value) voidset(long row, long col, int value) voidset(long row, long col, long value) voidset(long row, long col, short value) voidset(long row, long col, Comparable<?> value) shortshortValue(int row, int col) shortshortValue(long row, long col) toString()Methods inherited from class ArrayBasedTensor
add, dimensions, multiply, multiply, negate, norm, rank, signumMethods inherited from interface Access1D
asCollectable1D, asKeyed1D, asList, axpy, dot, select, supplyTo, toList, toRawCopy1DMethods inherited from interface Access2D
asCollectable2D, asKeyed2D, byteValue, byteValue, columns, columns, columns, doubleValue, doubleValue, elements, floatValue, floatValue, get, intValue, intValue, longValue, longValue, nonzeros, rows, rows, rows, select, select, shortValue, shortValue, toRawCopy2DMethods inherited from interface Mutate1D.Fillable
fillAll, fillAll, fillCompatible, fillMatching, fillMatching, fillMatching, fillMatching, fillRange, fillRangeMethods inherited from interface Mutate2D
set, set, set, set, set, set, set, set, set, set, set, set, setMethods inherited from interface Mutate2D.Fillable
fillColumn, fillColumn, fillColumn, fillColumn, fillColumn, fillColumn, fillCompatible, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillDiagonal, fillRow, fillRow, fillRow, fillRow, fillRow, fillRowMethods inherited from interface Mutate2D.Receiver
accept, isAcceptableMethods inherited from interface NormedVectorSpace
isSmallMethods inherited from interface ScalarOperation.Multiplication
multiplyMethods inherited from interface Structure2D
firstInColumn, firstInRow, getMaxDim, getMinDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, sizeMethods inherited from interface Tensor
components, isSameShape
-
Field Details
-
myArray
-
myFactory
-
-
Constructor Details
-
MatrixTensor
MatrixTensor(Array2D.Factory<N> factory, int dimensions)
-
-
Method Details
-
factory
public static <N extends Comparable<N>> TensorFactory2D<N, MatrixTensor<N>> factory(DenseArray.Factory<N, ?> arrayFactory) -
add
- Specified by:
addin interfaceOperation.Addition<N extends Comparable<N>>- Parameters:
addend- What to add- Returns:
this + addend
-
byteValue
public byte byteValue(int row, int col) - Specified by:
byteValuein interfaceAccess2D<N extends Comparable<N>>
-
byteValue
public byte byteValue(long row, long col) - Specified by:
byteValuein interfaceAccess2D<N extends Comparable<N>>
-
conjugate
Description copied from interface: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.
- Specified by:
conjugatein interfaceVectorSpace<MatrixTensor<N extends Comparable<N>>, N extends Comparable<N>>
-
count
public long count()Description copied from interface:Structure2Dcount() == countRows() * countColumns()- Specified by:
countin interfaceStructure1D- Specified by:
countin interfaceStructure2D
-
countColumns
public long countColumns()Description copied from interface:Structure2DOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Specified by:
countColumnsin interfaceStructure2D- Returns:
- The number of columns
-
countRows
public long countRows()Description copied from interface:Structure2DOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Specified by:
countRowsin interfaceStructure2D- Returns:
- The number of rows
-
doubleValue
public double doubleValue(int row, int col) Description copied from interface:Access2DExtracts one element of this matrix as a double.- Specified by:
doubleValuein interfaceAccess2D<N extends Comparable<N>>- Parameters:
row- A row index.col- A column index.- Returns:
- One matrix element
-
doubleValue
public double doubleValue(long row, long col) - Specified by:
doubleValuein interfaceAccess2D<N extends Comparable<N>>
-
equals
- Overrides:
equalsin classArrayBasedTensor<N extends Comparable<N>, MatrixTensor<N extends Comparable<N>>>
-
floatValue
public float floatValue(int row, int col) - Specified by:
floatValuein interfaceAccess2D<N extends Comparable<N>>
-
floatValue
public float floatValue(long row, long col) - Specified by:
floatValuein interfaceAccess2D<N extends Comparable<N>>
-
get
-
getColDim
public int getColDim()- Specified by:
getColDimin interfaceStructure2D- Returns:
- The number of columns
-
getRowDim
public int getRowDim()- Specified by:
getRowDimin interfaceStructure2D- Returns:
- The number of rows
-
hashCode
public int hashCode()- Overrides:
hashCodein classArrayBasedTensor<N extends Comparable<N>, MatrixTensor<N extends Comparable<N>>>
-
intValue
public int intValue(int row, int col) - Specified by:
intValuein interfaceAccess2D<N extends Comparable<N>>
-
intValue
public int intValue(long row, long col) - Specified by:
intValuein interfaceAccess2D<N extends Comparable<N>>
-
longValue
public long longValue(int row, int col) - Specified by:
longValuein interfaceAccess2D<N extends Comparable<N>>
-
longValue
public long longValue(long row, long col) - Specified by:
longValuein interfaceAccess2D<N extends Comparable<N>>
-
multiply
- Specified by:
multiplyin interfaceScalarOperation.Multiplication<MatrixTensor<N extends Comparable<N>>, N extends Comparable<N>>- Returns:
this * scalarMultiplicand.
-
multiply
- Specified by:
multiplyin interfaceScalarOperation.Multiplication<MatrixTensor<N extends Comparable<N>>, N extends Comparable<N>>- Returns:
this * multiplicand.
-
negate
Description copied from interface:Group.AdditiveThe additive inverse of this.- Specified by:
negatein interfaceGroup.Additive<N extends Comparable<N>>- Returns:
-this.
-
norm
public double norm()Description copied from interface:NormedVectorSpacethis == this.signum().multiply(this.norm())- Specified by:
normin interfaceNormedVectorSpace<MatrixTensor<N extends Comparable<N>>, N extends Comparable<N>>- Returns:
- The norm
-
set
-
set
-
set
-
set
-
set
-
set
-
set
-
set
-
set
-
set
-
set
-
set
-
set
-
shortValue
public short shortValue(int row, int col) - Specified by:
shortValuein interfaceAccess2D<N extends Comparable<N>>
-
shortValue
public short shortValue(long row, long col) - Specified by:
shortValuein interfaceAccess2D<N extends Comparable<N>>
-
toString
-
getArray
-
newSameShape
MatrixTensor<N> newSameShape()- Specified by:
newSameShapein classArrayBasedTensor<N extends Comparable<N>, MatrixTensor<N extends Comparable<N>>>
-