Java Array Dot Product dotProduct(double[] array, int[] indices, double[] values)

Here you can find the source of dotProduct(double[] array, int[] indices, double[] values)

Description

dot Product

License

Open Source License

Declaration

public static double dotProduct(double[] array, int[] indices, double[] values) 

Method Source Code

//package com.java2s;

public class Main {
    public static double dotProduct(double[] array, int[] indices, double[] values) {
        double result = 0;
        for (int i = 0; i < indices.length; i++) {
            if (indices[i] == -1)
                continue;
            result += array[indices[i]] * values[i];
        }//from www  . j  a v a2 s  . c o m
        return result;
    }
}

Related

  1. dotProduct(double x1, double y1, double x2, double y2, double x3, double y3)
  2. dotProduct(double[] a, double[] b)
  3. dotProduct(double[] a, double[] b)
  4. dotProduct(double[] a, double[] b)
  5. dotProduct(Double[] a, Double[] b)
  6. dotProduct(double[] fv1, double[] fv2)
  7. dotProduct(double[] thisVector, double[] thatVector)
  8. dotProduct(double[] v, double[] u)
  9. dotProduct(double[] vector1, double[] vector2)