RowVector

public final class RowVector extends Matrix

Represents real row vector. It is also a Matrix with shape 1 * length.

Parameters

data

must fit into the length of this vector.

Constructors

RowVector
Link copied to clipboard
RowVector RowVector(Integer length, LongArray data)
data can be LongArray.
RowVector
Link copied to clipboard
RowVector RowVector(Integer length, FloatArray data)
data can be FloatArray.
RowVector
Link copied to clipboard
RowVector RowVector(Integer length, IntArray data)
data can be IntArray.
RowVector
Link copied to clipboard
RowVector RowVector(Integer length, Function1<Integer, Number> lambda)
It is possible to set a value using lambda function.
RowVector
Link copied to clipboard
RowVector RowVector(DoubleArray data)
RowVector
Link copied to clipboard
RowVector RowVector(LongArray data)
RowVector
Link copied to clipboard
RowVector RowVector(FloatArray data)
RowVector
Link copied to clipboard
RowVector RowVector(IntArray data)
RowVector
Link copied to clipboard
RowVector RowVector(Integer length, DoubleArray data)
Creates a new row vector.

Functions

addRow
Link copied to clipboard
final Matrix addRow(Integer srcRowIndex, Integer dstRowIndex, Number fraction)
Do a row addition transformation; add dstRow multiplied by fraction to srcRow.
adjoint
Link copied to clipboard
final Matrix adjoint()
Calculate adjoint matrix of this matrix.
columnWiseMean
Link copied to clipboard
final RowVector columnWiseMean()
Calculate the mean value of each column.
colVecNormSq
Link copied to clipboard
final RowVector colVecNormSq()
Calculate the squared norm of each column vector.
concat
Link copied to clipboard
final Matrix concat(Matrix other, Integer concatDim)
Concatenate to other matrix.
final Tensor concat(Tensor other, Integer concatDim)
Concatenate to other tensor.
copy
Link copied to clipboard
RowVector copy()
Same as Tensor.copy but returns RowVector
crossProduct
Link copied to clipboard
final RowVector crossProduct(RowVector other)
Cross product.
div
Link copied to clipboard
RowVector div(Number other)
dotProduct
Link copied to clipboard
final Double dotProduct(ColumnVector other)
Dot product.
final Double dotProduct(RowVector other)
Dot product.
eltwiseMul
Link copied to clipboard
final Matrix eltwiseMul(Matrix other)
Element-wise multiplication.
final RowVector eltwiseMul(RowVector other)
Same as Matrix.eltwiseMul but returns RowVector.
equals
Link copied to clipboard
Boolean equals(Object other)
flatten
Link copied to clipboard
final Tensor flatten()
Reshape to a 1-dimensional tensor.
frobeniusNormSquared
Link copied to clipboard
final Double frobeniusNormSquared()
Calculate squared frobenius norm.
get
Link copied to clipboard
final Double get(Integer index)
final Double get(IntArray indices)
final Tensor get(Long indexLong)
final Double get(Integer rowIndex, Integer colIndex)
getCols
Link copied to clipboard
final Integer getCols()
number of columns.
getDim
Link copied to clipboard
final Integer getDim()
tensor dimension.
getLength
Link copied to clipboard
final Integer getLength()
length of a vector.
getRows
Link copied to clipboard
final Integer getRows()
number of rows.
getShape
Link copied to clipboard
final IntArray getShape()
tensor shape.
getSubmatrix
Link copied to clipboard
Matrix getSubmatrix(Integer rowIndexStart, Integer rowIndexEnd, Integer colIndexStart, Integer colIndexEnd)
Get a submatrix by slicing this matrix.
getSubvector
Link copied to clipboard
final RowVector getSubvector(Integer indexStart, Integer indexEnd)
Get a subvector by slicing this vector.
map
Link copied to clipboard
RowVector map(Function1<Double, Number> lambda)
Same as Tensor.map but returns RowVector.
minorMatrix
Link copied to clipboard
final Matrix minorMatrix(Integer rowIndex, Integer colIndex)
Get a minor matrix.
minus
Link copied to clipboard
final Matrix minus(Matrix other)
final RowVector minus(RowVector other)
final Tensor minus(Tensor other)
normalize
Link copied to clipboard
final RowVector normalize()
Normalize this vector.
plus
Link copied to clipboard
final Matrix plus(Matrix other)
final RowVector plus(RowVector other)
final Tensor plus(Tensor other)
pow
Link copied to clipboard
final Matrix pow(Integer n)
Calculate the nth power of this matrix.
proj
Link copied to clipboard
final RowVector proj(RowVector direction)
Project this vector onto direction.
pseudoEquals
Link copied to clipboard
final Boolean pseudoEquals(Tensor other)
Determines if other is close enough to be said the same.
replicate
Link copied to clipboard
final Matrix replicate(Integer n)
Concatenate the copies of this vector n times.
reshape
Link copied to clipboard
final Tensor reshape(IntArray newShape)
Reshape this tensor.
final Matrix reshape(Integer newRows, Integer newCols)
Reshape this matrix.
rowVecNormSq
Link copied to clipboard
final ColumnVector rowVecNormSq()
Calculate the squared norm of each row vector.
rowWiseMean
Link copied to clipboard
final ColumnVector rowWiseMean()
Calculate the mean value of each row.
set
Link copied to clipboard
final Unit set(Integer index, Number value)
final Unit set(IntArray indices, Number value)
final Unit set(Integer rowIndex, Integer colIndex, Number value)
setSubmatrix
Link copied to clipboard
Unit setSubmatrix(Integer rowIndexStart, Integer rowIndexEnd, Integer colIndexStart, Integer colIndexEnd, Matrix other)
Set a submatrix by substituting other to desired position.
setSubvector
Link copied to clipboard
final Unit setSubvector(Integer indexStart, Integer indexEnd, RowVector other)
Set a subvector by substituting other to desired position.
sum
Link copied to clipboard
final Double sum()
Calculate the sum of all values in this matrix.
switchRow
Link copied to clipboard
final Matrix switchRow(Integer rowIndex1, Integer rowIndex2)
Do a row switching transformation; exchange rowIndex1th row and rowIndex2th row.
times
Link copied to clipboard
RowVector times(Number other)
final ColumnVector times(ColumnVector other)
RowVector times(Matrix other)
final Tensor times(Tensor other)
toColVector
Link copied to clipboard
final ColumnVector toColVector()
Downcast to ColumnVector class if possible; i.e.
toComplex
Link copied to clipboard
ComplexRowVector toComplex()
toMatrix
Link copied to clipboard
final Matrix toMatrix()
Downcast to Matrix class, if possible: i.e.
toRowVector
Link copied to clipboard
final RowVector toRowVector()
Downcast to RowVector class if possible; i.e.
toString
Link copied to clipboard
String toString()
trace
Link copied to clipboard
final Double trace()
Calculate the trace of this matrix.
transpose
Link copied to clipboard
ColumnVector transpose()
Same as Matrix.transpose but returns ColumnVector.
unaryMinus
Link copied to clipboard
RowVector unaryMinus()
unaryPlus
Link copied to clipboard
RowVector unaryPlus()

Properties

cols
Link copied to clipboard
private final Integer cols
number of columns.
dim
Link copied to clipboard
private final Integer dim
tensor dimension.
length
Link copied to clipboard
private final Integer length
length of a vector.
rows
Link copied to clipboard
private final Integer rows
number of rows.
shape
Link copied to clipboard
private final IntArray shape
tensor shape.