Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
Eigen  3.4.0
 
Loading...
Searching...
No Matches
arch/AltiVec/MathFunctions.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2007 Julien Pommier
5// Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
6// Copyright (C) 2016 Konstantinos Margaritis <markos@freevec.org>
7//
8// This Source Code Form is subject to the terms of the Mozilla
9// Public License v. 2.0. If a copy of the MPL was not distributed
10// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
12#ifndef EIGEN_MATH_FUNCTIONS_ALTIVEC_H
13#define EIGEN_MATH_FUNCTIONS_ALTIVEC_H
14
15namespace Eigen {
16
17namespace internal {
18
19template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
20Packet4f plog<Packet4f>(const Packet4f& _x)
21{
22 return plog_float(_x);
23}
24
25template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
26Packet4f pexp<Packet4f>(const Packet4f& _x)
27{
28 return pexp_float(_x);
29}
30
31template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
32Packet4f psin<Packet4f>(const Packet4f& _x)
33{
34 return psin_float(_x);
35}
36
37template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
38Packet4f pcos<Packet4f>(const Packet4f& _x)
39{
40 return pcos_float(_x);
41}
42
43#ifndef EIGEN_COMP_CLANG
44template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
45Packet4f prsqrt<Packet4f>(const Packet4f& x)
46{
47 return vec_rsqrt(x);
48}
49#endif
50
51#ifdef __VSX__
52#ifndef EIGEN_COMP_CLANG
53template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
54Packet2d prsqrt<Packet2d>(const Packet2d& x)
55{
56 return vec_rsqrt(x);
57}
58#endif
59
60template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
61Packet4f psqrt<Packet4f>(const Packet4f& x)
62{
63 return vec_sqrt(x);
64}
65
66template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
67Packet2d psqrt<Packet2d>(const Packet2d& x)
68{
69 return vec_sqrt(x);
70}
71
72template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED
73Packet2d pexp<Packet2d>(const Packet2d& _x)
74{
75 return pexp_double(_x);
76}
77#endif
78
79// Hyperbolic Tangent function.
80template <>
81EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f
82ptanh<Packet4f>(const Packet4f& x) {
83 return internal::generic_fast_tanh_float(x);
84}
85
86} // end namespace internal
87
88} // end namespace Eigen
89
90#endif // EIGEN_MATH_FUNCTIONS_ALTIVEC_H
Namespace containing all symbols from the Eigen library.
Definition: Core:141