All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.jhu.hlt.util.math.Vectors Maven / Gradle / Ivy

package edu.jhu.hlt.util.math;

import org.apache.commons.math3.analysis.differentiation.DerivativeStructure;

import edu.jhu.hlt.util.Utilities;

/**
 * Utility methods for primitive one-dimensional arrays.
 * 
 * @author mgormley
 */
public class Vectors {

    private Vectors() {
        // private constructor
    }
   
    public static double euclid(double [] u, double [] v) {
    	double d = 0;
    	for(int i=0; i max) {
                max = array[i];
            }
        }
        return max;
    }
    
    public static double min(double[] array) {
        double min = Double.POSITIVE_INFINITY;
        for (int i=0; i max) {
                max = array[i];
                argmax = i;
            }
        }
        return argmax;
    }
    
    public static int argmin(double[] array) {
        double min = Double.POSITIVE_INFINITY;
        int argmin = -1;
        for (int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy