/// <summary>Creates a new <see cref="MultiDimOptimizer.IConstraint"/> object. /// </summary> /// <param name="inequality">The specific constraints in its <see cref="MultiDimRegion.Inequality"/> representation.</param> /// <returns>A specific <see cref="MultiDimOptimizer.IConstraint"/> object with respect to the specified optimization algorithm.</returns> /// <exception cref="InvalidOperationException">Thrown, if the optimization algorithm does not support this kind of constraints.</exception> public MultiDimOptimizer.IConstraint Create(MultiDimRegion.Inequality inequality) { if (SupportedConstraints.HasFlag(ConstraintType.Inequality) == true) { return(new MultiDimOptimizerConstraint(this, inequality)); } throw new InvalidOperationException(); }
/// <summary>Creates a new <see cref="MultiDimOptimizer.IConstraint"/> object. /// </summary> /// <param name="inequality">The specific constraints in its <see cref="MultiDimRegion.Inequality"/> representation.</param> /// <returns>A specific <see cref="MultiDimOptimizer.IConstraint"/> object with respect to the specified optimization algorithm.</returns> /// <exception cref="InvalidOperationException">Thrown, if the optimization algorithm does not support this kind of constraints.</exception> MultiDimOptimizer.IConstraint MultiDimOptimizer.IConstraintFactory.Create(MultiDimRegion.Inequality inequality) { return(this.Create(inequality.Dimension, inequality.GetValue, inequality.Tolerance)); }