public MixedDataBox(List<Node> variables,int numRows){
  this.variables=variables;
  this.numRows=numRows;
  this.continuousData=new double[variables.size()][];
  this.discreteData=new int[variables.size()][];
  for (int j=0; j < variables.size(); j++) {
    if (variables.get(j) instanceof ContinuousVariable) {
      continuousData[j]=new double[numRows];
      Arrays.fill(continuousData[j],Double.NaN);
    }
 else     if (variables.get(j) instanceof DiscreteVariable) {
      discreteData[j]=new int[numRows];
      Arrays.fill(discreteData[j],-99);
    }
  }
}

public MixedDataBox ( List < Node > variables , int numRows ) { this . variables = variables ; this . numRows = numRows ; this . continuousData = new double [ variables . size ( ) ] [ ] ; this . discreteData = new int [ variables . size ( ) ] [ ] ; for ( int j = 0 ; j < variables . size ( ) ; j ++ ) { if ( variables . get ( j ) instanceof ContinuousVariable ) { continuousData [ j ] = new double [ numRows ] ; Arrays . fill ( continuousData [ j ] , Double . NaN ) ; } else if ( variables . get ( j ) instanceof DiscreteVariable ) { discreteData [ j ] = new int [ numRows ] ; Arrays . fill ( discreteData [ j ] , - 99 ) ; } } }
the variables here are used only to determine which columns are discrete and which are continuous ; bounds checking is not done .
