Search in sources :

Example 1 with MatrixView

use of org.apache.ignite.ml.math.impls.matrix.MatrixView in project ignite by apache.

the class AbstractVector method toMatrixPlusOne.

/** {@inheritDoc} */
@Override
public Matrix toMatrixPlusOne(boolean rowLike, double zeroVal) {
    Matrix res = likeMatrix(rowLike ? 1 : size() + 1, rowLike ? size() + 1 : 1);
    if (res == null)
        return null;
    res.set(0, 0, zeroVal);
    if (rowLike)
        new MatrixView(res, 0, 1, 1, size()).assignRow(0, this);
    else
        new MatrixView(res, 1, 0, size(), 1).assignColumn(0, this);
    return res;
}
Also used : MatrixView(org.apache.ignite.ml.math.impls.matrix.MatrixView) Matrix(org.apache.ignite.ml.math.Matrix)

Aggregations

Matrix (org.apache.ignite.ml.math.Matrix)1 MatrixView (org.apache.ignite.ml.math.impls.matrix.MatrixView)1