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

Function getRandomNonSquareMatrix

tests/utils/random.cpp:256–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254
255
256qmatrix getRandomNonSquareMatrix(size_t numRows, size_t numCols) {
257
258 // this function is DANGEROUS; it produces a
259 // non-square matrix, whereas most test utilities
260 // assume qmatrix is square. It should ergo be
261 // used very cautiously!
262
263 qmatrix out = qmatrix(numRows, qvector(numCols));
264
265 for (auto& row : out)
266 for (auto& elem : row)
267 elem = getRandomComplex();
268
269 return out;
270}
271
272
273qmatrix getRandomMatrix(size_t dim) {

Callers 2

getRandomMatrixFunction · 0.85
SECTIONFunction · 0.85

Calls 1

getRandomComplexFunction · 0.70

Tested by

no test coverage detected