Example usage for org.apache.commons.math.util DoubleArray getElements

List of usage examples for org.apache.commons.math.util DoubleArray getElements

Introduction

In this page you can find the example usage for org.apache.commons.math.util DoubleArray getElements.

Prototype

double[] getElements();

Source Link

Document

Returns a double[] array containing the elements of this DoubleArray.

Usage

From source file:es.udc.gii.common.eaf.algorithm.population.Individual.java

private boolean checkChromosomes(DoubleArray[] c_1, DoubleArray[] c_2) {

    DoubleArray d_1, d_2;

    if (c_1.length != c_2.length) {
        return false;
    }//from w  ww  .  java2s.  com

    for (int i = 0; i < c_1.length; i++) {

        d_1 = c_1[i];
        d_2 = c_2[i];

        if (d_1.getNumElements() != d_2.getNumElements()) {
            return false;
        }

        if (!Arrays.equals(d_1.getElements(), d_2.getElements())) {
            return false;
        }

    }

    return true;
}