Java Array Sum Square sumSquares(float[] in)

Here you can find the source of sumSquares(float[] in)

Description

sum Squares

License

Apache License

Declaration

public static final float sumSquares(float[] in) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static final float sumSquares(float[] in) {
        float sum = 0;
        for (int i = 0; i < in.length; i++) {
            sum += (in[i] * in[i]);//from  w w w . ja  va  2  s.co  m
        }
        return sum;
    }

    public static final double sumSquares(double[] in) {
        float sum = 0;
        for (int i = 0; i < in.length; i++) {
            sum += (in[i] * in[i]);
        }
        return sum;
    }
}

Related

  1. sumSquareDev(double[] values, double target)
  2. sumSquareDoubleArray(double[] v)
  3. sumSquares(double[] aArray)
  4. sumSquares(double[] data)
  5. sumSquares(final float[] a)
  6. sumValuesSquared(double[] vector)