public function eig(bool $normalize = true) : array
    {
        if (!$this->isSquare()) {
            throw new RuntimeException('Cannot decompose a non'
                . ' square matrix.');
        }

        $jama = new JAMA($this->a);

        $decomp = $jama->eig();

        $eigenvalues = $decomp->getRealEigenvalues();
        $eigenvectors = $decomp->getV()->getArray();

        $eigenvectors = self::quick($eigenvectors)
            ->transpose();

        if ($normalize === true) {
            $norm = $eigenvectors->transpose()
                ->square()
                ->sum()
                ->sqrt()
                ->transpose();
        
            $eigenvectors = $eigenvectors->divide($norm);
        }

        return [$eigenvalues, $eigenvectors];
    }