| 466 | |
| 467 | template <typename exp> |
| 468 | qc_scalar_type compute_state_element ( |
| 469 | const matrix_exp<exp>& reg, |
| 470 | long row_idx |
| 471 | ) const |
| 472 | { |
| 473 | // make sure requires clause is not broken |
| 474 | DLIB_ASSERT(reg.nr() == dims && reg.nc() == 1 && |
| 475 | 0 <= row_idx && row_idx < dims, |
| 476 | "\tqc_scalar_type gate::compute_state_element(reg,row_idx)" |
| 477 | << "\n\tinvalid arguments to this function" |
| 478 | << "\n\treg.nr(): " << reg.nr() |
| 479 | << "\n\treg.nc(): " << reg.nc() |
| 480 | << "\n\tdims: " << dims |
| 481 | << "\n\trow_idx: " << row_idx |
| 482 | << "\n\tthis: " << this |
| 483 | ); |
| 484 | |
| 485 | |
| 486 | return (data*reg)(row_idx); |
| 487 | } |
| 488 | |
| 489 | private: |
| 490 |
no test coverage detected