/** * Builds a database for the derivator consisting of the ids in the specified * interval. * * @param relation the database storing the parameterization functions * @param ids the ids to build the database from * @return a database for the derivator consisting of the ids in the specified * interval */ private Database buildDerivatorDB(Relation<ParameterizationFunction> relation, DBIDs ids) { ProxyDatabase proxy = new ProxyDatabase(ids); int dim = dimensionality(relation); SimpleTypeInformation<DoubleVector> type = new VectorFieldTypeInformation<>(DoubleVector.FACTORY, dim); MaterializedRelation<DoubleVector> prep = new MaterializedRelation<>(type, ids); proxy.addRelation(prep); // Project for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { prep.insert(iter, DoubleVector.wrap(relation.get(iter).getColumnVector())); } return proxy; }
/** * Builds a database for the derivator consisting of the ids in the specified * interval. * * @param relation the database storing the parameterization functions * @param ids the ids to build the database from * @return a database for the derivator consisting of the ids in the specified * interval */ private Database buildDerivatorDB(Relation<ParameterizationFunction> relation, DBIDs ids) { ProxyDatabase proxy = new ProxyDatabase(ids); int dim = dimensionality(relation); SimpleTypeInformation<DoubleVector> type = new VectorFieldTypeInformation<>(DoubleVector.FACTORY, dim); MaterializedRelation<DoubleVector> prep = new MaterializedRelation<>(type, ids); proxy.addRelation(prep); // Project for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { DoubleVector v = new DoubleVector(relation.get(iter).getColumnVector().getArrayRef()); prep.insert(iter, v); } return proxy; }