Returns an array of integers that represent the graphical pattern
determined by the biomorph's genes.
@return A 2-dimensional array containing the 8-element dx and dy
arrays required to draw the biomorph.
13687
public int[][] getPatternPhenotype()
    {
        if (phenotype == null)
        {
            // Decode the genes as per Dawkins' rules.
            int[] dx = new int[GENE_COUNT - 1];
            dx[3] = genes[0];
            dx[4] = genes[1];
            dx[5] = genes[2];

            dx[1] = -dx[3];
            dx[0] = -dx[4];
            dx[7] = -dx[5];

            dx[2] = 0;
            dx[6] = 0;

            int[] dy = new int[GENE_COUNT - 1];
            dy[2] = genes[3];
            dy[3] = genes[4];
            dy[4] = genes[5];
            dy[5] = genes[6];
            dy[6] = genes[7];

            dy[0] = dy[4];
            dy[1] = dy[3];
            dy[7] = dy[5];

            phenotype = new int[][]{dx, dy};
        }
        return phenotype;
    }
159408
public double[] formNNInputs() {
    double[] input2ActFun = new double[_outSize];
    int cols = _inputs.length;
    int rows = input2ActFun.length;
    int extra=cols-cols%8;
    int multiple = (cols/8)*8-1;
    int idx = 0;
    for (int row = 0; row < rows; row++) {
      double psum0 = 0, psum1 = 0, psum2 = 0, psum3 = 0, psum4 = 0, psum5 = 0, psum6 = 0, psum7 = 0;

      for (int col=0; col < multiple; col+=8) {
        int off=idx+col;
        psum0 += _weightsAndBias._wValues[off    ] * _inputs[col    ];
        psum1 += _weightsAndBias._wValues[off + 1] * _inputs[col + 1];
        psum2 += _weightsAndBias._wValues[off + 2] * _inputs[col + 2];
        psum3 += _weightsAndBias._wValues[off + 3] * _inputs[col + 3];
        psum4 += _weightsAndBias._wValues[off + 4] * _inputs[col + 4];
        psum5 += _weightsAndBias._wValues[off + 5] * _inputs[col + 5];
        psum6 += _weightsAndBias._wValues[off + 6] * _inputs[col + 6];
        psum7 += _weightsAndBias._wValues[off + 7] * _inputs[col + 7];
      }
      input2ActFun[row] += psum0+psum1+psum2+psum3;
      input2ActFun[row] += psum4+psum5+psum6+psum7;

      for (int col = extra; col<cols;col++) {
        input2ActFun[row] += _weightsAndBias._wValues[idx+col]*_inputs[col];
      }
      input2ActFun[row] += _weightsAndBias._bValues[row];
      idx += cols;
    }
    return input2ActFun;
  }
302387
@Override
    public INDArray toDense() {
        // TODO support view conversion
        INDArray result = Nd4j.zeros(shape());

        switch (data().dataType()) {
            case DOUBLE:
                for (int i = 0; i < length; i++) {
                    int[] idx = getUnderlyingIndicesOf(i).asInt();
                    double value = values.getDouble(i);
                    result.putScalar(idx, value);
                }
                break;
            case FLOAT:
                for (int i = 0; i < length; i++) {
                    int[] idx = getUnderlyingIndicesOf(i).asInt();
                    float value = values.getFloat(i);
                    result.putScalar(idx, value);
                }
                break;
            default:
                throw new UnsupportedOperationException();
        }
        return result;
    }
280789
public Vector getOIDs()
    {
        Vector v = new Vector();

        for (int i = 0; i != ordering.size(); i++)
        {
            v.addElement(ordering.elementAt(i));
        }

        return v;
    }
276261
public int[] convertToArray() {
        int[] p = new int[size];
        for( int j = 0; j < height; ++j ) {
            for( int i = 0; i < width; ++i ) {
                p[(j * width) + i] = pixels[i][j];
            }
        }
        return p;
    }
