Here you can find the source of vector_dot(double[] vec1, double[] vec2)
public static double vector_dot(double[] vec1, double[] vec2)
//package com.java2s; //License from project: Apache License public class Main { public static double vector_dot(double[] vec1, double[] vec2) { double sum = 0; for (int i = 0; i < vec1.length && i < vec2.length; i++) sum += vec1[i] * vec2[i];//w w w . j a v a 2s .c o m return sum; } }