public SparseInstance(double weight, double[] attValues) {  m_Weight = weight; m_Dataset = null; m_NumAttributes = attValues.length; double[] tempValues = new double[m_NumAttributes]; int[] tempIndices = new int[m_NumAttributes]; int vals = 0; for (int i = 0; i < m_NumAttributes; i++) { if (attValues[i] != 0) { tempValues[vals] = attValues[i]; tempIndices[vals] = 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);
protected SparseInstance() {
  public SparseInstance(double weight, double[] attValues) {        m_Weight = weight;    m_Dataset = null;    m_NumAttributes = attValues.length;    double[] tempValues = new double[m_NumAttributes];    int[] tempIndices = new int[m_NumAttributes];    int vals = 0;    for (int i = 0; i < m_NumAttributes; i++) {      if (attValues[i] != 0) {	tempValues[vals] = attValues[i];	tempIndices[vals] = 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);  }