|
|
Go to the documentation of this file. 1 #ifndef DataFormat_Math_ExtVec_H
2 #define DataFormat_Math_ExtVec_H
7 #define VECTOR_EXT(N) __attribute__((ext_vector_type(N)))
9 #define VECTOR_EXT(N) __attribute__((vector_size(N)))
19 typedef
long double VECTOR_EXT(32) cms_float128x2_t;
20 typedef
long double VECTOR_EXT(64) cms_float128x4_t;
21 typedef
long double VECTOR_EXT(128) cms_float128x8_t;
60 template <
typename T,
int N>
69 inline auto xy(
V v) ->
Vec2<
typename std::remove_reference<decltype(
v[0])>
::type> {
70 typedef typename std::remove_reference<decltype(
v[0])>
::type T;
75 inline auto zw(
V v) ->
Vec2<
typename std::remove_reference<decltype(
v[0])>
::type> {
76 typedef typename std::remove_reference<decltype(
v[0])>
::type T;
80 template <
typename Vec,
typename F>
82 typedef typename std::remove_reference<decltype(
v[0])>
::type T;
83 constexpr
int N =
sizeof(Vec) /
sizeof(
T);
85 for (
int i = 0;
i !=
N; ++
i)
90 template <
typename Vec>
94 Vec x1200{
x[1],
x[2],
x[0],
x[0]};
95 Vec y2010{
y[2],
y[0],
y[1],
y[0]};
96 Vec x2010{
x[2],
x[0],
x[1],
x[0]};
97 Vec y1200{
y[1],
y[2],
y[0],
y[0]};
98 return x1200 * y2010 - x2010 * y1200;
101 template <
typename V1,
typename V2>
102 inline auto cross2(V1
x, V2
y) ->
typename std::remove_reference<decltype(
x[0])>
::type {
103 return x[0] *
y[1] -
x[1] *
y[0];
132 template <
typename V>
133 inline auto dot(
V x,
V y) ->
typename std::remove_reference<decltype(
x[0])>
::type {
134 typedef typename std::remove_reference<decltype(
x[0])>
::type T;
135 constexpr
int N =
sizeof(
V) /
sizeof(
T);
137 for (
int i = 0;
i !=
N; ++
i)
142 template <
typename V1,
typename V2>
143 inline auto dot2(V1
x, V2
y) ->
typename std::remove_reference<decltype(
x[0])>
::type {
144 typedef typename std::remove_reference<decltype(
x[0])>
::type T;
146 for (
int i = 0;
i != 2; ++
i)
168 template <
typename V>
173 template <
typename V>
180 template <
typename T>
185 constexpr
Rot3() :
axis{{(
Vec){
T(1), 0, 0, 0}}, {(
Vec){0,
T(1), 0, 0}}, {(
Vec){0, 0,
T(1), 0}}} {}
190 :
axis{{(
Vec){
xx,
xy,
xz, 0}}, {(
Vec){yx,
yy,
yz, 0}}, {(
Vec){zx, zy,
zz, 0}}} {}
221 template <
typename T>
223 return lh.rotateBack(rh);
226 template <
typename T>
260 template <
typename T>
262 return lh.rotateBack(rh);
282 return out <<
'(' <<
v[0] <<
", " <<
v[1] <<
", " <<
v[2] <<
", " <<
v[3] <<
')';
285 return out <<
'(' <<
v[0] <<
", " <<
v[1] <<
", " <<
v[2] <<
", " <<
v[3] <<
')';
291 return out <<
'(' <<
v.v[0] <<
", " <<
v.v[1] <<
", " <<
v.v[2] <<
')';
295 return out <<
'(' <<
v.v[0] <<
", " <<
v.v[1] <<
", " <<
v.v[2] <<
')';
ret
prodAgent to be discontinued
cudaStream_t T uint32_t const T *__restrict__ const uint32_t *__restrict__ uint32_t int cudaStream_t V
constexpr Rot2(Vec2< T > ix, Vec2< T > iy)
auto dot(V x, V y) -> typename std::remove_reference< decltype(x[0])>::type
constexpr Rot2 rotateBack(Rot2 const &r) const
constexpr Rot2(T xx, T xy, T yx, T yy)
std::ostream & operator<<(std::ostream &out, Vec2D const &v)
constexpr Rot3 rotateBack(Rot3 const &r) const
constexpr Vec2< T > x() const
constexpr Rot3< T > operator*(Rot3< T > const &rh, Rot3< T > const &lh)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
constexpr Vec2< T > rotate(Vec2< T > v) const
constexpr Vec4< T > rotate(Vec4< T > v) const
typename ExtVecTraits< T, N >::type ExtVec
Rot3 rotate(Rot3 const &r) const
constexpr Rot2 transpose() const
constexpr Vec4< T > y() const
constexpr Vec4< T > z() const
def template(fileName, svg, replaceme="REPLACEME")
constexpr Rot3(T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz)
constexpr Rot3(Vec4< T > ix, Vec4< T > iy, Vec4< T > iz)
As3D< V > as3D(V const &v)
Rot2 rotate(Rot2 const &r) const
constexpr Vec4< T > rotateBack(Vec4< T > v) const
auto dot2(V1 x, V2 y) -> typename std::remove_reference< decltype(x[0])>::type
constexpr Vec4< T > x() const
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
constexpr Vec2< T > y() const
constexpr Vec2< T > rotateBack(Vec2< T > v) const
auto xy(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
auto cross2(V1 x, V2 y) -> typename std::remove_reference< decltype(x[0])>::type
constexpr Rot3 transpose() const