def _set_c_array_from_matrix(self, array, shape, values): if not (shape == values.shape): raise ValueError("array and matrix must have same shape") rows, cols = shape for i in range(rows): for j in range(cols): _trackcpp.c_array_set(array, i*cols + j, values[i, j])
def _set_c_array_from_vector(self, array, size, values): if not (size == len(values)): raise ValueError("array and vector must have same size") for i in range(size): _trackcpp.c_array_set(array, i, values[i])