public abstract class DenseMatrix extends Matrix
Constructor and Description |
---|
DenseMatrix(int rows,
int columns) |
Modifier and Type | Method and Description |
---|---|
<T> T |
apply(MatrixMatrixOperation<T> operation,
Matrix that)
Pipes this matrix to a given
operation . |
<T> T |
apply(MatrixOperation<T> operation)
Pipes this matrix to a given
operation . |
<T> T |
apply(MatrixVectorOperation<T> operation,
Vector that)
Pipes this matrix to a given
operation . |
static DenseMatrix |
block(Matrix a,
Matrix b,
Matrix c,
Matrix d)
|
static DenseMatrix |
constant(int rows,
int columns,
double constant)
Creates a constant
DenseMatrix of the given shape and value . |
static DenseMatrix |
diagonal(int size,
double diagonal)
|
static DenseMatrix |
from1DArray(int rows,
int columns,
double[] array)
Creates a
DenseMatrix of the given 1D array w/o
copying the underlying array. |
static DenseMatrix |
from2DArray(double[][] array)
Creates a
DenseMatrix of the given 2D array w/o
copying the underlying array. |
static DenseMatrix |
fromCSV(String csv)
Parses
DenseMatrix from the given CSV string. |
static DenseMatrix |
fromMatrixMarket(String mm)
Parses
DenseMatrix from the given Matrix Market string. |
Vector |
getColumn(int j)
Copies the specified column of this matrix into the vector.
|
Vector |
getRow(int i)
Copies the specified row of this matrix into the vector.
|
static DenseMatrix |
identity(int size)
Creates an identity
DenseMatrix of the given size . |
static DenseMatrix |
random(int rows,
int columns,
Random random)
|
static DenseMatrix |
randomSymmetric(int size,
Random random)
Creates a random symmetric
DenseMatrix of the given size . |
abstract double[][] |
toArray()
Converts this dense matrix to double array.
|
String |
toMatrixMarket(NumberFormat formatter)
Converts this matrix into the Matrix Market string using the
given number
formatter . |
static DenseMatrix |
unit(int rows,
int columns)
|
static DenseMatrix |
zero(int rows,
int columns)
|
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, withSolver
public static DenseMatrix zero(int rows, int columns)
public static DenseMatrix constant(int rows, int columns, double constant)
DenseMatrix
of the given shape and value
.public static DenseMatrix diagonal(int size, double diagonal)
public static DenseMatrix unit(int rows, int columns)
public static DenseMatrix identity(int size)
DenseMatrix
of the given size
.public static DenseMatrix random(int rows, int columns, Random random)
public static DenseMatrix randomSymmetric(int size, Random random)
DenseMatrix
of the given size
.public static DenseMatrix from1DArray(int rows, int columns, double[] array)
DenseMatrix
of the given 1D array
w/o
copying the underlying array.public static DenseMatrix from2DArray(double[][] array)
DenseMatrix
of the given 2D array
w/o
copying the underlying array.public static DenseMatrix block(Matrix a, Matrix b, Matrix c, Matrix d)
public static DenseMatrix fromCSV(String csv)
DenseMatrix
from the given CSV string.csv
- the CSV string representing a matrixpublic static DenseMatrix fromMatrixMarket(String mm)
DenseMatrix
from the given Matrix Market string.mm
- the string in Matrix Market formatpublic abstract double[][] toArray()
public Vector getRow(int i)
Matrix
public Vector getColumn(int j)
Matrix
public <T> T apply(MatrixOperation<T> operation)
Matrix
operation
.public <T> T apply(MatrixMatrixOperation<T> operation, Matrix that)
Matrix
operation
.public <T> T apply(MatrixVectorOperation<T> operation, Vector that)
Matrix
operation
.public String toMatrixMarket(NumberFormat formatter)
Matrix
formatter
.toMatrixMarket
in class Matrix
Copyright © 2015. All rights reserved.