BinaryLinearRecurrenceDescriptor constructor
- required BinaryMatrix stateMatrix,
- BinaryMatrix? inputMatrix,
- BigInt? offset,
Creates a binary linear recurrence descriptor.
Implementation
BinaryLinearRecurrenceDescriptor({
required this.stateMatrix,
this.inputMatrix,
BigInt? offset,
}) : offset = offset ?? BigInt.zero {
if (stateMatrix.rowCount != stateMatrix.columnCount) {
throw RohdHclException(
'Binary recurrence state matrix must be square, but is '
'${stateMatrix.rowCount}x${stateMatrix.columnCount}.');
}
if (inputMatrix != null && inputMatrix!.rowCount != stateWidth) {
throw RohdHclException(
'Binary recurrence input matrix must have $stateWidth rows, but has '
'${inputMatrix!.rowCount}.');
}
if (this.offset.isNegative || this.offset >= (BigInt.one << stateWidth)) {
throw RohdHclException(
'Binary recurrence offset ${this.offset} does not fit in '
'$stateWidth state bits.');
}
}