Java Array Sum sumNaive(final double... values)

Here you can find the source of sumNaive(final double... values)

Description

sum Naive

License

Open Source License

Declaration

public static final double sumNaive(final double... values) 

Method Source Code

//package com.java2s;
/*//ww w . ja va2  s  . c  o m
 * ====================================================
 * Copyright (C) 2013 by Idylwood Technologies, LLC. All rights reserved.
 *
 * Developed at Idylwood Technologies, LLC.
 * Permission to use, copy, modify, and distribute this
 * software is freely granted, provided that this notice
 * is preserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * The License should have been distributed to you with the source tree.
 * If not, it can be found at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author: Charles Cooper
 * Date: 2013
 * ====================================================
 */

public class Main {
    public static final double sumNaive(final double... values) {
        double ret = 0;
        for (final double x : values)
            ret += x;
        return ret;
    }
}

Related

  1. summation(double[] values)
  2. sumMaxK(double[] x, int k)
  3. summedDifference(int[][] matrix, short topX, short botX, short row)
  4. sumMinMax(double[] values, int out[])
  5. sumMult(double[] aArray1, double[] aArray2)
  6. sumOf(int... values)
  7. sumOfArray(double[] array)
  8. sumOfArray(final double[] array)
  9. sumOfMeanDifferencesOnePoint(double[] vector)