MCPcopy Create free account
hub / github.com/ShiqiYu/CPP / create_matrix

Function create_matrix

week06/examples/function.cpp:24–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24Matrix * create_matrix(size_t rows, size_t cols)
25{
26 Matrix * p = new Matrix{rows, cols};
27 p->pData = new float[p->rows * p->cols]{1.f, 2.f, 3.f};
28 //you should check if the memory is allocated successfully
29 return p;
30}
31
32bool matrix_add(const Matrix & matA, const Matrix & matB, Matrix & matC)
33{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected