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

Function matrix_max

week06/examples/function.cpp:11–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9};
10
11float matrix_max(struct Matrix mat)
12{
13 float max = FLT_MIN;
14 //find max value of mat
15 for(size_t r = 0; r < mat.rows; r++)
16 for (size_t c = 0; c < mat.cols; c++)
17 {
18 float val = mat.pData[ r * mat.cols + c];
19 max = ( max > val ? max : val);
20 }
21 return max;
22}
23
24Matrix * create_matrix(size_t rows, size_t cols)
25{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected