Here you can find the source of normalize(final double[] doubles)
public static void normalize(final double[] doubles)
//package com.java2s; /**/*from ww w .j a v a 2 s . co m*/ * Copyright? 2014-2016 LIST (Luxembourg Institute of Science and Technology), all right reserved. * Authorship : Olivier PARISOT, Yoanne DIDRY * Licensed under GNU General Public License version 3 */ public class Main { public static void normalize(final double[] doubles) { final int len = doubles.length; double min = Double.MAX_VALUE; double max = Double.MIN_VALUE; for (int i = 0; i < len; i++) { if (doubles[i] < min) min = doubles[i]; if (doubles[i] > max) max = doubles[i]; } for (int i = 0; i < len; i++) { doubles[i] = (doubles[i] - min) / max; } } }