Class ColumnMajorSparseMatrix
java.lang.Object
org.la4j.Matrix
org.la4j.matrix.SparseMatrix
org.la4j.matrix.ColumnMajorSparseMatrix
- Direct Known Subclasses:
CCSMatrix
-
Field Summary
Fields inherited from class SparseMatrix
cardinality -
Constructor Summary
ConstructorsConstructorDescriptionColumnMajorSparseMatrix(int rows, int columns) ColumnMajorSparseMatrix(int rows, int columns, int cardinality) -
Method Summary
Modifier and TypeMethodDescription<T> Tapply(MatrixMatrixOperation<T> operation, Matrix that) Pipes this matrix to a givenoperation.<T> Tapply(MatrixOperation<T> operation) Pipes this matrix to a givenoperation.<T> Tapply(MatrixVectorOperation<T> operation, Vector that) Pipes this matrix to a givenoperation.static ColumnMajorSparseMatrixstatic ColumnMajorSparseMatrixdiagonal(int size, double diagonal) Creates a diagonalColumnMajorSparseMatrixof the givensizewhose diagonal elements are equal todiagonal.static ColumnMajorSparseMatrixfrom1DArray(int rows, int columns, double[] array) Creates a newColumnMajorSparseMatrixfrom the given 1Darraywith compressing (copying) the underlying array.static ColumnMajorSparseMatrixfrom2DArray(double[][] array) Creates a newColumnMajorSparseMatrixfrom the given 2Darraywith compressing (copying) the underlying array.static ColumnMajorSparseMatrixParsesColumnMajorSparseMatrixfrom the given CSV string.static ColumnMajorSparseMatrixParsesColumnMajorSparseMatrixfrom the given Matrix Market string.static ColumnMajorSparseMatrixidentity(int size) Creates an identityColumnMajorSparseMatrixof the givensize.booleanChecks whether or not this sparse matrix row-major.iterator()Returns a matrix iterator.Returns a non-zero matrix iterator.static ColumnMajorSparseMatrixstatic ColumnMajorSparseMatrixrandomSymmetric(int size, double density, Random random) Creates a random symmetricColumnMajorSparseMatrixof the givensize.rotate()Rotates this matrix by 90 degrees to the right.Transposes this matrix.static ColumnMajorSparseMatrixzero(int rows, int columns) static ColumnMajorSparseMatrixzero(int rows, int columns, int capacity) Methods inherited from class SparseMatrix
add, capacity, cardinality, density, eachNonZero, eachNonZeroInColumn, eachNonZeroInRow, ensureCardinalityIsCorrect, foldNonZero, foldNonZeroInColumn, foldNonZeroInColumns, foldNonZeroInRow, foldNonZeroInRows, get, getColumn, getOrElse, getRow, isColumnMajor, isZeroAt, multiply, nonZeroAt, nonZeroColumnMajorIterator, nonZeroIteratorOfColumn, nonZeroIteratorOfRow, nonZeroRowMajorIterator, toMatrixMarketMethods inherited from class Matrix
add, blank, blankOfColumns, blankOfRows, blankOfShape, columnMajorIterator, columns, constant, copy, copyOfColumns, copyOfRows, copyOfShape, determinant, diagonalProduct, divide, each, eachInColumn, eachInRow, ensureDimensionsAreCorrect, ensureIndexesAreInBounds, equals, equals, euclideanNorm, fail, fold, foldColumn, foldColumns, foldRow, foldRows, hadamardProduct, hashCode, infinityNorm, insert, insert, insert, insert, insertColumn, insertRow, is, is, iteratorOfColumn, iteratorOfRow, kroneckerProduct, manhattanNorm, max, maxInColumn, maxInRow, min, minInColumn, minInRow, mkString, mkString, mkString, multiply, multiply, multiplyByItsTranspose, non, non, norm, power, product, random, randomSymmetric, rank, removeColumn, removeFirstColumn, removeFirstRow, removeLastColumn, removeLastRow, removeRow, rowMajorIterator, rows, select, set, setAll, setColumn, setColumn, setRow, setRow, shuffle, slice, sliceBottomRight, sliceTopLeft, subtract, subtract, sum, swapColumns, swapRows, to, toBinary, toColumnMajorSparseMatrix, toColumnVector, toCSV, toCSV, toDenseMatrix, toMatrixMarket, toRowMajorSparseMatrix, toRowVector, toSparseMatrix, toString, trace, transform, transformColumn, transformRow, unit, update, updateAt, updateColumn, updateRow, withDecompositor, withInverter, withSolverMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
ColumnMajorSparseMatrix
public ColumnMajorSparseMatrix(int rows, int columns) -
ColumnMajorSparseMatrix
public ColumnMajorSparseMatrix(int rows, int columns, int cardinality)
-
-
Method Details
-
zero
-
zero
-
diagonal
Creates a diagonalColumnMajorSparseMatrixof the givensizewhose diagonal elements are equal todiagonal. -
identity
Creates an identityColumnMajorSparseMatrixof the givensize. -
random
-
randomSymmetric
Creates a random symmetricColumnMajorSparseMatrixof the givensize. -
from1DArray
Creates a newColumnMajorSparseMatrixfrom the given 1Darraywith compressing (copying) the underlying array. -
from2DArray
Creates a newColumnMajorSparseMatrixfrom the given 2Darraywith compressing (copying) the underlying array. -
block
-
fromCSV
ParsesColumnMajorSparseMatrixfrom the given CSV string.- Parameters:
csv- the CSV string representing a matrix- Returns:
- a parsed matrix
-
fromMatrixMarket
ParsesColumnMajorSparseMatrixfrom the given Matrix Market string.- Parameters:
mm- the string in Matrix Market format- Returns:
- a parsed matrix
-
isRowMajor
public boolean isRowMajor()Description copied from class:SparseMatrixChecks whether or not this sparse matrix row-major.- Specified by:
isRowMajorin classSparseMatrix
-
transpose
-
rotate
-
iterator
-
nonZeroIterator
Description copied from class:SparseMatrixReturns a non-zero matrix iterator.- Overrides:
nonZeroIteratorin classSparseMatrix- Returns:
- a non-zero matrix iterator
-
iteratorOrNonZeroColumns
-
apply
Description copied from class:MatrixPipes this matrix to a givenoperation. -
apply
Description copied from class:MatrixPipes this matrix to a givenoperation. -
apply
Description copied from class:MatrixPipes this matrix to a givenoperation.
-