ColumnVector

public final class ColumnVector extends Matrix

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

Parameters

data

must fit into the length of this vector.

Constructors

ColumnVector
Link copied to clipboard
ColumnVector ColumnVector(Integer length, LongArray data)
data can be LongArray.
ColumnVector
Link copied to clipboard
ColumnVector ColumnVector(Integer length, FloatArray data)
data can be FloatArray.
ColumnVector
Link copied to clipboard
ColumnVector ColumnVector(Integer length, IntArray data)
data can be IntArray.
ColumnVector
Link copied to clipboard
ColumnVector ColumnVector(Integer length, Function1<Integer, Number> lambda)
It is possible to set a value using lambda function.
ColumnVector
Link copied to clipboard
ColumnVector ColumnVector(DoubleArray data)
If data is given, length is no longer necessary.
ColumnVector
Link copied to clipboard
ColumnVector ColumnVector(LongArray data)
If data is given, length is no longer necessary.
ColumnVector
Link copied to clipboard
ColumnVector ColumnVector(FloatArray data)
If data is given, length is no longer necessary.
ColumnVector
Link copied to clipboard
ColumnVector ColumnVector(IntArray data)
If data is given, length is no longer necessary.
ColumnVector
Link copied to clipboard
ColumnVector ColumnVector(Integer length, DoubleArray data)
Creates a new column 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
ColumnVector copy()
Same as Tensor.copy but returns ColumnVector
crossProduct
Link copied to clipboard
final ColumnVector crossProduct(ColumnVector other)
Cross product.
div
Link copied to clipboard
ColumnVector 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 ColumnVector eltwiseMul(ColumnVector other)
Same as Matrix.eltwiseMul but returns ColumnVector.
final Matrix eltwiseMul(Matrix other)
Element-wise multiplication.
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 ColumnVector getSubvector(Integer indexStart, Integer indexEnd)
Get a subvector by slicing this vector.
map
Link copied to clipboard
ColumnVector map(Function1<Double, Number> lambda)
Same as Tensor.map but returns ColumnVector.
minorMatrix
Link copied to clipboard
final Matrix minorMatrix(Integer rowIndex, Integer colIndex)
Get a minor matrix.
minus
Link copied to clipboard
final ColumnVector minus(ColumnVector other)
final Matrix minus(Matrix other)
final Tensor minus(Tensor other)
normalize
Link copied to clipboard
final ColumnVector normalize()
Normalize this vector.
plus
Link copied to clipboard
final ColumnVector plus(ColumnVector other)
final Matrix plus(Matrix 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 ColumnVector proj(ColumnVector 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, ColumnVector 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
ColumnVector times(Number other)
final ColumnVector times(ColumnVector other)
Matrix 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
ComplexColumnVector 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
RowVector transpose()
Same as Matrix.transpose but returns RowVector.
unaryMinus
Link copied to clipboard
ColumnVector unaryMinus()
unaryPlus
Link copied to clipboard
ColumnVector 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.