forked from cms-sw/cmssw
/
crossV4_t.cpp
39 lines (31 loc) · 1.17 KB
/
crossV4_t.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include "DataFormats/Math/interface/SSEVec.h"
int main() {
{
mathSSE::Vec4<float> yAxis(-0.0144846,0.932024,-0.362108);
mathSSE::Vec4<float> zAxis(-0.204951,0.351689,0.913406);
auto xAxis = ::cross(yAxis,zAxis);
const mathSSE::Vec4<float> correctXAxis(0.978666,0.0874447,0.185925);
std::cout <<" x axis "<<xAxis<<std::endl;
if ( abs(xAxis.o.theX-correctXAxis.o.theX )> 0.000001 or
abs(xAxis.o.theY-correctXAxis.o.theY) > 0.000001 or
abs(xAxis.o.theZ-correctXAxis.o.theZ) > 0.000001) {
std::cout <<"BAD since not same as "<<correctXAxis<<std::endl;
return 1;
}
}
{
mathSSE::Vec4<double> yAxis(-0.0144846,0.932024,-0.362108);
mathSSE::Vec4<double> zAxis(-0.204951,0.351689,0.913406);
auto xAxis = ::cross(yAxis,zAxis);
const mathSSE::Vec4<float> correctXAxis(0.978666,0.0874447,0.185925);
std::cout <<" x axis "<<xAxis<<std::endl;
if ( abs(xAxis.o.theX-correctXAxis.o.theX )> 0.000001 or
abs(xAxis.o.theY-correctXAxis.o.theY) > 0.000001 or
abs(xAxis.o.theZ-correctXAxis.o.theZ) > 0.000001) {
std::cout <<"BAD since not same as "<<correctXAxis<<std::endl;
return 1;
}
}
return 0;
}