diff --git a/matrix.hpp b/matrix.hpp index e743c7b..48750ba 100644 --- a/matrix.hpp +++ b/matrix.hpp @@ -147,16 +147,7 @@ public: const bool is_hermitian() const { if (this->entry_dimension != this->num_entries) return false; - matrix m = this->hermitian_conjugate(); - bool equal = true; - for (long long i = 0; i < m.num_entries; i++) { - for (long long j = 0; j < m.entry_dimension; j++) { - if (m[i][j] != this->entries[i][j]) { - equal = false; - } - } - } - return equal; + return *this == this->hermitian_conjugate(); } friend ostream &operator<<(ostream &os, const matrix &m) { char last = '\0';