| 547 | |
| 548 | |
| 549 | DiagMatr createInlineDiagMatr(int numQb, vector<qcomp> elems) { |
| 550 | validate_envIsInit(__func__); |
| 551 | validate_newDiagMatrParams(numQb, __func__); |
| 552 | validate_matrixNumNewElems(numQb, elems, __func__); |
| 553 | |
| 554 | // pre-validation gauranteed to pass, but malloc failures will trigger an error |
| 555 | // message specific to 'createCompMatr', rather than this 'inline' version. Alas! |
| 556 | DiagMatr matr = createDiagMatr(numQb); |
| 557 | setDiagMatr(matr, elems.data()); // validation gauranteed to pass |
| 558 | return matr; |
| 559 | } |
| 560 | |
| 561 | |
| 562 |
no test coverage detected