| 75 | } |
| 76 | |
| 77 | cudaq::complex_matrix::value_type * |
| 78 | cudaq::complex_matrix::get_data(cudaq::complex_matrix::order order) { |
| 79 | if (order != this->internal_order) { |
| 80 | auto new_data = |
| 81 | new cudaq::complex_matrix::value_type[this->rows() * this->cols()]; |
| 82 | for (std::size_t i = 0; i < this->rows(); i++) |
| 83 | for (std::size_t j = 0; j < this->cols(); j++) |
| 84 | access(new_data, this->dimensions, i, j, order) = |
| 85 | access(this->data, this->dimensions, i, j, this->internal_order); |
| 86 | swap(new_data); |
| 87 | this->internal_order = order; |
| 88 | } |
| 89 | return this->data; |
| 90 | } |
| 91 | |
| 92 | const cudaq::complex_matrix::EigenMatrix |
| 93 | cudaq::complex_matrix::as_eigen() const { |
no test coverage detected