convertToZP method Null safety

void convertToZP()

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

Implementation

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

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