Commit b260181cee8c5e6692689848ab0bec3404b985ba
Exists in
master
and in
79 other branches
Merge branch 'master' of https://gitlab.irap.omp.eu/CDPP/AMDA_Kernel
Showing
2 changed files
with
8 additions
and
47 deletions
Show diff stats
src/ExternLib/vector_/vector_.cc
1 | -/** | |
2 | - * | |
3 | - * | |
4 | - * Created on: 31 aug. 2020 | |
5 | - * Author: AKKA IS | |
6 | - */ | |
7 | - | |
8 | 1 | #include "vector_.hh" |
9 | 2 | |
10 | -#include <cmath> | |
11 | - | |
12 | - | |
13 | -template <typename Type> | |
14 | -std::vector<Type> _vector(const Type& comp1, const Type& comp2, const Type& comp3) { | |
15 | - std::vector<Type> vec; | |
16 | - vec.push_back(comp1); | |
17 | - vec.push_back(comp2); | |
18 | - vec.push_back(comp3); | |
19 | - return vec; | |
20 | -} | |
21 | - | |
22 | -std::vector<int> vector_(const int& comp1, const int& comp2, const int& comp3) { | |
23 | - return _vector(comp1, comp2, comp3); | |
24 | -} | |
25 | - | |
26 | -std::vector<double> vector_(const double& comp1, const double& comp2, const double& comp3) { | |
27 | - return _vector(comp1, comp2, comp3); | |
28 | -} | |
29 | - | |
30 | -std::vector<long double> vector_(const long double& comp1, const long double& comp2, const long double& comp3) { | |
31 | - return _vector(comp1, comp2, comp3); | |
32 | -} | |
33 | - | |
34 | -std::vector<short> vector_(const short& comp1, const short& comp2, const short& comp3) { | |
35 | - return _vector(comp1, comp2, comp3); | |
36 | -} | |
37 | - | |
38 | -std::vector<float> vector_(const float& comp1, const float& comp2, const float& comp3) { | |
39 | - return _vector(comp1, comp2, comp3); | |
40 | -} | ... | ... |
src/ExternLib/vector_/vector_.hh
... | ... | @@ -10,14 +10,13 @@ |
10 | 10 | |
11 | 11 | #include <vector> |
12 | 12 | |
13 | -std::vector<int> vector_(const int& comp1, const int& comp2, const int& comp3); | |
14 | - | |
15 | -std::vector<double> vector_(const double& comp1, const double& comp2, const double& comp3); | |
16 | - | |
17 | -std::vector<long double> vector_(const long double& comp1, const long double& comp2, const long double& comp3); | |
18 | - | |
19 | -std::vector<short> vector_(const short& comp1, const short& comp2, const short& comp3); | |
20 | - | |
21 | -std::vector<float> vector_(const float& comp1, const float& comp2, const float& comp3); | |
13 | +template <typename Type1, typename Type2, typename Type3> | |
14 | +std::vector<Type1> vector_(const Type1& comp1, const Type2& comp2, const Type3& comp3) { | |
15 | + std::vector<Type1> vec; | |
16 | + vec.push_back(comp1); | |
17 | + vec.push_back((Type1)comp2); | |
18 | + vec.push_back((Type1)comp3); | |
19 | + return vec; | |
20 | +} | |
22 | 21 | |
23 | 22 | #endif /* VECTOR_HH_ */ | ... | ... |