Package net.fortytwo.ripple.model

Examples of net.fortytwo.ripple.model.RippleList.push()


                        throw new RippleException("list index out of bounds: " + i);
                    }
                }

                solutions.put(
                        rest.push(list.getFirst()));
            }
        };

        mc.toList(l, listSink);
    }
View Full Code Here


        stack = stack.getRest();

        result = mc.valueOf(Math.cosh(a.doubleValue()));

        solutions.put(
                stack.push(result));
    }
}
View Full Code Here

        RippleValue first = stack.getFirst();
        final RippleList rest = stack.getRest();

        Sink<Operator> opSink = new Sink<Operator>() {
            public void put(final Operator op) throws RippleException {
                solutions.put(rest.push(
                        new StackMappingWrapper(new OptionalQuantifier(op), mc)));
            }
        };

        Operator.createOperator(first, opSink, mc);
View Full Code Here

        stack = stack.getRest();

        result = a.sub(b);

        solutions.put(
                stack.push(result));
    }

    @Override
    public StackMapping getInverse() throws RippleException {
        return MathLibrary.getAddValue();
View Full Code Here

        stack = stack.getRest();
        x = stack.getFirst();
        stack = stack.getRest();

        solutions.put(
                stack.push(x).push(x).push(y));
    }
}
View Full Code Here

        // Note: division by zero simply does not yield a result.
        if (!b.isZero()) {
            result = a.div(b);

            solutions.put(
                    stack.push(result));
        }
    }

    @Override
    public StackMapping getInverse() throws RippleException {
View Full Code Here

        Operator.createOperator(mappingVal, operators, mc);

        Sink<RippleList> listSink = new Sink<RippleList>() {
            public void put(final RippleList list) throws RippleException {
                if (list.isNil()) {
                    solutions.put(rest.push(list));
                }

                // TODO: this is probably a little more complicated than it needs to be
                else {
                    RippleList inverted = list.invert();
View Full Code Here

            double d = Math.sqrt(a);

            // Yield both square roots.
            try {
                solutions.put(
                        stack.push(mc.valueOf(d)));
                if (d > 0) {
                    solutions.put(
                            stack.push(mc.valueOf(0.0 - d)));
                }
            } catch (RippleException e) {
View Full Code Here

                    list = list.getRest();
                }

                if (null != result) {
                    solutions.put(
                            rest.push(result));
                }
            }
        };

        mc.toList(l, listSink);
View Full Code Here

            try {
                solutions.put(
                        stack.push(mc.valueOf(d)));
                if (d > 0) {
                    solutions.put(
                            stack.push(mc.valueOf(0.0 - d)));
                }
            } catch (RippleException e) {
                // Soft fail
                e.logError();
            }
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.