894992
public int[] feature(double[] x) {
        if (x.length != attributes.length) {
            throw new IllegalArgumentException(String.format("Invalid feature vector size %d, expected %d", x.length, attributes.length));
        }
        
        int[] features = new int[attributes.length];
        for (int i = 0; i < features.length; i++) {
            int f = (int) x[i];
            if (Math.floor(x[i]) != x[i] || f < 0 || f >= attributes[i].size()) {
                throw new IllegalArgumentException(String.format("Invalid value of attribute %s: %d", attributes[i].toString(), f));
            }
            
            features[i] = f + base[i];
        }
        
        return features;
    }
1321223
public double[][] getD() {
    double[][] D = new double[n][n];
    for(int i = 0; i < n; i++) {
      final double e_i = e[i];
      final double[] D_i = D[i];
      D_i[i] = d[i];
      if(e_i > 0) {
        D_i[i + 1] = e_i;
      }
      else if(e_i < 0) {
        D_i[i - 1] = e_i;
      } // else: e_i = 0
    }
    return D;
  }
186029
public IVector getVectorFromDiagonal() {
        int size = Math.min(rows, columns);
        IVector result = new IVector(size);
        for (int i = 0; i < rows; i++) {
            result.realvector[i] = realmatrix[i][i];
            result.imagvector[i] = imagmatrix[i][i];
        }
        return result;
    }
325167
public ByteArray getBeanIdArray()
    {
        int beanIdLength = data.length - ivBeanIdIndex;
        byte[] beanIdBytes = new byte[beanIdLength];
        System.arraycopy(data, ivBeanIdIndex, beanIdBytes, 0, beanIdLength);
        return new ByteArray(beanIdBytes);
    }
846165
def arrayify(self):
        
        gene = []
        for layer in self.layers:
            if layer.type != 'Input':
                for i in range(layer.size):
                    gene.append( layer.weight[i] )
        for connection in self.connections:
            for i in range(connection.fromLayer.size):
                for j in range(connection.toLayer.size):
                    gene.append( connection.weight[i][j] )
        return gene
932706
public int[] toArray() {
        int i, ele;
        int[] result;

        result = new int[size()];
        for (ele = first(), i = 0; ele != -1; ele = next(ele), i++) {
            result[i] = ele;
        }
        return result;
    }
1364252
public double[] getDerivedDimensions() {

		Double width = getWidth();
		Double height = getHeight();

		if (width == null || height == null) {

			int dataWidth;
			int dataHeight;

			try {
				BufferedImage image = getDataImage();
				dataWidth = image.getWidth();
				dataHeight = image.getHeight();
			} catch (IOException e) {
				throw new GeoPackageException("Failed to read the data image",
						e);
			}

			if (width == null) {
				width = (double) dataWidth;

				if (height != null) {
					width *= (height / dataHeight);
				}
			}

			if (height == null) {
				height = (double) dataHeight;

				if (width != null) {
					height *= (width / dataWidth);
				}
			}

		}

		return new double[] { width, height };
	}
1373010
public int[] boundParamIndexes() {
        if (getParameters().length == 0) {
            return null;
        }

        BitSet ints = new BitSet();
        ArrayList<AbstractPlanNode> ixscans = rootPlanGraph.findAllNodesOfType(PlanNodeType.INDEXSCAN);
        if (subPlanGraph != null) {
            ixscans.addAll(subPlanGraph.findAllNodesOfType(PlanNodeType.INDEXSCAN));
        }
        for (AbstractPlanNode apn : ixscans) {
            assert(apn instanceof IndexScanPlanNode);
            IndexScanPlanNode ixs = (IndexScanPlanNode) apn;
            setParamIndexes(ints, ixs.getBindings());
        }

        ArrayList<AbstractPlanNode> ixcounts = rootPlanGraph.findAllNodesOfType(PlanNodeType.INDEXCOUNT);
        if (subPlanGraph != null) {
            ixcounts.addAll(subPlanGraph.findAllNodesOfType(PlanNodeType.INDEXCOUNT));
        }
        for (AbstractPlanNode apn : ixcounts) {
            assert(apn instanceof IndexCountPlanNode);
            IndexCountPlanNode ixc = (IndexCountPlanNode) apn;
            setParamIndexes(ints, ixc.getBindings());
        }
        return bitSetToIntVector(ints);
    }
