DD-AVX  2.0.0
vector_comparison.cpp
Go to the documentation of this file.
1 #include<DD-AVX_internal.hpp>
2 //Double
3 //==
5  bool ret = (size() == vec.size());
6  if(ret == false) return false;
7 
8  ret = ret && std::equal(vec.hi.cbegin(), vec.hi.cend(), cbegin());
9  return ret;
10 }
11 
13  bool ret = (size() == vec.size());
14  if(ret == false) return false;
15 
16  ret = ret && std::equal(vec.cbegin(), vec.cend(), cbegin());
17  return ret;
18 }
19 
20 bool d_real_vector::operator==(const std::vector<double>& vec){
21  bool ret = (size() == vec.size());
22  if(ret == false) return false;
23 
24  ret = ret && std::equal(vec.cbegin(), vec.cend(), cbegin());
25  return ret;
26 }
27 
28 bool d_real_vector::operator==(const std::vector<dd_real>& vec){
29  bool ret = (size() == vec.size());
30  if(ret == false) return false;
31 
32 // #pragma omp parallel for
33  for(int i=0; i < vec.size(); i++){
34  ret = ret && at(i) == vec[i].x[0];
35  if(ret == false) return ret;
36  }
37 
38  return ret;
39 }
40 
43  bool ret = (*this == vec);
44  return !ret;
45 }
46 
48  bool ret = (*this == vec);
49  return !ret;
50 }
51 
52 bool d_real_vector::operator!=(const std::vector<double>& vec){
53  bool ret = (*this == vec);
54  return !ret;
55 }
56 
57 bool d_real_vector::operator!=(const std::vector<dd_real>& vec){
58  bool ret = (*this == vec);
59  return !ret;
60 }
61 
62 //DD
63 //==
65  bool ret = (size() == vec.size());
66  if(ret == false) return false;
67 
68  ret = ret && std::equal(vec.hi.cbegin(), vec.hi.cend(), hi.cbegin());
69  ret = ret && std::equal(vec.lo.cbegin(), vec.lo.cend(), lo.cbegin());
70  return ret;
71 }
72 
74  bool ret = (size() == vec.size());
75  if(ret == false) return false;
76 
77  ret = ret && std::equal(vec.cbegin(), vec.cend(), hi.cbegin());
78  return ret;
79 }
80 
81 bool dd_real_vector::operator==(const std::vector<double>& vec){
82  bool ret = (size() == vec.size());
83  if(ret == false) return false;
84 
85  ret = ret && std::equal(vec.cbegin(), vec.cend(), hi.cbegin());
86  return ret;
87 }
88 
89 bool dd_real_vector::operator==(const std::vector<dd_real>& vec){
90  bool ret = (size() == vec.size());
91  if(ret == false) return false;
92 
93 // #pragma omp parallel for
94  for(int i=0; i < vec.size(); i++){
95  ret = ret && hi[i] == vec[i].x[0] && lo[i] == vec[i].x[1];
96  if(ret == false) return ret;
97  }
98 
99  return ret;
100 }
103  bool ret = (*this == vec);
104  return !ret;
105 }
106 
108  bool ret = (*this == vec);
109  return !ret;
110 }
111 
112 bool dd_real_vector::operator!=(const std::vector<double>& vec){
113  bool ret = (*this == vec);
114  return !ret;
115 }
116 
117 bool dd_real_vector::operator!=(const std::vector<dd_real>& vec){
118  bool ret = (*this == vec);
119  return !ret;
120 }
Double precision vector class, This class is almost same as std::vector<double>
bool operator==(const dd_real_vector &vec)
comparision
bool operator!=(const dd_real_vector &vec)
comparision
Double-double precision vector class.
std::vector< double > lo
bool operator!=(const dd_real_vector &vec)
comparision function
int size() const
get size
std::vector< double > hi
bool operator==(const dd_real_vector &vec)
comparision function