public int superIndexOf(String value) { return super.indexOf(value); }
/** * Obtains a number N such that "N%M==0" would create * a reasonable sparse matrix for integer M. * * <p> * This is bit like {@link #toIndex(AxisList)}, but instead * of creating a continuous number (which often maps different * values of the same axis to the same index in modulo N residue ring, * we use a prime number P as the base. I think this guarantees the uniform * distribution in any N smaller than 2P (but proof, anyone?) */ private long toModuloIndex(AxisList axis) { long r = 0; for (Axis a : axis) { r += a.indexOf(get(a)); r *= 31; } return r; }
/** * Obtains a number N such that "N%M==0" would create a reasonable sparse * matrix for integer M. * * <p> This is bit like {@link #toIndex(AxisList)}, but instead of creating * a continuous number (which often maps different values of the same axis * to the same index in modulo N residue ring, we use a prime number P as * the base. I think this guarantees the uniform distribution in any N * smaller than 2P (but proof, anyone?) */ private long toModuloIndex(AxisList axis) { long r = 0; for (Axis a : axis) { r += a.indexOf(get(a)); r *= 31; } return r; }
/** * Obtains a number N such that "N%M==0" would create * a reasonable sparse matrix for integer M. * * <p> * This is bit like {@link #toIndex(AxisList)}, but instead * of creating a continuous number (which often maps different * values of the same axis to the same index in modulo N residue ring, * we use a prime number P as the base. I think this guarantees the uniform * distribution in any N smaller than 2P (but proof, anyone?) */ private long toModuloIndex(AxisList axis) { long r = 0; for (Axis a : axis) { r += a.indexOf(get(a)); r *= 31; } return r; }
/** * Obtains a number N such that "N%M==0" would create * a reasonable sparse matrix for integer M. * * <p> * This is bit like {@link #toIndex(AxisList)}, but instead * of creating a continuous number (which often maps different * values of the same axis to the same index in modulo N residue ring, * we use a prime number P as the base. I think this guarantees the uniform * distribution in any N smaller than 2P (but proof, anyone?) */ private long toModuloIndex(AxisList axis) { long r = 0; for (Axis a : axis) { r += a.indexOf(get(a)); r *= 31; } return r; }
/** * Obtains a number N such that "N%M==0" would create * a reasonable sparse matrix for integer M. * * <p> * This is bit like {@link Combination#toIndex(AxisList)}, but instead * of creating a continuous number (which often maps different * values of the same axis to the same index in modulo N residue ring, * we use a prime number P as the base. I think this guarantees the uniform * distribution in any N smaller than 2P (but proof, anyone?) */ private long toModuloIndex(AxisList axis, Combination c) { long r = 0; for (Axis a : axis) { r += a.indexOf(c.get(a)); r *= 31; } return r; }
/** * Obtains the continuous unique index number of this {@link Combination} * in the given {@link AxisList}. */ public int toIndex(AxisList axis) { int r = 0; for (Axis a : axis) { r *= a.size(); r += a.indexOf(get(a)); } return r; }
/** * Obtains the continuous unique index number of this {@link Combination} in * the given {@link AxisList}. */ public int toIndex(AxisList axis) { int r = 0; for (Axis a : axis) { r *= a.size(); r += a.indexOf(get(a)); } return r; }
/** * Obtains the continuous unique index number of this {@link Combination} * in the given {@link AxisList}. */ public int toIndex(AxisList axis) { int r = 0; for (Axis a : axis) { r *= a.size(); r += a.indexOf(get(a)); } return r; }
/** * Obtains the continuous unique index number of this {@link Combination} * in the given {@link AxisList}. */ public int toIndex(AxisList axis) { int r = 0; for (Axis a : axis) { r *= a.size(); r += a.indexOf(get(a)); } return r; }
/** * Obtains the continuous unique index number of this {@link Combination} * in the given {@link AxisList}. */ public int toIndex(AxisList axis) { int r = 0; for (Axis a : axis) { r *= a.size(); r += a.indexOf(get(a)); } return r; }
@Override public int indexOf(String value) { initPython(); if (pexec.isImplemented(4)) { return pexec.execPythonInt("index_of", value); } else { return super.indexOf(value); } }