returns a <code>double[]</code> array of length
<code>depth+1</code>, containing the conditional counts on a
<code>depth</code>-length list given each level of conditional
distribution from 0 to <code>depth</code>.
184183
public double[] getCounts(List<K> l) {
    if (l.size() != depth) {
      wrongDepth(); //throws exception
    }

    double[] counts = new double[depth + 1];

    GeneralizedCounter<K> next = this;
    counts[0] = next.totalCount();
    Iterator<K> i = l.iterator();
    int j = 1;
    K o = i.next();
    while (i.hasNext()) {
      next = next.conditionalizeHelper(o);
      counts[j] = next.totalCount();
      o = i.next();
      j++;
    }
    counts[depth] = next.getCount(o);

    return counts;
  }
754146
private int getNumRepeats(int level) {
		int size = 1;
		// Return 1 for illegally high level
		if(level < getNumLevels()) {
			for(Axis axis : axes.subList(level, getNumLevels())) {
				size *= axis.getOrder();
			}
		}
		return size;
	}
102717
public double[] homogeneVector(double[] v) {
    assert (v.length == dim);
    double[] dv = Arrays.copyOf(v, dim + 1);
    dv[dim] = 1.0;
    return dv;
  }
2877
public static double[][] convertFrontToArray(Front front) {
    if (front == null) {
      throw new NullFrontException();
    }

    double[][] arrayFront = new double[front.getNumberOfPoints()][] ;

    for (int i = 0; i < front.getNumberOfPoints(); i++) {
      arrayFront[i] = new double[front.getPoint(i).getDimension()] ;
      for (int j = 0 ; j < front.getPoint(i).getDimension(); j++) {
        arrayFront[i][j] = front.getPoint(i).getValue(j) ;
      }
    }

    return arrayFront ;
  }
471641
public static double[] getMinimumValues(Front front) {
    if (front == null) {
      throw new NullFrontException() ;
    } else if (front.getNumberOfPoints() == 0) {
      throw new EmptyFrontException() ;
    }

    int numberOfObjectives = front.getPoint(0).getDimension() ;

    double[] minimumValue = new double[numberOfObjectives];
    for (int i = 0; i < numberOfObjectives; i++) {
      minimumValue[i] = Double.MAX_VALUE;
    }

    for (int i = 0 ; i < front.getNumberOfPoints(); i++) {
      for (int j = 0; j < numberOfObjectives; j++) {
        if (front.getPoint(i).getValue(j) < minimumValue[j]) {
          minimumValue[j] = front.getPoint(i).getValue(j);
        }
      }
    }

    return minimumValue;
  }
691438
static INode[] getINodeArray(INode inode) throws IOException {
    // calculate the depth of this inode from root
    int depth = getPathDepth(inode);
    INode[] inodes = new INode[depth];

    // fill up the inodes in the path from this inode to root
    for (int i = 0; i < depth; i++) {
      inodes[depth-i-1] = inode;
      inode = inode.parent;
    }
    return inodes;
  }
1115487
public double[][] getArray()
    {
        double[][] result = new double[getM()][];
        
        for ( int m = 0; m < getM(); m++ )
        {
           result[m] = new double[ getN() ];

           for ( int n = 0; n < getN(); n++ )
           {               
               result[m][n] = getReal(m,n);
           }
        }
        return result;
    }
906512
public int[] asArray() {
	    int arr[] = new int[size()];
	    OrdinalIterator iter = iterator();
	    
	    int ordinal = iter.nextOrdinal();
	    int i = 0;

	    while(ordinal != NO_MORE_ORDINALS) {
	        arr[i++] = ordinal;
	        ordinal = iter.nextOrdinal();
	    }
	    
	    return arr;
	}
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;
  }
1298397
function(deep) {
			var cl = this.children,
				i,
				l,
				n;
			if (!cl) {
				return 0;
			}
			n = cl.length;
			if (deep !== false) {
				for (i = 0, l = n; i < l; i++) {
					n += cl[i].countChildren();
				}
			}
			return n;
		}
858184
private static int[] getDims(VarSet vars) {
        int[] dims = new int[vars.size()];
        for (int i=0; i<vars.size(); i++) {
            dims[i] = vars.get(i).getNumStates();
        }
        return dims;
    }
723650
public double[][] toArray() {
        int m = data.size();
        double[][] a = new double[m][ncols()];
        
        for (int i = 0; i < m; i++) {
            for (SparseArray.Entry item : get(i).x) {
                a[i][item.i] = item.x;
            }
        }
        
        return a;
    }
616943
public double[][] copyValues2D()
    {
        double v[][] = new double[nRows][nCols];

        for (int r = 0; r < nRows; ++r) {
            for (int c = 0; c < nCols; ++c) {
                v[r][c] = values[r][c];
            }
        }

        return v;
    }
1164765
public float[] getFloats(int rowId, int count) {
    float[] res = new float[count];
    for (int i = 0; i < count; i++) {
      res[i] = getFloat(rowId + i);
    }
    return res;
  }
825787
public double[] copyValues1D()
    {
        double v[] = new double[nCols];

        for (int c = 0; c < nCols; ++c) {
            v[c] = values[0][c];
        }

        return v;
    }
1150140
private static double[][] quantile(double[] x, Distribution d) {
        Arrays.sort(x);

        int n = x.length;
        double[][] q = new double[n][2];
        for (int i = 0; i < n; i++) {
            double p = (i + 1) / (n + 1.0);
            q[i][0] = x[(int) Math.round(p * x.length)];
            q[i][1] = d.quantile(p);
        }

        return q;
    }
839344
public static double[] getBorders(int numberOfBins, List<Double> counts) {
        Collections.sort(counts);
        if (!counts.isEmpty()) {
            List<Integer> borderInds = findBordersNaive(numberOfBins, counts);
            if (borderInds == null) {
                borderInds = findBorderIndsByRepeatedDividing(numberOfBins, counts);
            }
            double[] result = new double[borderInds.size()];
            for (int i = 0; i < result.length; i++) {
                result[i] = counts.get(borderInds.get(i));
            }
            return result;
        } else
            return new double[]{0.0};
    }