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

Function markMatrixAsSynced

quest/src/api/matrices.cpp:337–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335// type T can be CompMatr, DiagMatr or FullStateDiagMatr
336template <class T>
337void markMatrixAsSynced(T matr) {
338
339 // indicate that the matrix is now permanently GPU synchronised, even
340 // if we are not in GPU-accelerated mode (in which case it's never consulted)
341 *(matr.wasGpuSynced) = 1;
342
343 // indicate that we do not know the revised matrix properties;
344 // we defer establishing that until validation needs to check them
345 util_setFlagToUnknown(matr.isApproxUnitary);
346 util_setFlagToUnknown(matr.isApproxHermitian);
347
348 // only diagonal matrices (which can be exponentiated)
349 // have these additional fields
350 if constexpr (!util_isDenseMatrixType<T>()) {
351 util_setFlagToUnknown(matr.isApproxNonZero);
352 util_setFlagToUnknown(matr.isStrictlyNonNegative);
353 }
354}
355
356
357// type T can be CompMatr, DiagMatr or FullStateDiagMatr

Calls 1

util_setFlagToUnknownFunction · 0.85

Tested by

no test coverage detected