예제 #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])
예제 #2
0
파일: elements.py 프로젝트: dtbinh/code
 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])
예제 #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])
예제 #4
0
파일: elements.py 프로젝트: dtbinh/code
 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])