1 #include<DD-AVX_internal.hpp>
3 using namespace ddavx_core;
11 if(size() != vec1.
size() || size() != vec2.
size()){
12 std::cerr <<
"error bad vector size" << std::endl;
17 #pragma omp parallel private(regs)
20 get_isie(size(), is, ie);
21 for(i = is; i < (ie-SIMD_Length+1); i += SIMD_Length){
22 reg a_hi = load(data()[i]);
24 reg b_hi = load(vec1.
hi[i]);
25 reg b_lo = load(vec1.
lo[i]);
27 reg c_hi = load(vec2.
hi[i]);
28 reg c_lo = load(vec2.
lo[i]);
30 Add(a_hi, b_hi, b_lo, c_hi, c_lo, regs);
32 store(data()[i], a_hi);
35 Add(data()[i], vec1.
hi[i], vec1.
lo[i], vec2.
hi[i], vec2.
lo[i]);
42 if(size() != vec1.size() || size() != vec2.
size()){
43 std::cerr <<
"error bad vector size" << std::endl;
49 #pragma omp parallel private(regs)
52 get_isie(size(), is, ie);
53 for(i = is; i < (ie-SIMD_Length+1); i += SIMD_Length){
54 reg a_hi = load(data()[i]);
56 reg b_hi = load(vec1.data()[i]);
57 reg b_lo = regs.zeros;
59 reg c_hi = load(vec2.
hi[i]);
60 reg c_lo = load(vec2.
lo[i]);
62 Add(a_hi, b_hi, b_lo, c_hi, c_lo, regs);
64 store(data()[i], a_hi);
67 Add(data()[i], vec1.data()[i], 0.0, vec2.
hi[i], vec2.
lo[i]);
79 if(size() != vec1.size() || size() != vec2.size()){
80 std::cerr <<
"error bad vector size" << std::endl;
84 #pragma omp parallel for
85 for(
int i = 0; i < size(); i++){
86 data()[i] = vec1.data()[i] + vec2.data()[i];
Double precision vector class, This class is almost same as std::vector<double>
d_real_vector operator+=(dd_real_vector &vec)
all elemetnt arithmetic function
d_real_vector operator+(dd_real_vector &vec)
all elemetnt arithmetic function
void add(dd_real_vector &vec1, dd_real_vector &vec2)
all elemetnt arithmetic function
Double-double precision vector class.