mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
finally directly calling the low-level products is faster
This commit is contained in:
@@ -245,5 +245,15 @@ inline void ei_palign(PacketType& first, const PacketType& second)
|
||||
ei_palign_impl<Offset,PacketType>::run(first,second);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* Fast complex products (GCC generates a function call which is very slow)
|
||||
***************************************************************************/
|
||||
|
||||
template<> inline std::complex<float> ei_pmul(const std::complex<float>& a, const std::complex<float>& b)
|
||||
{ return std::complex<float>(ei_real(a)*ei_real(b) - ei_imag(a)*ei_imag(b), ei_imag(a)*ei_real(b) + ei_real(a)*ei_imag(b)); }
|
||||
|
||||
template<> inline std::complex<double> ei_pmul(const std::complex<double>& a, const std::complex<double>& b)
|
||||
{ return std::complex<double>(ei_real(a)*ei_real(b) - ei_imag(a)*ei_imag(b), ei_imag(a)*ei_real(b) + ei_real(a)*ei_imag(b)); }
|
||||
|
||||
#endif // EIGEN_GENERIC_PACKET_MATH_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user