MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / createInlineDiagMatr

Function createInlineDiagMatr

quest/src/api/matrices.cpp:549–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547
548
549DiagMatr 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

Callers 3

SECTIONFunction · 0.85

Calls 5

validate_envIsInitFunction · 0.85
createDiagMatrFunction · 0.85
setDiagMatrFunction · 0.85

Tested by

no test coverage detected