public function columnExclude(int $nᵢ) : Matrix
{
if ($nᵢ >= $this->n || $nᵢ < 0) {
throw new Exception\MatrixException('Column to exclude does not exist');
}
$m = $this->m;
$n = $this->n;
$R = [];
for ($i = 0; $i < $m; $i++) {
for ($j = 0; $j < $n; $j++) {
if ($j === $nᵢ) {
continue;
}
$R[$i][$j] = $this->A[$i][$j];
}
}
// Reset column indexes
for ($i = 0; $i < $m; $i++) {
$R[$i] = array_values($R[$i]);
}
return MatrixFactory::create($R);
}