Examples of DoubleMatrixToken


Examples of ptolemy.data.DoubleMatrixToken

     *  the input token has more than one columns and rows.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        if (input.hasToken(0)) {
            DoubleMatrixToken vector = (DoubleMatrixToken) input.get(0);

            if (vector.getColumnCount() == 1) {
                int min = Math.min(vector.getRowCount(), output.getWidth());

                for (int i = 0; i < min; i++) {
                    output.send(i, vector.getElementAsToken(i, 0));
                }
            } else if (vector.getRowCount() == 1) {
                int min = Math.min(vector.getColumnCount(), output.getWidth());

                for (int i = 0; i < min; i++) {
                    output.send(i, vector.getElementAsToken(0, i));
                }
            } else {
                throw new IllegalActionException(this, "The input must "
                        + "be a DoubleMatrixToken with one column or row. "
                        + "But the input is " + vector);
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.