/* (non-Javadoc)
@see net.finmath.stochastic.RandomVariable#div(double)
347367
@Override
	public RandomVariable div(double value) {
		return apply(OperatorType.DIV, new RandomVariable[]{this, constructNewAADRandomVariable(value)});
	}
224314
@Override
	public RandomVariable sub(RandomVariable randomVariable) {
		return new RandomVariableDifferentiableAADStochasticNonOptimized(
				getValues().sub(randomVariable),
				Arrays.asList(this, randomVariable),
				OperatorType.SUB);
	}
598230
public Vector4f div(float x, float y, float z, float w, Vector4f dest) {
        dest.x = this.x / x;
        dest.y = this.y / y;
        dest.z = this.z / z;
        dest.w = this.w / w;
        return dest;
    }
338275
public Vector3d div(double x, double y, double z, Vector3d dest) {
        dest.x = this.x / x;
        dest.y = this.y / y;
        dest.z = this.z / z;
        return dest;
    }
906618
public Double getDouble(String name) {
        //let it fail in the more general case where it isn't actually a number
        Number number = (Number) content.get(name);
        if (number == null) {
            return null;
        } else if (number instanceof Double) {
            return (Double) number;
        } else {
            return number.doubleValue(); //autoboxing to Double
        }
    }
661664
public void set(double[] value) {
        checkIndex(value.length);

        for (int i = 0; i < value.length; ++i) {
            if (value[i] != 0d)
                set(i, value[i]);
        }
    }
305301
public void div(Complex c) {
        double modulus = c.real * c.real + c.imag * c.imag;
        double newreal = imag * c.imag + real * c.real;
        double newimag = imag * c.real - real * c.imag;
        real = newreal / modulus;
        imag = newimag / modulus;
    }
1241371
public static BigDecimal div(String v1, String v2) {
		return div(v1, v2, DEFAUT_DIV_SCALE);
	}
1197386
public void doMutation(double probability, DoubleSolution solution){
    for (int i = 0; i < solution.getNumberOfVariables(); i++) {
      if (randomGenenerator.getRandomValue() < probability) {
        double rand = randomGenenerator.getRandomValue();
        double tmp;

        if (rand <= 0.5) {
          tmp = delta(solution.getUpperBound(i) - solution.getVariableValue(i),
              perturbation);
          tmp += solution.getVariableValue(i);
        } else {
          tmp = delta(solution.getLowerBound(i) - solution.getVariableValue(i),
              perturbation);
          tmp += solution.getVariableValue(i);
        }

        if (tmp < solution.getLowerBound(i)) {
          tmp = solution.getLowerBound(i);
        } else if (tmp > solution.getUpperBound(i)) {
          tmp = solution.getUpperBound(i);
        }
        solution.setVariableValue(i, tmp);
      }
    }
  }
1060011
public Vector3d div(double scalar, Vector3d dest) {
        double inv = 1.0 / scalar;
        dest.x = x * inv;
        dest.y = y * inv;
        dest.z = z * inv;
        return dest;
    }
764340
private Double getDouble(Number number)
   {
      Double result = null;

      if (number != null)
      {
         result = Double.valueOf(number.doubleValue());
      }

      return result;
   }
720137
public RandomVariable  getZeroRate(double maturity)
	{
		if(maturity == 0) {
			return this.getZeroRate(1.0E-14);
		}

		return getDiscountFactor(maturity).log().div(-maturity);
	}
468106
@Override
	public RandomVariable cap(double cap) {
		return apply(new DoubleUnaryOperator() {
			@Override
			public double applyAsDouble(double x) {
				return Math.min(x, cap);
			}
		});
	}
569234
@Override
	public RandomVariable addRatio(RandomVariable numerator, RandomVariable denominator) {
		return apply(new DoubleBinaryOperator() {
			@Override
			public double applyAsDouble(double x, double y) {
				return x + y;
			}
		}, new DoubleBinaryOperator() {
			@Override
			public double applyAsDouble(double x, double y) {
				return x / y;
			}
		}, numerator, denominator);
	}
475800
private double getDouble( int idx, double defaultValue, CssFormatter formatter ) {
        if( parameters.size() <= idx ) {
            return defaultValue;
        }
        return parameters.get( idx ).doubleValue( formatter );
    }
1283163
public double getDouble(String key, double defaultValue) {
		addToDefaults(key, Double.toString(defaultValue));
		String value = get(key);
		if (value == null) {
			return defaultValue;
		} else {
			return Double.valueOf(value);
		}
	}
852370
@Override
	public RandomVariable add(double value) {
		return apply(OperatorType.ADD, new RandomVariable[]{this, constructNewAADRandomVariable(value)});
	}