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

Function cpu_allocMatrixList

quest/src/cpu/cpu_config.cpp:362–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360
361
362qcomp*** cpu_allocMatrixList(qindex numRows, int numMatrices) {
363
364 // attempt to allocate the outer list
365 qcomp*** matrices = (qcomp***) malloc(numMatrices * sizeof *matrices); // nullptr if failed
366
367 // attempt to allocate each matrix
368 if (matrices != nullptr)
369 for (int n=0; n<numMatrices; n++)
370 matrices[n] = cpu_allocMatrix(numRows); // nullptr if failed
371
372 return matrices; // may be or contain nullptrs, user will handle
373}
374
375
376void cpu_deallocMatrixList(qcomp*** matrices, qindex numRows, int numMatrices) {

Callers 1

createKrausMapFunction · 0.85

Calls 1

cpu_allocMatrixFunction · 0.85

Tested by

no test coverage detected