Java Mean Calculate computeMean(int val1, int val2, float ratio)

Here you can find the source of computeMean(int val1, int val2, float ratio)

Description

Compute the mean of row values.

License

Open Source License

Parameter

Parameter Description
val1 val1
val2 val2
ratio ratio

Return

mean

Declaration

public static int computeMean(int val1, int val2, float ratio) 

Method Source Code

//package com.java2s;
/*/*w w w.jav  a 2  s. c o  m*/
 * Java
 *
 * Copyright 2016 IS2T. All rights reserved.
 * Use of this source code is subject to license terms.
 */

public class Main {
    /**
     * Compute the mean of row values.
     *
     * @param val1
     *            val1
     * @param val2
     *            val2
     * @param ratio
     *            ratio
     * @return mean
     */
    public static int computeMean(int val1, int val2, float ratio) {
        return (int) ((1.0f - ratio) * val2 + ratio * val1);
    }
}

Related

  1. computeMean(double[] data)
  2. computeMean(double[] results)
  3. computeMean(float[] array)
  4. computeMean(float[] data)
  5. computeMean(int[][] pixels)
  6. computeMeanSquaredError(double[] trueValues, double[] predValues)
  7. computeMeanSquareError(double[] x, double[] y)
  8. mean(ArrayList values)