public Coordinates(Instance instance) {

    double[] values = instance.toDoubleArray();
    int classIndex = instance.classIndex();
    if (classIndex == -1) {
      m_coord = new int[values.length];
    } else {
      m_coord = new int[values.length - 1];
    }

    m_hashCode = 0;
    int factor=1;
    for (int i = 0,j = 0;i < values.length; i++) { 
      if (i != classIndex) {
	m_coord[j] = (int) values[i];
	if (i > 0 && i - 1 != classIndex) {
	  factor *= instance.attribute(i-1).numValues();
	} else if (i - 1 == classIndex && classIndex != -1 
	    && classIndex != 0) {
	  factor *= instance.attribute(i - 2).numValues();
	}
	m_hashCode += (m_coord[j])*factor;
	j++;    
      }
    }
  }