Add is_invertible
This commit is contained in:
parent
08a1877709
commit
881b0b44cf
1 changed files with 5 additions and 4 deletions
|
@ -145,10 +145,6 @@ public:
|
|||
}
|
||||
return result;
|
||||
}
|
||||
const bool is_unitary() const{
|
||||
matrix m = this->hermitian_conjugate();
|
||||
return (*this * m == this->I());
|
||||
}
|
||||
// FIXME: This is very dumb
|
||||
const vector get_eigenvalues() const {
|
||||
if (this->is_diagonal())
|
||||
|
@ -163,6 +159,11 @@ public:
|
|||
return false;
|
||||
return *this == this->hermitian_conjugate();
|
||||
}
|
||||
const bool is_invertible() const { return this->determinant() != 0; }
|
||||
const bool is_unitary() const {
|
||||
matrix m = this->hermitian_conjugate();
|
||||
return (*this * m == this->I());
|
||||
}
|
||||
friend std::ostream &operator<<(std::ostream &os, const matrix &m) {
|
||||
char last = '\0';
|
||||
int longest = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue