cdm/src/main/java/ucar/ma2/MAMatrix.java
public MAVector dot(MAVector v) {

    if (ncols != v.getNelems())
      throw new IllegalArgumentException("MAMatrix.dot "+ncols+" != "+ v.getNelems());

    ArrayDouble.D1 result = new ArrayDouble.D1(nrows);
    Index imr = result.getIndex();

    for (int i=0; i<nrows; i++) {
      double sum = 0.0;
      for (int k=0; k<ncols; k++)
        sum += getDouble(i, k) * v.getDouble(k);
      result.setDouble( imr.set(i), sum);
    }

    return new MAVector( result);
  }
public MAVector dot(MAVector v) {

    if (ncols != v.getNelems())
      throw new IllegalArgumentException("MAMatrix.dot "+ncols+" != "+ v.getNelems());

    ArrayDouble.D1 result = new ArrayDouble.D1(nrows);
    Index imr = result.getIndex();

    for (int i=0; i<nrows; i++) {
      double sum = 0.0;
      for (int k=0; k<ncols; k++)
        sum += getDouble(i, k) * v.getDouble(k);
      result.setDouble( imr.set(i), sum);
    }

    return new MAVector( result);
  }
public MAVector dot ( MAVector v ) { if ( ncols != v . getNelems ( ) ) throw new IllegalArgumentException ( "MAMatrix.dot " + ncols + " != " + v . getNelems ( ) ) ; ArrayDouble . D1 result = new ArrayDouble . D1 ( nrows ) ; Index imr = result . getIndex ( ) ; for ( int i = 0 ; i < nrows ; i ++ ) { double sum = 0.0 ; for ( int k = 0 ; k < ncols ; k ++ ) sum += getDouble ( i , k ) * v . getDouble ( k ) ; result . setDouble ( imr . set ( i ) , sum ) ; } return new MAVector ( result ) ; }
Dot product of matrix and vector: return M dot v
@param v dot product with this vector
@return MAVector result: new vector
@exception IllegalArgumentException if ncols != v.getSize().
Dot product of matrix and vector : return M dot v