Compares double fields with these explicitly specified fields using the provided absolute
tolerance.

@param tolerance A finite, non-negative tolerance.
10597
public MapWithProtoValuesFluentAssertion<M> usingDoubleToleranceForFieldDescriptorsForValues(
      double tolerance, Iterable<FieldDescriptor> fieldDescriptors) {
    return usingConfig(config.usingDoubleToleranceForFieldDescriptors(tolerance, fieldDescriptors));
  }
1329716
@Override
  public void evaluate(DoubleSolution solution) {
    double [] f = new double[getNumberOfObjectives()];
    f[0] = solution.getVariableValue(0) ;
    f[1] = (1.0 + solution.getVariableValue(1))/solution.getVariableValue(0);
    
    solution.setObjective(0,f[0]);
    solution.setObjective(1,f[1]);

    this.evaluateConstraints(solution);
  }
356036
private static void set(Field field, Object obj, String value) throws Exception {
        Class<?> clazz = field.getType();
        field.setAccessible(true);
        if (clazz.equals(Double.class) || clazz.equals(double.class)) {
            double val = Double.valueOf(value);
            field.set(obj, val);
        } else if (clazz.equals(String.class)) {
            field.set(obj, value);
        } else if (clazz.equals(Integer.class) || clazz.equals(int.class)) {
            int val = Integer.parseInt(value);
            field.set(obj, val);
        } else if (clazz.equals(Float.class) || clazz.equals(float.class)) {
            float f = Float.parseFloat(value);
            field.set(obj, f);
        }
    }
381171
public function setTolerance($tolerance = 0.20)
        {
            if ($tolerance < 0 || $tolerance > 1) {
                return false;
            }

            $this->_tolerance = round($tolerance, 2);

            return $this;
        }
464974
private static void numericAdjustment(MethodVisitor mVisitor, String javaType) {
        adjustmentsMapper.getOrDefault(javaType, XsdAsmAttributes::doubleAdjustment).accept(mVisitor);
    }
236501
public void assign(AbstractIntDoubleMap other) {
	clear();
	other.forEachPair(
		new IntDoubleProcedure() {
			public boolean apply(int key, double value) {
				put(key,value);
				return true;
			}
		}
	);
}
1363920
public static void negative(Double value) {
		if(!validation) return;
		Validate.notNull(value);
		if(value >= 0.0)
			throw new ParameterException(ErrorCode.NOTNEGATIVE);
	}
930635
public static boolean isAbout(double expected, double value, double tolerance)
    {
        double delta = expected*tolerance/100.0;
        return value > expected-delta && value < expected+delta;
    }
894264
@Override
  public synchronized void accept(final double value) {
    super.accept(value);
    final double squareValue = value * value;
    simpleSumOfSquare += squareValue;
    sumOfSquareWithCompensation(squareValue);
  }
1303053
private void evaluateConstraints(DoubleSolution solution)  {
    double[] constraint = new double[this.getNumberOfConstraints()];

    double x1 = solution.getVariableValue(0);
    double x2 = solution.getVariableValue(1);
        
    constraint[0] = -x2 - (4.0 * x1) + 4.0  ;
    constraint[1] = x1 + 1.0 ;
    constraint[2] = x2 - x1 + 2.0 ;

    double overallConstraintViolation = 0.0;
    int violatedConstraints = 0;
    for (int i = 0; i < getNumberOfConstraints(); i++) {
      if (constraint[i]<0.0){
        overallConstraintViolation+=constraint[i];
        violatedConstraints++;
      }
    }

    overallConstraintViolationDegree.setAttribute(solution, overallConstraintViolation);
    numberOfViolatedConstraints.setAttribute(solution, violatedConstraints);
  }
40523
public static void equality(int a, int b)
    {
        if (a != b)
        {
            throw new LionEngineException(ERROR_ARGUMENT + String.valueOf(a) + ERROR_EQUALS + String.valueOf(b));
        }
    }
271701
private static void checkAndCorrect(final double[] probabilities) {
		boolean ok = true;
		for (int i = probabilities.length; --i >= 0 && ok;) {
			ok = Double.isFinite(probabilities[i]);
		}

		if (!ok) {
			final double value = 1.0/probabilities.length;
			for (int i = probabilities.length; --i >= 0;) {
				probabilities[i] = value;
			}
		}
	}
756297
static void checkTolerance(float tolerance) {
    checkArgument(!Float.isNaN(tolerance), "tolerance cannot be NaN");
    checkArgument(tolerance >= 0.0f, "tolerance (%s) cannot be negative", tolerance);
    checkArgument(
        floatToIntBits(tolerance) != NEG_ZERO_BITS, "tolerance (%s) cannot be negative", tolerance);
    checkArgument(tolerance != Float.POSITIVE_INFINITY, "tolerance cannot be POSITIVE_INFINITY");
  }
920574
@Override
  public void evaluate(DoubleSolution solution)  {
    double [] fx = new double[getNumberOfObjectives()];
    
    double x1,x2,x3,x4,x5,x6;
    x1 = solution.getVariableValue(0);
    x2 = solution.getVariableValue(1);
    x3 = solution.getVariableValue(2);
    x4 = solution.getVariableValue(3);
    x5 = solution.getVariableValue(4);
    x6 = solution.getVariableValue(5);

    fx[0] = - (25.0*(x1-2.0)*(x1-2.0) +
                  (x2-2.0)*(x2-2.0) + 
                  (x3-1.0)*(x3-1.0) + 
                  (x4-4.0)*(x4-4.0)+
                  (x5-1.0)*(x5-1.0));
                
    fx[1] = x1*x1 + x2*x2 + x3*x3 + x4*x4 + x5*x5 + x6*x6;
    
    solution.setObjective(0,fx[0]);
    solution.setObjective(1,fx[1]);

    this.evaluateConstraints(solution);
  }
1338496
def getCorrect(self, tolerance):
        
        return Numeric.add.reduce(Numeric.fabs(self.target - self.activation) < tolerance)
365410
public static void validateFractionDigits(int fractionDigits, double value){
        if (value != ((int) value)){
            String doubleValue = String.valueOf(value);

            int numberOfFractionDigits = doubleValue.substring(doubleValue.indexOf(',')).length();

            if (numberOfFractionDigits > fractionDigits){
                throw new RestrictionViolationException("Violation of fractionDigits restriction, value should have a maximum of " + fractionDigits + " decimal places.");
            }
        }
    }
471554
public int getIsSimple(double tolerance) {
		if (!_hasDirtyFlag(DirtyFlags.DirtyIsKnownSimple)) {
			if (!_hasDirtyFlag(DirtyFlags.IsWeakSimple)) {
				return 0;
			}
			if (m_simpleTolerance >= tolerance) {
				if (!_hasDirtyFlag(DirtyFlags.DirtyOGCFlags))
					return 2;

				return 1;
			}

			return -1;
		}
		return -1;
	}