2020def _c_result (raw_bytes , shape ):
2121 data = _array_mod .array (_DOUBLE )
2222 _frombytes (data , raw_bytes )
23- return GFOArray ._from_raw (data , shape )
23+ return _CGFOArray ._from_raw (data , shape )
2424
2525
2626class _CGFOArray (GFOArray ):
@@ -31,6 +31,7 @@ def __add__(self, other):
3131 isinstance (other , GFOArray )
3232 and isinstance (self ._data , _array_mod .array )
3333 and isinstance (other ._data , _array_mod .array )
34+ and len (self ._data ) == len (other ._data )
3435 ):
3536 return _c_result (_fast_ops .vec_add (self ._data , other ._data ), self ._shape )
3637 if isinstance (other , int | float ) and isinstance (self ._data , _array_mod .array ):
@@ -48,6 +49,7 @@ def __sub__(self, other):
4849 isinstance (other , GFOArray )
4950 and isinstance (self ._data , _array_mod .array )
5051 and isinstance (other ._data , _array_mod .array )
52+ and len (self ._data ) == len (other ._data )
5153 ):
5254 return _c_result (_fast_ops .vec_sub (self ._data , other ._data ), self ._shape )
5355 if isinstance (other , int | float ) and isinstance (self ._data , _array_mod .array ):
@@ -62,6 +64,7 @@ def __mul__(self, other):
6264 isinstance (other , GFOArray )
6365 and isinstance (self ._data , _array_mod .array )
6466 and isinstance (other ._data , _array_mod .array )
67+ and len (self ._data ) == len (other ._data )
6568 ):
6669 return _c_result (_fast_ops .vec_mul (self ._data , other ._data ), self ._shape )
6770 if isinstance (other , int | float ) and isinstance (self ._data , _array_mod .array ):
0 commit comments