Example usage for org.apache.commons.math3.linear RealVector getLInfDistance

List of usage examples for org.apache.commons.math3.linear RealVector getLInfDistance

Introduction

In this page you can find the example usage for org.apache.commons.math3.linear RealVector getLInfDistance.

Prototype

public double getLInfDistance(RealVector v) throws DimensionMismatchException 

Source Link

Document

Distance between two vectors.

Usage

From source file:game.utils.Utils.java

public static double getDistance(String type, RealVector v1, RealVector v2) {
    switch (type.toLowerCase()) {
    case "l1":
        return v1.getL1Distance(v2);
    case "l2":
        return v1.getDistance(v2);
    case "linf":
        return v1.getLInfDistance(v2);
    }//from  w ww .  j ava2 s .  c om
    return -1;
}