Commit 0fc1b77e authored by lafabregue's avatar lafabregue

minore modifications

parent 1997372b
package jcl.learning.methods.monostrategy.cobweb;
import java.util.Iterator;
import jcl.clustering.ClusteringResult;
import jcl.data.Data;
import jcl.data.DataObject;
......@@ -56,13 +58,21 @@ public class LearningResultCobweb extends LearningResult {
@Override
public ClusteringResult classify(final Data data, boolean fromSample) {
// remplissage du tableau recapitulatif des idC
int tabSize = data.getNbObjects();
if (!fromSample) {
tabSize = data.getWholeDataNbObjects();
int[] tab;
if (fromSample) {
tab = new int[data.getNbObjects()];
this.racine.remplir_tab(tab, this.maxDepth);
} else {
tab = new int[data.getWholeDataNbObjects()];
Iterator<DataObject> iter = data.getWholeSourceDataObjects();
for (int i = 0 ; i < tab.length ; i++) {
DataObject o = iter.next();
o.setId(i);
getRacine().reClasse(o, tab);
}
}
final int[] tab = new int[tabSize];
this.racine.remplir_tab(tab, this.maxDepth);
int nbClusters = 0;
for (int i = 0; i < tab.length; i++) {
if (tab[i] > nbClusters) {
......
......@@ -694,7 +694,7 @@ public class StreamedImageReaderWrapper implements Iterable<double[]>, MemoryFlu
*
*/
public void setLinearBoundriesWithNewRef(int start, int end, int width, int height) {
setLinearBoundries(0, Math.floorDiv(start,width), 0, (int) Math.ceil((double)end/width));
setLinearBoundries(0, (int) Math.floor((double)start/width), 0, (int) Math.ceil((double)end/width));
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment