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

    if (nelems != v.getNelems())
      throw new IllegalArgumentException("MAVector.dot "+nelems+" != "+ v.getNelems());

    double sum = 0.0;
    for (int k=0; k<nelems; k++)
      sum += getDouble(k) * v.getDouble(k);

    return sum;
  }
public double dot(MAVector v) {

    if (nelems != v.getNelems())
      throw new IllegalArgumentException("MAVector.dot "+nelems+" != "+ v.getNelems());

    double sum = 0.0;
    for (int k=0; k<nelems; k++)
      sum += getDouble(k) * v.getDouble(k);

    return sum;
  }
public double dot ( MAVector v ) { if ( nelems != v . getNelems ( ) ) throw new IllegalArgumentException ( "MAVector.dot " + nelems + " != " + v . getNelems ( ) ) ; double sum = 0.0 ; for ( int k = 0 ; k < nelems ; k ++ ) sum += getDouble ( k ) * v . getDouble ( k ) ; return sum ; }
Dot product of 2 vectors
@param v dot product with this vector
@return double result: dot product
@exception IllegalArgumentException if nelems != v.getNelems().
Dot product of 2 vectors