Class DenseMatrix
java.lang.Object
org.la4j.Matrix
org.la4j.matrix.DenseMatrix
- Direct Known Subclasses:
Basic1DMatrix, Basic2DMatrix
-
Field Summary
-
Constructor Summary
Constructors -
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 DenseMatrixstatic DenseMatrixconstant(int rows, int columns, double constant) Creates a constantDenseMatrixof the given shape andvalue.static DenseMatrixdiagonal(int size, double diagonal) static DenseMatrixfrom1DArray(int rows, int columns, double[] array) Creates aDenseMatrixof the given 1Darrayw/o copying the underlying array.static DenseMatrixfrom2DArray(double[][] array) Creates aDenseMatrixof the given 2Darrayw/o copying the underlying array.static DenseMatrixParsesDenseMatrixfrom the given CSV string.static DenseMatrixParsesDenseMatrixfrom the given Matrix Market string.getColumn(int j) Copies the specified column of this matrix into the vector.getRow(int i) Copies the specified row of this matrix into the vector.static DenseMatrixidentity(int size) Creates an identityDenseMatrixof the givensize.static DenseMatrixstatic DenseMatrixrandomSymmetric(int size, Random random) Creates a random symmetricDenseMatrixof the givensize.abstract double[][]toArray()Converts this dense matrix to double array.toMatrixMarket(NumberFormat formatter) Converts this matrix into the Matrix Market string using the given numberformatter.static DenseMatrixunit(int rows, int columns) static DenseMatrixzero(int rows, int columns) Methods inherited from class Matrix
add, add, blank, blankOfColumns, blankOfRows, blankOfShape, columnMajorIterator, columns, copy, copyOfColumns, copyOfRows, copyOfShape, determinant, diagonalProduct, divide, each, eachInColumn, eachInRow, ensureDimensionsAreCorrect, ensureIndexesAreInBounds, equals, equals, euclideanNorm, fail, fold, foldColumn, foldColumns, foldRow, foldRows, get, hadamardProduct, hashCode, infinityNorm, insert, insert, insert, insert, insertColumn, insertRow, is, is, iterator, iteratorOfColumn, iteratorOfRow, kroneckerProduct, manhattanNorm, max, maxInColumn, maxInRow, min, minInColumn, minInRow, mkString, mkString, mkString, multiply, multiply, multiply, multiplyByItsTranspose, non, non, norm, power, product, rank, removeColumn, removeFirstColumn, removeFirstRow, removeLastColumn, removeLastRow, removeRow, rotate, 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, transpose, update, updateAt, updateColumn, updateRow, withDecompositor, withInverter, withSolverMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
DenseMatrix
public DenseMatrix(int rows, int columns)
-
-
Method Details
-
zero
-
constant
Creates a constantDenseMatrixof the given shape andvalue. -
diagonal
-
unit
-
identity
Creates an identityDenseMatrixof the givensize. -
random
-
randomSymmetric
Creates a random symmetricDenseMatrixof the givensize. -
from1DArray
Creates aDenseMatrixof the given 1Darrayw/o copying the underlying array. -
from2DArray
Creates aDenseMatrixof the given 2Darrayw/o copying the underlying array. -
block
-
fromCSV
ParsesDenseMatrixfrom the given CSV string.- Parameters:
csv- the CSV string representing a matrix- Returns:
- a parsed matrix
-
fromMatrixMarket
ParsesDenseMatrixfrom the given Matrix Market string.- Parameters:
mm- the string in Matrix Market format- Returns:
- a parsed matrix
-
toArray
public abstract double[][] toArray()Converts this dense matrix to double array.- Returns:
- an array representation of this matrix
-
getRow
-
getColumn
-
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. -
toMatrixMarket
Description copied from class:MatrixConverts this matrix into the Matrix Market string using the given numberformatter.- Specified by:
toMatrixMarketin classMatrix- Returns:
- a string in Matrix Market format representing this matrix;
-