Example usage for org.apache.mahout.math Vector minValueIndex

List of usage examples for org.apache.mahout.math Vector minValueIndex

Introduction

In this page you can find the example usage for org.apache.mahout.math Vector minValueIndex.

Prototype

int minValueIndex();

Source Link

Usage

From source file:edu.utsa.sifter.som.SelfOrganizingMap.java

License:Apache License

int maxTermDifference(final int tID, final int uID) {
    final Vector t = getCell(tID);
    final Vector u = getCell(uID);
    final Vector diff = t.minus(u);
    final double maxValue = diff.maxValue();
    final double minValue = diff.minValue();

    if (minValue < 0 && Math.abs(minValue) > maxValue) { // even if maxValue is negative, this will hold
        return -diff.minValueIndex();
    } else {//from w ww .j av a 2s. c o  m
        return diff.maxValueIndex();
    }
}