Array interface specified by numpy. */
| 75 | |
| 76 | /* Array interface specified by numpy. */ |
| 77 | char const *Matrix_ArrayInterface(Matrix self) { |
| 78 | char const template[] = "{\"data\": [%lu, true], \"shape\": [%lu, %lu], " |
| 79 | "\"typestr\": \"<f4\", \"version\": 3}"; |
| 80 | memset(self->_array_intrerface, '\0', sizeof(self->_array_intrerface)); |
| 81 | sprintf(self->_array_intrerface, template, (size_t)self->data, self->shape[0], |
| 82 | self->shape[1]); |
| 83 | return self->_array_intrerface; |
| 84 | } |
| 85 | |
| 86 | size_t Matrix_NSamples(Matrix self) { return self->shape[0]; } |
| 87 |