Commit 9a666520 authored by lafabregue's avatar lafabregue

modification of index computation dialogs

parent 5d079fbd
......@@ -18,6 +18,9 @@ public class DistanceDTWMD implements Distance<AttributeMultiDimSequence,Paramet
@Override
public double compute(AttributeMultiDimSequence S, AttributeMultiDimSequence T, ParameterDTW p) {
if (S == null || T == null) {
return 0;
}
final int tailleS = S.getNbTuples();
final int tailleT = T.getNbTuples();
......
......@@ -501,13 +501,15 @@ public class ImageSampler extends Sampler {
index = iter.next();
iterPos --;
}
} else {
index = iter.next();
}
selectedIndexes.set(i, index);
} else {
index = getIndex(i);
}
x = getStartX() + ((int) index) % imageWidth;
y = getStartY() + ((int) index) / imageWidth;
x = getStartX() + ((int) index) % (imageWidth+1);
y = getStartY() + ((int) index) / (imageWidth+1);
result.add(new DataObject(1));
List<double[]> values = new ArrayList<double[]>();
......
......@@ -391,7 +391,7 @@ public class LightHardSeed extends KmeansSeed implements Cloneable, Serializable
int nbAttributes = data.getOneDataObject().getNbAttributes();
final DataObject res = new DataObject(nbAttributes);
final AttributeSequence[][] tab = new AttributeSequence[nbAttributes][count];
final AttributeSequence[][] tab = new AttributeSequence[nbAttributes][mask.getCarinality()];
Iterator<DataObject> iter = data.iterator(mask);
int i = 0;
......@@ -409,12 +409,13 @@ public class LightHardSeed extends KmeansSeed implements Cloneable, Serializable
}
this.center = res;
} else if (data.getOneDataObject().getAttribute(0) instanceof AttributeMultiDimSequence && AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.DTW_BARYCENTRE) {
} else if (data.getOneDataObject().getAttribute(0) instanceof AttributeMultiDimSequence &&
AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.DTW_BARYCENTRE) {
int nbAttributes = data.getOneDataObject().getNbAttributes();
final DataObject res = new DataObject(nbAttributes);
final AttributeMultiDimSequence[] tab = new AttributeMultiDimSequence[count];
final AttributeMultiDimSequence[] tab = new AttributeMultiDimSequence[mask.getCarinality()];
Iterator<DataObject> iter = data.iterator(mask);
int i = 0;
......@@ -432,7 +433,7 @@ public class LightHardSeed extends KmeansSeed implements Cloneable, Serializable
int nbAttributes = data.getOneDataObject().getNbAttributes();
final DataObject res = new DataObject(nbAttributes);
final AttributeHardConstrainedMultiDimSequence[] tab = new AttributeHardConstrainedMultiDimSequence[count];
final AttributeHardConstrainedMultiDimSequence[] tab = new AttributeHardConstrainedMultiDimSequence[mask.getCarinality()];
Iterator<DataObject> iter = data.iterator(mask);
int i = 0;
......@@ -450,7 +451,7 @@ public class LightHardSeed extends KmeansSeed implements Cloneable, Serializable
int nbAttributes = data.getOneDataObject().getNbAttributes();
final DataObject res = new DataObject(nbAttributes);
final AttributeDSCMDSequence[] tab = new AttributeDSCMDSequence[count];
final AttributeDSCMDSequence[] tab = new AttributeDSCMDSequence[mask.getCarinality()];
Iterator<DataObject> iter = data.iterator(mask);
int i = 0;
......@@ -486,7 +487,7 @@ public class LightHardSeed extends KmeansSeed implements Cloneable, Serializable
int nbAttributes = data.getOneDataObject().getNbAttributes();
final DataObject res = new DataObject(nbAttributes);
final AttributeMDMRSequence[] tab = new AttributeMDMRSequence[count];
final AttributeMDMRSequence[] tab = new AttributeMDMRSequence[mask.getCarinality()];
Iterator<DataObject> iter = data.iterator(mask);
int i = 0;
......@@ -503,7 +504,7 @@ public class LightHardSeed extends KmeansSeed implements Cloneable, Serializable
int nbAttributes = data.getOneDataObject().getNbAttributes();
final DataObject res = new DataObject(nbAttributes);
final AttributeMDMRHSequence[] tab = new AttributeMDMRHSequence[count];
final AttributeMDMRHSequence[] tab = new AttributeMDMRHSequence[mask.getCarinality()];
Iterator<DataObject> iter = data.iterator(mask);
int i = 0;
......@@ -541,7 +542,7 @@ public class LightHardSeed extends KmeansSeed implements Cloneable, Serializable
this.center = res;
} else {
List<DataObject> array = new ArrayList<DataObject>(count);
List<DataObject> array = new ArrayList<DataObject>(mask.getCarinality());
Iterator<DataObject> iter = data.iterator(mask);
while(iter.hasNext()) {
......
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