
![]() | Check the length of a specified dimension:
#define DIMCHECK(a, dim, expected_length) \
if (a->dimensions[dim] != expected_length) { \
PyErr_Format(PyExc_ValueError, \
"%s array has wrong %d-dimension=%d (expected %d)", \
QUOTE(a),dim,a->dimensions[dim],expected_length); \
return NULL; \
}
|