if (id1 >= 0) {
if ( (id1 >= 0) && (m_cacheSize != -1) ) {
  public double eval(int id1, int id2, Instance inst1) throws Exception {		    double result = 0;    long key = -1;    int location = -1;    // we can only cache if we know the indexes    if (id1 >= 0) {      // Use full cache?      if (m_cacheSize == 0) {	if (m_kernelMatrix == null) {	  m_kernelMatrix = new double[m_data.numInstances()][];	  for(int i = 0; i < m_data.numInstances(); i++) {	    m_kernelMatrix[i] = new double[i + 1];	    for(int j = 0; j <= i; j++) {	      m_kernelEvals++;	      m_kernelMatrix[i][j] = evaluate(i, j, m_data.instance(i));	    }	  }	} 	m_cacheHits++;	result = (id1 > id2) ? m_kernelMatrix[id1][id2] : m_kernelMatrix[id2][id1];	return result;      }      // Use LRU cache      if (id1 > id2) {	key = (id1 + ((long) id2 * m_numInsts));      } else {	key = (id2 + ((long) id1 * m_numInsts));      }      location = (int) (key % m_cacheSize) * m_cacheSlots;      int loc = location;      for (int i = 0; i < m_cacheSlots; i++) {	long thiskey = m_keys[loc];	if (thiskey == 0)	  break; // empty slot, so break out of loop early	if (thiskey == (key + 1)) {	  m_cacheHits++;	  // move entry to front of cache (LRU) by swapping	  // only if it's not already at the front of cache	  if (i > 0) {	    double tmps = m_storage[loc];	    m_storage[loc] = m_storage[location];	    m_keys[loc] = m_keys[location];	    m_storage[location] = tmps;	    m_keys[location] = thiskey;	    return tmps;	  } else	    return m_storage[loc];	}	loc++;      }    }    result = evaluate(id1, id2, inst1);    m_kernelEvals++;    // store result in cache    if (key != -1) {      // move all cache slots forward one array index      // to make room for the new entry      System.arraycopy(m_keys, location, m_keys, location + 1,		       m_cacheSlots - 1);      System.arraycopy(m_storage, location, m_storage, location + 1,		       m_cacheSlots - 1);      m_storage[location] = result;      m_keys[location] = (key + 1);    }    return result;  }