Skip to content

Commit cef367b

Browse files
committed
Test refactoring: complex batches
1 parent 9e7d63d commit cef367b

File tree

4 files changed

+611
-0
lines changed

4 files changed

+611
-0
lines changed

include/xsimd/types/xsimd_complex_base.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ namespace xsimd
212212
real_batch m_imag;
213213
};
214214

215+
template <class X>
216+
X operator+(const simd_complex_batch<X>& rhs);
217+
215218
template <class X>
216219
X operator-(const simd_complex_batch<X>& rhs);
217220

@@ -877,6 +880,20 @@ namespace xsimd
877880
* @defgroup simd_complex_batch_arithmetic Arithmetic operators
878881
*/
879882

883+
/**
884+
* @ingroup simd_complex_batch_arithmetic
885+
*
886+
* No-op on \c rhs.
887+
* @tparam X the actual type of batch.
888+
* @param rhs batch involved in the operation.
889+
* @return the opposite of \c rhs.
890+
*/
891+
template <class X>
892+
inline X operator+(const simd_complex_batch<X>& rhs)
893+
{
894+
return rhs();
895+
}
896+
880897
/**
881898
* @ingroup simd_complex_batch_arithmetic
882899
*

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ set(XSIMD_TESTS
145145
test_basic_math.cpp
146146
test_batch.cpp
147147
test_batch_bool.cpp
148+
test_batch_complex.cpp
148149
test_batch_float.cpp
149150
test_batch_int.cpp
150151
test_error_gamma.cpp

0 commit comments

Comments
 (0)