* 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);