Package de.congrace.exp4j

Examples of de.congrace.exp4j.Calculable


       
        List<Double> results = new ArrayList<Double>();
       
        for (Double p : points)
        {
            Calculable calc = new ExpressionBuilder(equation.getEquation()).withVariable(
                    String.valueOf(equation.getIndependentVariable()), p).build();
            results.add(calc.calculate());
        }
       
        return new Solution(results, 0, 10, 1);
    }
View Full Code Here


       
        List<Double> results = new ArrayList<Double>();
       
        for (String f : function)
        {
            Calculable calc = new ExpressionBuilder(f).withVariables(map).build();
            results.add(calc.calculate() * h);
        }
       
        return results;
       
    }
View Full Code Here

       
        List<Double> results = new ArrayList<Double>();
       
        for (Double p : points)
        {
            Calculable calc = new ExpressionBuilder(equation.getEquation()).withVariable(
                    String.valueOf(equation.getIndependentVariable()), p).build();
            results.add(calc.calculate());
        }
       
        return new Solution(results, 0, 10, 1);
    }
View Full Code Here

       
        List<Double> results = new ArrayList<Double>();
       
        for (String f : function)
        {
            Calculable calc = new ExpressionBuilder(f).withVariables(map).build();
            results.add(calc.calculate() * h);
        }
       
        return results;
    }
View Full Code Here

        for (List<String> function : functions)
        {
            List<Double> result = new ArrayList<Double>(function.size());
            for (String f : function)
            {
                Calculable calc = new ExpressionBuilder(f).withVariables(map).build();
                result.add(calc.calculate() * h);
            }
            results.add(result);
        }
       
        return results;
View Full Code Here

    @RequestMapping(value = "/evaluate", method = RequestMethod.GET)
    @ResponseBody
    public Map<String, Object> evaluate(HttpServletRequest request) throws UnknownFunctionException, UnparsableExpressionException {
        String query = request.getParameter("query");

        Calculable calc = new ExpressionBuilder(query).build();

        return Collections.singletonMap(query, (Object) calc.calculate());
    }
View Full Code Here

TOP

Related Classes of de.congrace.exp4j.Calculable

Copyright © 2018 www.massapicom. 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.