Java Array Scale scale(double[][] as)

Here you can find the source of scale(double[][] as)

Description

scale

License

Open Source License

Declaration

public static double[][] scale(double[][] as) 

Method Source Code


//package com.java2s;
//License from project: GNU General Public License 

import java.util.Arrays;

public class Main {
    public static double[][] scale(double[][] as) {
        final int VALUES = as[0].length;
        double[][] result = new double[as.length][VALUES];

        for (int v = 0; v < VALUES; v++) {
            double max = as[as.length - 1][v];
            for (int i = 0; i < as.length; i++) {
                result[i][v] = as[i][v] / max;
            }/*from  w  ww  .  j a  v  a  2  s.  c  o  m*/
        }

        System.out.println(Arrays.deepToString(result));
        return result;
    }
}

Related

  1. arrayScale(final Double[] first, final double scale)
  2. expandToLength16(byte scaledValue[], final boolean isNegative)
  3. minMaxScale(final double[] x)
  4. scale(final double[] a, double scale)
  5. scaleMAD(double[] data)
  6. scalePoints(double[] points, int height)