本文整理了Java中de.lmu.ifi.dbs.elki.database.relation.Relation.size
方法的一些代码示例,展示了Relation.size
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Relation.size
方法的具体详情如下:
包路径:de.lmu.ifi.dbs.elki.database.relation.Relation
类名称:Relation
方法名:size
[英]Get the number of DBIDs.
[中]获取DBID的数量。
代码示例来源:origin: elki-project/elki
@Override
public int size() {
return db.size();
}
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
if(positions != null) {
throw new UnsupportedOperationException("Preprocessor already ran.");
}
if(relation.size() > 0) {
preprocess();
}
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
if(storage != null) {
throw new UnsupportedOperationException("Preprocessor already ran.");
}
if(relation.size() > 0) {
preprocess();
}
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
if(curves != null) {
throw new UnsupportedOperationException("Preprocessor already ran.");
}
if(relation.size() > 0) {
preprocess();
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index-preprocessed
@Override
public void initialize() {
if(curves != null) {
throw new UnsupportedOperationException("Preprocessor already ran.");
}
if(relation.size() > 0) {
preprocess();
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index-preprocessed
@Override
public void initialize() {
if(positions != null) {
throw new UnsupportedOperationException("Preprocessor already ran.");
}
if(relation.size() > 0) {
preprocess();
}
}
代码示例来源:origin: elki-project/elki
@Override
public void logStatistics() {
long count = 0L;
for(ModifiableDoubleDBIDList column : index) {
count += column.size();
}
double sparsity = count / (index.size() * (double) relation.size());
LOG.statistics(new DoubleStatistic(this.getClass().getName() + ".sparsity", sparsity));
}
代码示例来源:origin: elki-project/elki
@Override
public <O extends DBID> DistanceQuery<O> instantiate(Relation<O> relation) {
if(cache == null) {
try {
loadCache(relation.size(), new BufferedInputStream(FileUtil.tryGzipInput(new FileInputStream(matrixfile))));
}
catch(IOException e) {
throw new AbortException("Could not load external distance file: " + matrixfile.toString(), e);
}
}
return super.instantiate(relation);
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-precomputed
@Override
public <O extends DBID> DistanceQuery<O> instantiate(Relation<O> relation) {
if(cache == null) {
try {
loadCache(relation.size(), new BufferedInputStream(FileUtil.tryGzipInput(new FileInputStream(matrixfile))));
}
catch(IOException e) {
throw new AbortException("Could not load external distance file: " + matrixfile.toString(), e);
}
}
return super.instantiate(relation);
}
代码示例来源:origin: elki-project/elki
@Override
public CorrelationClusterOrder run(Database db, Relation<V> relation) {
if(mu >= relation.size()) {
throw new AbortException("Parameter mu is chosen unreasonably large. This won't yield meaningful results.");
}
return new Instance(db, relation).run();
}
代码示例来源:origin: elki-project/elki
/**
* Compute optimal kernel bandwidth
*
* @param dim Dimensionality of subspace
* @return optimal bandwidth
*/
protected double optimalBandwidth(int dim) {
// Pi in the publication is redundant and cancels out!
double hopt = 8 * GammaDistribution.gamma(dim / 2.0 + 1) * (dim + 4) * MathUtil.powi(2, dim);
return hopt * FastMath.pow(relation.size(), (-1. / (dim + 4)));
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-clustering
@Override
public CorrelationClusterOrder run(Database db, Relation<V> relation) {
if(mu >= relation.size()) {
throw new AbortException("Parameter mu is chosen unreasonably large. This won't yield meaningful results.");
}
return new Instance(db, relation).run();
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
super.initialize();
List<MkAppEntry> objs = new ArrayList<>(relation.size());
for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) {
DBID id = DBIDUtil.deref(iter);
final O object = relation.get(id);
objs.add(createNewLeafEntry(id, object, Double.NaN));
}
insertAll(objs);
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
super.initialize();
List<MkCoPEntry> objs = new ArrayList<>(relation.size());
for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) {
DBID id = DBIDUtil.deref(iter); // FIXME: expensive
final O object = relation.get(id);
objs.add(createNewLeafEntry(id, object, Double.NaN));
}
insertAll(objs);
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index-mtree
@Override
public void initialize() {
super.initialize();
List<MkCoPEntry> objs = new ArrayList<>(relation.size());
for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) {
DBID id = DBIDUtil.deref(iter); // FIXME: expensive
final O object = relation.get(id);
objs.add(createNewLeafEntry(id, object, Double.NaN));
}
insertAll(objs);
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
super.initialize();
List<MkTabEntry> objs = new ArrayList<>(relation.size());
for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) {
DBID id = DBIDUtil.deref(iter); // FIXME: expensive
final O object = relation.get(id);
objs.add(createNewLeafEntry(id, object, Double.NaN));
}
insertAll(objs);
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
sorted = DBIDUtil.newDistanceDBIDList(relation.size());
dims = RelationUtil.dimensionality(relation);
for(DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) {
sorted.add(Double.NaN, it);
}
buildTree(0, sorted.size(), 0, sorted.iter());
}
代码示例来源:origin: elki-project/elki
@Override
protected void preprocess() {
createStorage();
materialized_RkNN = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT, TreeSet.class);
FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("Materializing k nearest neighbors and reverse k nearest neighbors (k=" + k + ")", relation.size(), getLogger()) : null;
materializeKNNAndRKNNs(DBIDUtil.ensureArray(relation.getDBIDs()), progress);
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index-preprocessed
@Override
protected void preprocess() {
createStorage();
materialized_RkNN = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT, TreeSet.class);
FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("Materializing k nearest neighbors and reverse k nearest neighbors (k=" + k + ")", relation.size(), getLogger()) : null;
materializeKNNAndRKNNs(DBIDUtil.ensureArray(relation.getDBIDs()), progress);
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index-various
@Override
public void initialize() {
sorted = DBIDUtil.newDistanceDBIDList(relation.size());
dims = RelationUtil.dimensionality(relation);
for(DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) {
sorted.add(Double.NaN, it);
}
buildTree(0, sorted.size(), 0, sorted.iter());
}
内容来源于网络,如有侵权,请联系作者删除!