Here you can find the source of double2bipolar(final double d[])
public static boolean[] double2bipolar(final double d[])
//package com.java2s; /**/* ww w. j a va 2 s . com*/ * Introduction to Neural Networks with Java, 2nd Edition * Copyright 2008 by Heaton Research, Inc. * http://www.heatonresearch.com/books/java-neural-2/ * * ISBN13: 978-1-60439-008-7 * ISBN: 1-60439-008-5 * * This class is released under the: * GNU Lesser General Public License (LGPL) * http://www.gnu.org/copyleft/lesser.html */ public class Main { public static boolean double2bipolar(final double d) { if (d > 0) { return true; } else { return false; } } public static boolean[] double2bipolar(final double d[]) { final boolean[] result = new boolean[d.length]; for (int i = 0; i < d.length; i++) { result[i] = double2bipolar(d[i]); } return result; } public static boolean[][] double2bipolar(final double d[][]) { final boolean[][] result = new boolean[d.length][d[0].length]; for (int row = 0; row < d.length; row++) { for (int col = 0; col < d[0].length; col++) { result[row][col] = double2bipolar(d[row][col]); } } return result; } }