* @throws InvalidIndexException
* @throws IOException
*/
public long [] getNeighbors(long id, int beamRadius, int numPermutations) throws InvalidIndexException, IOException
{
if(numPermutations > maxPermutations) throw(new InvalidIndexException(reader.rootDir, "Max available permutations is: " + maxPermutations + ". " + numPermutations + " were requested"));
TLongHashSet sims = new TLongHashSet();
if(!reader.permutationIndex.containsKey(id)) return null;
int [] positions = reader.permutationIndex.get(id);
if(maxPermutations != positions.length) throw(new InvalidIndexException(reader.rootDir, "Found invalid number of permutations: " + positions.length+ " for input id: " + id));
for(int i = 0; i < numPermutations; i++)
{
getNeighbors(positions[i], beamRadius, permutationLists[i], sims);
}
return sims.toArray();