@Test public void testMap() { VectorGeneratorsFamily family = new VectorGeneratorsFamily.Builder() .add(() -> VectorUtils.of(1., 2.)) .map(g -> g.move(VectorUtils.of(1, -1))) .build(0L); assertArrayEquals(new double[] {2., 1.}, family.get().asArray(), 1e-7); }
@Override public Vector get() { return family.get(selector.getInt()).get(); }
VectorGeneratorsFamily implements VectorGenerator { @Override public Vector get() { return family.get(selector.getInt()).get(); } }
VectorGeneratorsFamily implements VectorGenerator { @Override public Vector get() { return family.get(selector.getInt()).get(); } private  VectorGeneratorsFamily(List<VectorGenerator> family, DiscreteRandomProducer selector); }
VectorGeneratorsFamily implements VectorGenerator { @Override public Vector get() { return family.get(selector.getInt()).get(); } private  VectorGeneratorsFamily(List<VectorGenerator> family, DiscreteRandomProducer selector); @Override Vector get(); VectorWithDistributionId getWithId(); @Override DataStreamGenerator asDataStream(); }
VectorGeneratorsFamily implements VectorGenerator { @Override public Vector get() { return family.get(selector.getInt()).get(); } private  VectorGeneratorsFamily(List<VectorGenerator> family, DiscreteRandomProducer selector); @Override Vector get(); VectorWithDistributionId getWithId(); @Override DataStreamGenerator asDataStream();  }