1 /*
2  * This file is part of ELKI:
3  * Environment for Developing KDD-Applications Supported by Index-Structures
4  *
5  * Copyright (C) 2018
6  * ELKI Development Team
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Affero General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Affero General Public License for more details.
17  *
18  * You should have received a copy of the GNU Affero General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 package de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.strategies.split.distribution;
22 
23 import de.lmu.ifi.dbs.elki.index.tree.AbstractNode;
24 import de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeEntry;
25 
26 /**
27  * M-tree entry distribution strategies.
28  *
29  * These are used by many split strategies to distribute the remaining entries.
30  *
31  * @author Erich Schubert
32  *
33  * @assoc - - - Assignments
34  */
35 public interface DistributionStrategy {
36   /**
37    * Creates a balanced partition of the entries of the specified node.
38    *
39    * @param node the node to be split
40    * @param routing1 the entry number of the first routing object
41    * @param dis1 Distances from first routing object
42    * @param routing2 the entry number of the second routing object
43    * @param dis2 Distances from second routing object
44    * @param <E> entry type
45    * @return an assignment that holds a balanced partition of the entries of the
46    *         specified node
47    */
distribute(AbstractNode<E> node, int routing1, double[] dis1, int routing2, double[] dis2)48   <E extends MTreeEntry> Assignments<E> distribute(AbstractNode<E> node, int routing1, double[] dis1, int routing2, double[] dis2);
49 }
50