*/
public void attributeChanged(Attribute attribute)
throws IllegalActionException {
if (attribute == A) {
// Check that it is a square matrix.
DoubleMatrixToken token = (DoubleMatrixToken) A.getToken();
if ((token.getRowCount() == 0) || (token.getColumnCount() == 0)
|| (token.getRowCount() != token.getColumnCount())) {
throw new IllegalActionException(this,
"The A matrix must be a nonempty square matrix.");
}
} else if (attribute == B) {
// Check that B is a matrix.
DoubleMatrixToken token = (DoubleMatrixToken) B.getToken();
if ((token.getRowCount() == 0) || (token.getColumnCount() == 0)) {
throw new IllegalActionException(this,
"The B matrix must be a nonempty matrix.");
}
} else if (attribute == C) {
// Check that C is a matrix.
DoubleMatrixToken token = (DoubleMatrixToken) C.getToken();
if ((token.getRowCount() == 0) || (token.getColumnCount() == 0)) {
throw new IllegalActionException(this,
"The C matrix must be a nonempty matrix.");
}
} else if (attribute == D) {
DoubleMatrixToken token = (DoubleMatrixToken) D.getToken();
if ((token.getRowCount() == 0) || (token.getColumnCount() == 0)) {
throw new IllegalActionException(this,
"The D matrix must be a nonempty matrix.");
}
} else if (attribute == initialStates) {
// The initialStates parameter should be a row vector.
DoubleMatrixToken token = (DoubleMatrixToken) initialStates
.getToken();
if ((token.getColumnCount() != 1) || (token.getRowCount() < 1)) {
throw new IllegalActionException(this,
"The initialStates must be a column vector.");
}
_initialStateChanged = true;