Esempio n. 1
0
 public double[] getConstants() {
   double[][] constants = new double[trees.length][];
   for (int i = 0; i < trees.length; i++) {
     constants[i] = trees[i].getConstants();
   }
   return ArrayHelper.flatten(constants);
 }
Esempio n. 2
0
 public void setConstants(double[] constants) {
   int[] parts = new int[trees.length];
   for (int i = 0; i < trees.length; i++) {
     parts[i] = trees[i].getNumOfConstants();
   }
   double[][] treeConstants = ArrayHelper.partition(constants, parts);
   for (int i = 0; i < trees.length; i++) {
     trees[i].setConstants(treeConstants[i]);
   }
 }