Example usage for org.apache.commons.math3.linear BlockRealMatrix getColumnVector

List of usage examples for org.apache.commons.math3.linear BlockRealMatrix getColumnVector

Introduction

In this page you can find the example usage for org.apache.commons.math3.linear BlockRealMatrix getColumnVector.

Prototype

@Override
public RealVector getColumnVector(final int column) throws OutOfRangeException 

Source Link

Usage

From source file:gamlss.utilities.MatrixFunctions.java

/**
 * Multiply vector with every row of the matrix.
 * @param v - vector/*from   w  ww  . jav  a2 s. co m*/
 * @param m - matrix
 * @return v*m
 */
public static BlockRealMatrix multVectorMatrix(final ArrayRealVector v, final BlockRealMatrix m) {

    BlockRealMatrix tempM = new BlockRealMatrix(m.getRowDimension(), m.getColumnDimension());
    for (int i = 0; i < m.getColumnDimension(); i++) {
        tempM.setColumnVector(i, v.ebeMultiply(m.getColumnVector(i)));
    }
    return tempM;
}