Example usage for weka.core.matrix Maths hypot

List of usage examples for weka.core.matrix Maths hypot

Introduction

In this page you can find the example usage for weka.core.matrix Maths hypot.

Prototype

public static double hypot(double a, double b) 

Source Link

Document

sqrt(a^2 + b^2) without under/overflow.

Usage

From source file:net.sf.jclal.util.matrixFile.Matrix.java

License:Open Source License

/**
 * Frobenius norm//from w w w  .ja  v a  2s . c  o  m
 *
 * @return sqrt of sum of squares of all elements.
 */
public double normF() {
    double f = 0;
    for (int i = 0; i < getRowDimension(); i++) {
        for (int j = 0; j < getColumnDimension(); j++) {
            f = Maths.hypot(f, get(i, j));
        }
    }
    return f;
}