Package org.la4j.matrix
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 org.la4j.matrix.SparseMatrix
cardinality
-
Constructor Summary
ConstructorsConstructorDescriptionColumnMajorSparseMatrix
(int rows, int columns) ColumnMajorSparseMatrix
(int rows, int columns, int cardinality) -
Method Summary
Modifier and TypeMethodDescription<T> T
apply
(MatrixMatrixOperation<T> operation, Matrix that) Pipes this matrix to a givenoperation
.<T> T
apply
(MatrixOperation<T> operation) Pipes this matrix to a givenoperation
.<T> T
apply
(MatrixVectorOperation<T> operation, Vector that) Pipes this matrix to a givenoperation
.static ColumnMajorSparseMatrix
static ColumnMajorSparseMatrix
diagonal
(int size, double diagonal) Creates a diagonalColumnMajorSparseMatrix
of the givensize
whose diagonal elements are equal todiagonal
.static ColumnMajorSparseMatrix
from1DArray
(int rows, int columns, double[] array) Creates a newColumnMajorSparseMatrix
from the given 1Darray
with compressing (copying) the underlying array.static ColumnMajorSparseMatrix
from2DArray
(double[][] array) Creates a newColumnMajorSparseMatrix
from the given 2Darray
with compressing (copying) the underlying array.static ColumnMajorSparseMatrix
ParsesColumnMajorSparseMatrix
from the given CSV string.static ColumnMajorSparseMatrix
ParsesColumnMajorSparseMatrix
from the given Matrix Market string.static ColumnMajorSparseMatrix
identity
(int size) Creates an identityColumnMajorSparseMatrix
of the givensize
.boolean
Checks whether or not this sparse matrix row-major.iterator()
Returns a matrix iterator.Returns a non-zero matrix iterator.static ColumnMajorSparseMatrix
static ColumnMajorSparseMatrix
randomSymmetric
(int size, double density, Random random) Creates a random symmetricColumnMajorSparseMatrix
of the givensize
.rotate()
Rotates this matrix by 90 degrees to the right.Transposes this matrix.static ColumnMajorSparseMatrix
zero
(int rows, int columns) static ColumnMajorSparseMatrix
zero
(int rows, int columns, int capacity) Methods inherited from class org.la4j.matrix.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, toMatrixMarket
Methods inherited from class org.la4j.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, withSolver
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.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 diagonalColumnMajorSparseMatrix
of the givensize
whose diagonal elements are equal todiagonal
. -
identity
Creates an identityColumnMajorSparseMatrix
of the givensize
. -
random
-
randomSymmetric
Creates a random symmetricColumnMajorSparseMatrix
of the givensize
. -
from1DArray
Creates a newColumnMajorSparseMatrix
from the given 1Darray
with compressing (copying) the underlying array. -
from2DArray
Creates a newColumnMajorSparseMatrix
from the given 2Darray
with compressing (copying) the underlying array. -
block
-
fromCSV
ParsesColumnMajorSparseMatrix
from the given CSV string.- Parameters:
csv
- the CSV string representing a matrix- Returns:
- a parsed matrix
-
fromMatrixMarket
ParsesColumnMajorSparseMatrix
from 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:SparseMatrix
Checks whether or not this sparse matrix row-major.- Specified by:
isRowMajor
in classSparseMatrix
-
transpose
Description copied from class:Matrix
Transposes this matrix. -
rotate
Description copied from class:Matrix
Rotates this matrix by 90 degrees to the right. -
iterator
Description copied from class:Matrix
Returns a matrix iterator. -
nonZeroIterator
Description copied from class:SparseMatrix
Returns a non-zero matrix iterator.- Overrides:
nonZeroIterator
in classSparseMatrix
- Returns:
- a non-zero matrix iterator
-
iteratorOrNonZeroColumns
-
apply
Description copied from class:Matrix
Pipes this matrix to a givenoperation
. -
apply
Description copied from class:Matrix
Pipes this matrix to a givenoperation
. -
apply
Description copied from class:Matrix
Pipes this matrix to a givenoperation
.
-