@Override public void replaceMissingValues(double[] array){
  if ((array == null) || (array.length != m_NumAttributes)) {
    throw new IllegalArgumentException("Unequal number of attributes!");
  }
  double[] tempValues=new double[m_AttValues.length];
  int[] tempIndices=new int[m_AttValues.length];
  int vals=0;
  for (int i=0; i < m_AttValues.length; i++) {
    if (isMissingSparse(i)) {
      if (array[m_Indices[i]] != 0) {
        tempValues[vals]=array[m_Indices[i]];
        tempIndices[vals]=m_Indices[i];
        vals++;
      }
    }
 else {
      tempValues[vals]=m_AttValues[i];
      tempIndices[vals]=m_Indices[i];
      vals++;
    }
  }
  m_AttValues=new double[vals];
  m_Indices=new int[vals];
  System.arraycopy(tempValues,0,m_AttValues,0,vals);
  System.arraycopy(tempIndices,0,m_Indices,0,vals);
}

@ Override public void replaceMissingValues ( double [ ] array ) { if ( ( array == null ) || ( array . length != m_NumAttributes ) ) { throw new IllegalArgumentException ( "Unequal number of attributes!" ) ; } double [ ] tempValues = new double [ m_AttValues . length ] ; int [ ] tempIndices = new int [ m_AttValues . length ] ; int vals = 0 ; for ( int i = 0 ; i < m_AttValues . length ; i ++ ) { if ( isMissingSparse ( i ) ) { if ( array [ m_Indices [ i ] ] != 0 ) { tempValues [ vals ] = array [ m_Indices [ i ] ] ; tempIndices [ vals ] = m_Indices [ i ] ; vals ++ ; } } else { tempValues [ vals ] = m_AttValues [ i ] ; tempIndices [ vals ] = m_Indices [ i ] ; vals ++ ; } } m_AttValues = new double [ vals ] ; m_Indices = new int [ vals ] ; System . arraycopy ( tempValues , 0 , m_AttValues , 0 , vals ) ; System . arraycopy ( tempIndices , 0 , m_Indices , 0 , vals ) ; }
replaces all missing values in the instance with the values contained in the given array . a deep copy of the vector of attribute values is performed before the values are replaced .
