convertToZC method Null safety

void convertToZC()

The C(x,y) function: Convert a complex matrix from partitioned to "complex-like" form

Implementation

void convertToZC() {
  isLU = false;
  if (rows % 2 == 1) {
    throw CalculatorError(11);
  }
  final newRows = rows ~/ 2;
  final newColumns = columns * 2;
  int newHome(final int i) {
    final r = i ~/ columns;
    final c = i % columns;
    final rn = r % newRows;
    final cn = c * 2 + (r >= newRows ? 1 : 0);
    return rn * newColumns + cn;
  }

  _internalMove(1, length - 1, newHome);
  _columns *= 2;
}