918621
@Override
    public int[] vertexColor() {
        int[] result = colors;
        if (result == null) {
            synchronized (this) {
                result = colors;
                if (result == null) {
                    colors = result = buildVertexColor();
                }
            }
        }
        return result;
    }
957328
public Matrix getD () {
      Matrix X = MatrixFactory.createMatrix(n,n);
      for (int i = 0; i < n; i++) {
         X.set(i,i,d[i]);
         if (e[i] > 0) {
				X.set(i,i+1,e[i]);
         } else if (e[i] < 0) {
				X.set(i,i-1,e[i]);
         }
      }
      return X;
   }
1327742
public NDArrayDoublesProto.NDArrayDoubles.Builder getProtoBuilder() {
    NDArrayDoublesProto.NDArrayDoubles.Builder b = NDArrayDoublesProto.NDArrayDoubles.newBuilder();
    for (int n : getDimensions()) {
      b.addDimensionSize(n);
    }
    for (double value : values) {
      b.addValues(value);
    }
    return b;
  }
397026
public int[] Multi8p(int x, int y, int masc[][]) {
        //a b c
        //d e f
        //g h i
        int aR = getIntComponent0(x - 1, y - 1);
        int bR = getIntComponent0(x - 1, y);
        int cR = getIntComponent0(x - 1, y + 1);
        int aG = getIntComponent1(x - 1, y - 1);
        int bG = getIntComponent1(x - 1, y);
        int cG = getIntComponent1(x - 1, y + 1);
        int aB = getIntComponent2(x - 1, y - 1);
        int bB = getIntComponent2(x - 1, y);
        int cB = getIntComponent2(x - 1, y + 1);


        int dR = getIntComponent0(x, y - 1);
        int eR = getIntComponent0(x, y);
        int fR = getIntComponent0(x, y + 1);
        int dG = getIntComponent1(x, y - 1);
        int eG = getIntComponent1(x, y);
        int fG = getIntComponent1(x, y + 1);
        int dB = getIntComponent2(x, y - 1);
        int eB = getIntComponent2(x, y);
        int fB = getIntComponent2(x, y + 1);


        int gR = getIntComponent0(x + 1, y - 1);
        int hR = getIntComponent0(x + 1, y);
        int iR = getIntComponent0(x + 1, y + 1);
        int gG = getIntComponent1(x + 1, y - 1);
        int hG = getIntComponent1(x + 1, y);
        int iG = getIntComponent1(x + 1, y + 1);
        int gB = getIntComponent2(x + 1, y - 1);
        int hB = getIntComponent2(x + 1, y);
        int iB = getIntComponent2(x + 1, y + 1);

        int rgb[] = new int[3];

        rgb[0] = ((aR * masc[0][0]) + (bR * masc[0][1]) + (cR * masc[0][2]) +
                (dR * masc[1][0]) + (eR * masc[1][1]) + (fR * masc[1][2]) +
                (gR * masc[2][0]) + (hR * masc[2][1]) + (iR * masc[2][2]));

        rgb[1] = ((aG * masc[0][0]) + (bG * masc[0][1]) + (cG * masc[0][2]) +
                (dG * masc[1][0]) + (eG * masc[1][1]) + (fG * masc[1][2]) +
                (gG * masc[2][0]) + (hG * masc[2][1]) + (iG * masc[2][2]));

        rgb[2] = ((aB * masc[0][0]) + (bB * masc[0][1]) + (cB * masc[0][2]) +
                (dB * masc[1][0]) + (eB * masc[1][1]) + (fB * masc[1][2]) +
                (gB * masc[2][0]) + (hB * masc[2][1]) + (iB * masc[2][2]));

        // return the value for all channel
        return (rgb);

    }