public function scalarMultiply($λ) : Matrix
{
if (!is_numeric($λ)) {
throw new Exception\BadParameterException('Parameter λ is not a number');
}
$R = [];
for ($i = 0; $i < $this->m; $i++) {
for ($j = 0; $j < $this->n; $j++) {
$R[$i][$j] = $this->A[$i][$j] * $λ;
}
}
return MatrixFactory::create($R);
}