Java Double Convert to double2bipolar(final double d[])

Here you can find the source of double2bipolar(final double d[])

Description

doublebipolar

License

Open Source License

Declaration

public static boolean[] double2bipolar(final double d[]) 

Method Source Code

//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;
    }
}

Related

  1. convertDoubleToShort(double value)
  2. convertDoubleValuesFromNetcdf(double[] netcdfData, double missingValue, double scaleFactor, double offSet)
  3. double2Arr(double var, byte[] arrayBytes, int startIndex)
  4. double2array(int sz, double seed)
  5. double2bin(double d)
  6. double2dimToFloat1Dim(double[][] points)
  7. double2fixed(double value)
  8. double2Float(double[] v)
  9. double2int(final double d)