summaryrefslogtreecommitdiff
path: root/src/de/lmu/ifi/dbs/elki/database/datastore/memory
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/database/datastore/memory')
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDBIDStore.java2
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDoubleDistanceStore.java133
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDoubleStore.java20
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayIntegerStore.java2
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayRecordStore.java2
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayStore.java2
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDBIDStore.java12
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDoubleDistanceStore.java111
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDoubleStore.java24
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDIntegerStore.java2
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDRecordStore.java2
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDStore.java2
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapRecordStore.java2
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapStore.java2
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/MemoryDataStoreFactory.java34
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/datastore/memory/package-info.java2
16 files changed, 57 insertions, 297 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDBIDStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDBIDStore.java
index 78cb51d2..2134c75a 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDBIDStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDBIDStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDoubleDistanceStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDoubleDistanceStore.java
deleted file mode 100644
index abb81d95..00000000
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDoubleDistanceStore.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package de.lmu.ifi.dbs.elki.database.datastore.memory;
-
-/*
- This file is part of ELKI:
- Environment for Developing KDD-Applications Supported by Index-Structures
-
- Copyright (C) 2013
- Ludwig-Maximilians-Universität München
- Lehr- und Forschungseinheit für Datenbanksysteme
- ELKI Development Team
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-import java.util.Arrays;
-
-import de.lmu.ifi.dbs.elki.database.datastore.DataStoreIDMap;
-import de.lmu.ifi.dbs.elki.database.datastore.WritableDoubleDistanceDataStore;
-import de.lmu.ifi.dbs.elki.database.ids.DBIDRef;
-import de.lmu.ifi.dbs.elki.distance.distancevalue.DoubleDistance;
-
-/**
- * A class to answer representation queries using the stored Array.
- *
- * @author Erich Schubert
- *
- * @apiviz.composedOf de.lmu.ifi.dbs.elki.database.datastore.DataStoreIDMap
- */
-public class ArrayDoubleDistanceStore implements WritableDoubleDistanceDataStore {
- /**
- * Data array
- */
- private double[] data;
-
- /**
- * DBID to index map
- */
- private DataStoreIDMap idmap;
-
- /**
- * Constructor.
- *
- * @param size Size
- * @param idmap ID map
- */
- public ArrayDoubleDistanceStore(int size, DataStoreIDMap idmap) {
- this(size, idmap, Double.NaN);
- }
-
- /**
- * Constructor.
- *
- * @param size Size
- * @param idmap ID map
- * @param def Default value
- */
- public ArrayDoubleDistanceStore(int size, DataStoreIDMap idmap, double def) {
- super();
- this.data = new double[size];
- if (def != 0) {
- Arrays.fill(this.data, def);
- }
- this.idmap = idmap;
- }
-
- @Override
- @Deprecated
- public DoubleDistance get(DBIDRef id) {
- return new DoubleDistance(data[idmap.mapDBIDToOffset(id)]);
- }
-
- @Override
- @Deprecated
- public DoubleDistance put(DBIDRef id, DoubleDistance value) {
- final int off = idmap.mapDBIDToOffset(id);
- double ret = data[off];
- data[off] = value.doubleValue();
- return new DoubleDistance(ret);
- }
-
- @Override
- public double doubleValue(DBIDRef id) {
- return data[idmap.mapDBIDToOffset(id)];
- }
-
- @Override
- public double putDouble(DBIDRef id, double value) {
- final int off = idmap.mapDBIDToOffset(id);
- final double ret = data[off];
- data[off] = value;
- return ret;
- }
-
- @Override
- public double put(DBIDRef id, double value) {
- final int off = idmap.mapDBIDToOffset(id);
- final double ret = data[off];
- data[off] = value;
- return ret;
- }
-
- @Override
- public void destroy() {
- data = null;
- idmap = null;
- }
-
- @Override
- public void delete(DBIDRef id) {
- throw new UnsupportedOperationException("Can't delete from a static array storage.");
- }
-
- @Override
- public String getLongName() {
- return "raw";
- }
-
- @Override
- public String getShortName() {
- return "raw";
- }
-}
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDoubleStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDoubleStore.java
index c41991eb..8b2ec127 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDoubleStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayDoubleStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
@@ -41,6 +41,11 @@ public class ArrayDoubleStore implements WritableDoubleDataStore {
* Data array
*/
private double[] data;
+
+ /**
+ * Default value.
+ */
+ private double def;
/**
* DBID to index map
@@ -67,9 +72,10 @@ public class ArrayDoubleStore implements WritableDoubleDataStore {
public ArrayDoubleStore(int size, DataStoreIDMap idmap, double def) {
super();
this.data = new double[size];
- if (def != 0) {
+ if(def != 0) {
Arrays.fill(this.data, def);
}
+ this.def = def;
this.idmap = idmap;
}
@@ -110,6 +116,16 @@ public class ArrayDoubleStore implements WritableDoubleDataStore {
}
@Override
+ public void increment(DBIDRef id, double value) {
+ data[idmap.mapDBIDToOffset(id)] += value;
+ }
+
+ @Override
+ public void clear() {
+ Arrays.fill(data, def);
+ }
+
+ @Override
public void destroy() {
data = null;
idmap = null;
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayIntegerStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayIntegerStore.java
index b8a76646..29541065 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayIntegerStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayIntegerStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayRecordStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayRecordStore.java
index e9c78cb7..2fac747f 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayRecordStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayRecordStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayStore.java
index 695ddc48..b0e5add8 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/ArrayStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDBIDStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDBIDStore.java
index 9b8a4be8..ed60cf0a 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDBIDStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDBIDStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
@@ -50,7 +50,7 @@ public class MapIntegerDBIDDBIDStore implements WritableDBIDDataStore {
*/
public MapIntegerDBIDDBIDStore(int size) {
super();
- map = new TIntIntHashMap(size, 0.5f, Integer.MIN_VALUE, DBIDUtil.invalid().internalGetIndex());
+ map = new TIntIntHashMap(size, 0.5f, Integer.MIN_VALUE, DBIDUtil.asInteger(DBIDUtil.invalid()));
}
@Override
@@ -72,7 +72,7 @@ public class MapIntegerDBIDDBIDStore implements WritableDBIDDataStore {
@Override
@Deprecated
public DBID put(DBIDRef id, DBID value) {
- return DBIDUtil.importInteger(map.put(id.internalGetIndex(), value.internalGetIndex()));
+ return DBIDUtil.importInteger(map.put(DBIDUtil.asInteger(id), DBIDUtil.asInteger(value)));
}
@Override
@@ -88,17 +88,17 @@ public class MapIntegerDBIDDBIDStore implements WritableDBIDDataStore {
@Override
public void put(DBIDRef id, DBIDRef value) {
- map.put(id.internalGetIndex(), value.internalGetIndex());
+ map.put(DBIDUtil.asInteger(id), DBIDUtil.asInteger(value));
}
@Override
public void putDBID(DBIDRef id, DBIDRef value) {
- map.put(id.internalGetIndex(), value.internalGetIndex());
+ map.put(DBIDUtil.asInteger(id), DBIDUtil.asInteger(value));
}
@Override
public void assignVar(DBIDRef id, DBIDVar var) {
- final int val = map.get(id.internalGetIndex());
+ final int val = map.get(DBIDUtil.asInteger(id));
DBIDFactory.FACTORY.assignVar(var, val);
}
}
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDoubleDistanceStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDoubleDistanceStore.java
deleted file mode 100644
index be12b54c..00000000
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDoubleDistanceStore.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package de.lmu.ifi.dbs.elki.database.datastore.memory;
-
-/*
- This file is part of ELKI:
- Environment for Developing KDD-Applications Supported by Index-Structures
-
- Copyright (C) 2013
- Ludwig-Maximilians-Universität München
- Lehr- und Forschungseinheit für Datenbanksysteme
- ELKI Development Team
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-import gnu.trove.map.TIntDoubleMap;
-import gnu.trove.map.hash.TIntDoubleHashMap;
-import de.lmu.ifi.dbs.elki.database.datastore.WritableDoubleDistanceDataStore;
-import de.lmu.ifi.dbs.elki.database.ids.DBIDRef;
-import de.lmu.ifi.dbs.elki.database.ids.DBIDUtil;
-import de.lmu.ifi.dbs.elki.distance.distancevalue.DoubleDistance;
-
-/**
- * Writable data store for double values.
- *
- * @author Erich Schubert
- */
-public class MapIntegerDBIDDoubleDistanceStore implements WritableDoubleDistanceDataStore {
- /**
- * Data storage.
- */
- private TIntDoubleMap map;
-
- /**
- * Constructor.
- *
- * @param size Expected size
- */
- public MapIntegerDBIDDoubleDistanceStore(int size) {
- this(size, Double.NaN);
- }
-
- /**
- * Constructor.
- *
- * @param size Expected size
- * @param def Default value
- */
- public MapIntegerDBIDDoubleDistanceStore(int size, double def) {
- super();
- map = new TIntDoubleHashMap(size, 0.5f, Integer.MIN_VALUE, def);
- }
-
- @Override
- @Deprecated
- public DoubleDistance get(DBIDRef id) {
- return new DoubleDistance(map.get(DBIDUtil.asInteger(id)));
- }
-
- @Override
- public double doubleValue(DBIDRef id) {
- return map.get(DBIDUtil.asInteger(id));
- }
-
- @Override
- public String getLongName() {
- return "raw";
- }
-
- @Override
- public String getShortName() {
- return "raw";
- }
-
- @Override
- @Deprecated
- public DoubleDistance put(DBIDRef id, DoubleDistance value) {
- return new DoubleDistance(map.put(DBIDUtil.asInteger(id), value.doubleValue()));
- }
-
- @Override
- public void destroy() {
- map.clear();
- map = null;
- }
-
- @Override
- public void delete(DBIDRef id) {
- map.remove(DBIDUtil.asInteger(id));
- }
-
- @Override
- public double putDouble(DBIDRef id, double value) {
- return map.put(DBIDUtil.asInteger(id), value);
- }
-
- @Override
- public double put(DBIDRef id, double value) {
- return map.put(DBIDUtil.asInteger(id), value);
- }
-}
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDoubleStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDoubleStore.java
index 8d73b672..8779eb46 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDoubleStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDDoubleStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
@@ -88,12 +88,6 @@ public class MapIntegerDBIDDoubleStore implements WritableDoubleDataStore {
}
@Override
- public void destroy() {
- map.clear();
- map = null;
- }
-
- @Override
public void delete(DBIDRef id) {
map.remove(DBIDUtil.asInteger(id));
}
@@ -107,4 +101,20 @@ public class MapIntegerDBIDDoubleStore implements WritableDoubleDataStore {
public double put(DBIDRef id, double value) {
return map.put(DBIDUtil.asInteger(id), value);
}
+
+ @Override
+ public void increment(DBIDRef id, double value) {
+ map.adjustOrPutValue(DBIDUtil.asInteger(id), value, map.getNoEntryValue() + value);
+ }
+
+ @Override
+ public void clear() {
+ map.clear();
+ }
+
+ @Override
+ public void destroy() {
+ map.clear();
+ map = null;
+ }
}
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDIntegerStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDIntegerStore.java
index 935f23f4..2f2a42a2 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDIntegerStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDIntegerStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDRecordStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDRecordStore.java
index 9efe2221..7963b78c 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDRecordStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDRecordStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDStore.java
index ede82f15..55402703 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapIntegerDBIDStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapRecordStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapRecordStore.java
index 045d5bf4..6b5b1a50 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapRecordStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapRecordStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapStore.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapStore.java
index c40e0a72..3432e124 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapStore.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MapStore.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MemoryDataStoreFactory.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MemoryDataStoreFactory.java
index 2a6cd1cb..2ad2dd05 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MemoryDataStoreFactory.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/MemoryDataStoreFactory.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.datastore.memory;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
@@ -27,12 +27,10 @@ import de.lmu.ifi.dbs.elki.database.datastore.DataStoreFactory;
import de.lmu.ifi.dbs.elki.database.datastore.WritableDBIDDataStore;
import de.lmu.ifi.dbs.elki.database.datastore.WritableDataStore;
import de.lmu.ifi.dbs.elki.database.datastore.WritableDoubleDataStore;
-import de.lmu.ifi.dbs.elki.database.datastore.WritableDoubleDistanceDataStore;
import de.lmu.ifi.dbs.elki.database.datastore.WritableIntegerDataStore;
import de.lmu.ifi.dbs.elki.database.datastore.WritableRecordStore;
import de.lmu.ifi.dbs.elki.database.ids.DBIDRange;
import de.lmu.ifi.dbs.elki.database.ids.DBIDs;
-import de.lmu.ifi.dbs.elki.distance.distancevalue.DoubleDistance;
/**
* Simple factory class that will store all data in memory using object arrays
@@ -44,18 +42,15 @@ import de.lmu.ifi.dbs.elki.distance.distancevalue.DoubleDistance;
* @author Erich Schubert
*
* @apiviz.stereotype factory
- * @apiviz.uses ArrayStore oneway - - «create»
- * @apiviz.uses ArrayRecordStore oneway - - «create»
- * @apiviz.uses MapStore oneway - - «create»
- * @apiviz.uses MapRecordStore oneway - - «create»
+ * @apiviz.has ArrayStore oneway - - «create»
+ * @apiviz.has ArrayRecordStore oneway - - «create»
+ * @apiviz.has MapStore oneway - - «create»
+ * @apiviz.has MapRecordStore oneway - - «create»
*/
public class MemoryDataStoreFactory implements DataStoreFactory {
@SuppressWarnings("unchecked")
@Override
public <T> WritableDataStore<T> makeStorage(DBIDs ids, int hints, Class<? super T> dataclass) {
- if (DoubleDistance.class.equals(dataclass)) {
- return (WritableDataStore<T>) makeDoubleDistanceStorage(ids, hints);
- }
if (Double.class.equals(dataclass)) {
return (WritableDataStore<T>) makeDoubleStorage(ids, hints);
}
@@ -83,23 +78,6 @@ public class MemoryDataStoreFactory implements DataStoreFactory {
}
}
- /**
- * Make a data storage for double distances.
- *
- * @param ids IDs to store for
- * @param hints Storage hints
- * @return double distance storage
- */
- public WritableDoubleDistanceDataStore makeDoubleDistanceStorage(DBIDs ids, int hints) {
- if(ids instanceof DBIDRange) {
- DBIDRange range = (DBIDRange) ids;
- return new ArrayDoubleDistanceStore(range.size(), range);
- }
- else {
- return new MapIntegerDBIDDoubleDistanceStore(ids.size());
- }
- }
-
@Override
public WritableDoubleDataStore makeDoubleStorage(DBIDs ids, int hints) {
if(ids instanceof DBIDRange) {
@@ -155,4 +133,4 @@ public class MemoryDataStoreFactory implements DataStoreFactory {
return new MapIntegerDBIDRecordStore(ids.size(), dataclasses.length);
}
}
-} \ No newline at end of file
+}
diff --git a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/package-info.java b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/package-info.java
index 5ea46015..dada2a9b 100644
--- a/src/de/lmu/ifi/dbs/elki/database/datastore/memory/package-info.java
+++ b/src/de/lmu/ifi/dbs/elki/database/datastore/memory/package-info.java
@@ -5,7 +5,7 @@
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
-Copyright (C) 2013
+Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team