diff --git a/stim/math/vec3.h b/stim/math/vec3.h index 1a52ea0..533075c 100644 --- a/stim/math/vec3.h +++ b/stim/math/vec3.h @@ -312,6 +312,19 @@ std::string str() const{ return result; } + + /// @param rhs is the right-hand-side operator for the addition + CUDA_CALLABLE cvec3 operator+(cvec3 rhs) const { + return vec3< std::complex >::operator+(rhs); + } + /// @param rhs is the right-hand-side operator for adding a real vector to a complex vector + CUDA_CALLABLE cvec3 operator+(vec3 rhs) const { + cvec3 result; + result.ptr[0] = vec3< std::complex >::ptr[0] + rhs[0]; + result.ptr[1] = vec3< std::complex >::ptr[1] + rhs[1]; + result.ptr[2] = vec3< std::complex >::ptr[2] + rhs[2]; + return result; + } }; //end class cvec3 } //end namespace tira -- libgit2 0.21.4