Exemplo n.º 1
0
 private void verifyValidatorsPass(List<String> values) {
   for (String value : values) {
     for (ParameterValidator validator : this.validators) {
       validator.validate(this, value);
     }
   }
 }
    /** {@inheritDoc} */
    @Override
    public Evaluation evaluate(final RealVector point) {
      // Copy so optimizer can change point without changing our instance.
      final RealVector p =
          paramValidator == null ? point.copy() : paramValidator.validate(point.copy());

      if (lazyEvaluation) {
        return new LazyUnweightedEvaluation((ValueAndJacobianFunction) model, target, p);
      } else {
        // Evaluate value and jacobian in one function call.
        final Pair<RealVector, RealMatrix> value = model.value(p);
        return new UnweightedEvaluation(value.getFirst(), value.getSecond(), target, p);
      }
    }