Ejemplo n.º 1
0
 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])
Ejemplo n.º 2
0
 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])
Ejemplo n.º 3
0
 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])
Ejemplo n.º 4
0
 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])