private void checkMatrix(){
  for (  Node variable : variables) {
    if (variable == null) {
      throw new NullPointerException();
    }
  }
  if (sampleSize < 1) {
    throw new IllegalArgumentException("Sample size must be at least 1.");
  }
  for (int i=0; i < matrix.rows(); i++) {
    for (int j=0; j < matrix.columns(); j++) {
      if (Double.isNaN(matrix.get(i,j))) {
        throw new IllegalArgumentException("Please remove or impute missing values.");
      }
    }
  }
}

private void checkMatrix ( ) { for ( Node variable : variables ) { if ( variable == null ) { throw new NullPointerException ( ) ; } } if ( sampleSize < 1 ) { throw new IllegalArgumentException ( "Sample size must be at least 1." ) ; } for ( int i = 0 ; i < matrix . rows ( ) ; i ++ ) { for ( int j = 0 ; j < matrix . columns ( ) ; j ++ ) { if ( Double . isNaN ( matrix . get ( i , j ) ) ) { throw new IllegalArgumentException ( "Please remove or impute missing values." ) ; } } } }
checks the sample size , variable , and matrix information .
