float[] get_Q(int i, int len) { float[][] data = new float[1][]; int start; if((start = cache.get_data(i,data,len)) < len) { for(int j=start;j<len;j++) data[0][j] = (float)kernel_function(i,j); } return data[0]; }
float[] get_Q(int i, int len) { float[][] data = new float[1][]; int real_i = index[i]; if(cache.get_data(real_i,data,l) < l) { for(int j=0;j<l;j++) data[0][j] = (float)kernel_function(real_i,j); } // reorder and copy float buf[] = buffer[next_buffer]; next_buffer = 1 - next_buffer; byte si = sign[i]; for(int j=0;j<len;j++) buf[j] = si * sign[j] * data[0][index[j]]; return buf; }