MCPcopy Create free account
hub / github.com/numpy/numpy / _select_matrix_shape

Function _select_matrix_shape

numpy/core/src/common/cblasfuncs.c:158–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156
157
158static MatrixShape
159_select_matrix_shape(PyArrayObject *array)
160{
161 switch (PyArray_NDIM(array)) {
162 case 0:
163 return _scalar;
164 case 1:
165 if (PyArray_DIM(array, 0) > 1)
166 return _column;
167 return _scalar;
168 case 2:
169 if (PyArray_DIM(array, 0) > 1) {
170 if (PyArray_DIM(array, 1) == 1)
171 return _column;
172 else
173 return _matrix;
174 }
175 if (PyArray_DIM(array, 1) == 1)
176 return _scalar;
177 return _row;
178 }
179 return _matrix;
180}
181
182
183/*

Callers 1

cblas_matrixproductFunction · 0.85

Calls 2

PyArray_NDIMFunction · 0.85
PyArray_DIMFunction · 0.85

Tested by

no test coverage detected