Examples of MathFunction


Examples of com.sk89q.craftbook.mechanics.ic.gates.variables.NumericModifier.MathFunction

                String[] mvarParts = RegexUtil.EQUALS_PATTERN.split(newVal,2);
                String mnamespace = VariableManager.instance.getNamespace(mvarParts[0]);
                String mvar = VariableManager.instance.getVariableName(mvarParts[0]);

                String[] mathFunctionParts = RegexUtil.COLON_PATTERN.split(mvarParts[1], 2);
                MathFunction func = MathFunction.parseFunction(mathFunctionParts[0]);

                String cur = VariableManager.instance.getVariable(mvar,mnamespace);
                if(cur == null || cur.isEmpty()) cur = "0";

                double currentValue = Double.parseDouble(cur);
                double amount = Double.parseDouble(mathFunctionParts[1]);

                currentValue = func.parseNumber(currentValue, amount);

                String val = String.valueOf(currentValue);
                if (val.endsWith(".0"))
                    val = StringUtils.replace(val, ".0", "");
View Full Code Here

Examples of umontreal.iro.lecuyer.functions.MathFunction

      return retour;
   }


   private static double evaluateX (final MathFunction spline, final double y, double xPrincipal, double xAnnexe) {
      final MathFunction xFunction = new MathFunction () {
         public double evaluate (double t) {
            return spline.evaluate(t) - y;
         }
      };
      return RootFinder.brentDekker (xPrincipal, xAnnexe-1.0E-6, xFunction, 1e-6);
View Full Code Here

Examples of umontreal.iro.lecuyer.functions.MathFunction

      }
      return bs;
   }

   public double evaluate(final double u) {
      final MathFunction xFunction = new MathFunction () {
         public double evaluate (double t) {
            return evalX(t) - u;
         }
      };
      final double t = RootFinder.brentDekker (0, 1-1.0E-6, xFunction, 1e-6);
View Full Code Here

Examples of umontreal.iro.lecuyer.functions.MathFunction

         throw new IllegalArgumentException ("u not in [0,1]");
      if (u <= 0.0) return 0.0;
      if (u >= 1.0)
         return Double.POSITIVE_INFINITY;

      MathFunction f = new FunctionInverse (mu, sigma, u);
      return RootFinder.brentDekker (0.0, mu + 10.0*sigma, f, 1.0e-14);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.