Package ptolemy.math

Examples of ptolemy.math.FixPoint


            Rounding rounding = Rounding
                    .getName(((Parameter) getAttribute("outputRounding"))
                            .getExpression().toLowerCase());

            FixPoint result = new FixPoint(((ScalarToken) initialValue
                    .getToken()).doubleValue(), new FixPointQuantization(
                    precision, overflow, rounding));
            output.setInitToken(new FixToken(result));
        }
        if (attribute == initialValue) {
            Precision precision = new Precision(
                    ((Parameter) getAttribute("outputPrecision"))
                            .getExpression());

            Overflow overflow = Overflow
                    .getName(((Parameter) getAttribute("outputOverflow"))
                            .getExpression().toLowerCase());

            Rounding rounding = Rounding
                    .getName(((Parameter) getAttribute("outputRounding"))
                            .getExpression().toLowerCase());

            FixPoint result = new FixPoint(((ScalarToken) initialValue
                    .getToken()).doubleValue(), new FixPointQuantization(
                    precision, overflow, rounding));
            output.setInitToken(new FixToken(result));
        }
    }
View Full Code Here


        Rounding rounding = Rounding
                .getName(((Parameter) getAttribute("outputRounding"))
                        .getExpression().toLowerCase());

        FixPoint result = new FixPoint(((ScalarToken) initialValue.getToken())
                .doubleValue(), new FixPointQuantization(precision, overflow,
                rounding));
        int latencyValue = ((ScalarToken) latency.getToken()).intValue();
        output.setSize(latencyValue, new FixToken(result));
    }
View Full Code Here

     */
    public void fire() throws IllegalActionException {
        super.fire();

        if (input.hasToken(0)) {
            FixPoint value = ((FixToken) input.get(0)).fixValue();
            String string = value.bigDecimalValue().toString() + " "
                    + value.getPrecision().toString(Precision.VHDL);

            output.send(0, new StringToken(string));
        }
    }
View Full Code Here

                }
            }

            // Produce an output if we consumed an input.
            if (_consumed) {
                FixPoint result = new FixPoint(_latestCount);
                Token outputToken = new FixToken(result);
                sendOutput(output, 0, outputToken);
            }
        } else {
            ((QueuedTypedIOPort) output).resend(0);
View Full Code Here

            Rounding rounding = Rounding
                    .getName(((Parameter) getAttribute("outputRounding"))
                            .getExpression().toLowerCase());

            FixPoint result = new FixPoint(value, new FixPointQuantization(
                    precision, overflow, rounding));

            sendOutput(output, 0, new FixToken(result));
        }
    }
View Full Code Here

TOP

Related Classes of ptolemy.math.FixPoint

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.