// if no control matrix is available, the row and column dimension will be 0
if (controlMatrix != null &&
controlMatrix.getRowDimension() > 0 &&
controlMatrix.getColumnDimension() > 0 &&
controlMatrix.getRowDimension() != transitionMatrix.getRowDimension()) {
throw new MatrixDimensionMismatchException(controlMatrix.getRowDimension(),
controlMatrix.getColumnDimension(),
transitionMatrix.getRowDimension(),
controlMatrix.getColumnDimension());
}
// Q must be equal to A
MatrixUtils.checkAdditionCompatible(transitionMatrix, processNoise);
// column dimension of H must be equal to row dimension of A
if (measurementMatrix.getColumnDimension() != transitionMatrix.getRowDimension()) {
throw new MatrixDimensionMismatchException(measurementMatrix.getRowDimension(),
measurementMatrix.getColumnDimension(),
measurementMatrix.getRowDimension(),
transitionMatrix.getRowDimension());
}
// row dimension of R must be equal to row dimension of H
if (measNoise.getRowDimension() != measurementMatrix.getRowDimension()) {
throw new MatrixDimensionMismatchException(measNoise.getRowDimension(),
measNoise.getColumnDimension(),
measurementMatrix.getRowDimension(),
measNoise.getColumnDimension());
}
}