Commit 677cc39b2d4fa46a88bb76b0868d2f2822293691
1 parent
b00e7329
Exists in
master
and in
85 other branches
removing plugin Magnitude
Showing
7 changed files
with
8 additions
and
90 deletions
Show diff stats
CMakeLists.txt
... | ... | @@ -144,7 +144,6 @@ add_subdirectory(src/ParamGetImpl/LocalFileInterface) |
144 | 144 | add_subdirectory(src/ParamGetImpl/ConstantInterface) |
145 | 145 | add_subdirectory(src/InternLib) |
146 | 146 | add_subdirectory(src/ExternLib/Deriv) |
147 | -add_subdirectory(src/ExternLib/Magnitude) | |
148 | 147 | add_subdirectory(src/ExternLib/Morschhauser) |
149 | 148 | add_subdirectory(src/ExternLib/Ram_Presure) |
150 | 149 | add_subdirectory(src/ExternLib/TimeShifted) | ... | ... |
src/ExternLib/Magnitude/CMakeLists.txt deleted
... | ... | @@ -1,23 +0,0 @@ |
1 | - | |
2 | -PROJECT(Magnitude) | |
3 | - | |
4 | -set(LIBRARY_OUTPUT_PATH ${PLUGIN_OUTPUT_PATH}/magnitude) | |
5 | - | |
6 | -include_directories( | |
7 | -) | |
8 | - | |
9 | -#Library configuration | |
10 | -file( | |
11 | - GLOB_RECURSE | |
12 | - source_files | |
13 | - ./* | |
14 | -) | |
15 | - | |
16 | -ADD_LIBRARY( Magnitude SHARED ${source_files} ) | |
17 | - | |
18 | -target_link_libraries( | |
19 | - Magnitude | |
20 | -) | |
21 | - | |
22 | -FILE( GLOB_RECURSE PROJ_HEADERS *.hh ) | |
23 | -INSTALL(FILES ${PROJ_HEADERS} DESTINATION ${LIBRARY_OUTPUT_PATH} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) |
src/ExternLib/Magnitude/magnitude.cc deleted
... | ... | @@ -1,35 +0,0 @@ |
1 | -/** | |
2 | - * Magnitude.cc | |
3 | - * | |
4 | - * Created on: 31 oct. 2012 | |
5 | - * Author: AKKA IS | |
6 | - */ | |
7 | - | |
8 | -#include "magnitude.hh" | |
9 | - | |
10 | -#include <math.h> | |
11 | - | |
12 | -float magnitude(const std::vector<float>& vec) | |
13 | -{ | |
14 | - return sqrtf(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]); | |
15 | -} | |
16 | - | |
17 | -double magnitude(const std::vector<double>& vec) | |
18 | -{ | |
19 | - return sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]); | |
20 | -} | |
21 | - | |
22 | -long double magnitude(const std::vector<long double>& vec) | |
23 | -{ | |
24 | - return sqrtl(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]); | |
25 | -} | |
26 | - | |
27 | -int magnitude(const std::vector<int>& vec) | |
28 | -{ | |
29 | - return sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]); | |
30 | -} | |
31 | - | |
32 | -short magnitude(const std::vector<short>& vec) | |
33 | -{ | |
34 | - return sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]); | |
35 | -} |
src/ExternLib/Magnitude/magnitude.hh deleted
... | ... | @@ -1,23 +0,0 @@ |
1 | -/** | |
2 | - * Magnitude.hh | |
3 | - * | |
4 | - * Created on: 31 oct. 2012 | |
5 | - * Author: AKKA IS | |
6 | - */ | |
7 | - | |
8 | -#ifndef MAGNITUDE_HH_ | |
9 | -#define MAGNITUDE_HH_ | |
10 | - | |
11 | -#include <vector> | |
12 | - | |
13 | -/** | |
14 | - * @bried Compute the magnitude of el | |
15 | - * @return sqrtf(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]); | |
16 | - */ | |
17 | -float magnitude(const std::vector<float>& el); | |
18 | - | |
19 | -double magnitude(const std::vector<double>& vec); | |
20 | - | |
21 | -int magnitude(const std::vector<int>& vec); | |
22 | - | |
23 | -#endif /* MAGNITUDE_HH_ */ |
src/Parameters/DataTypeMath.hh
... | ... | @@ -279,19 +279,19 @@ Type1 dot(std::vector<Type1> a, std::vector<Type2> b) { |
279 | 279 | } |
280 | 280 | |
281 | 281 | template <typename Type> |
282 | -Type magnitude_(std::vector<Type> a) { | |
283 | - Type magnitude = 0; | |
282 | +Type magnitude(std::vector<Type> a) { | |
283 | + Type mag = 0; | |
284 | 284 | for (unsigned int i = 0; i < a.size(); ++i) |
285 | - magnitude += a[i]*a[i]; | |
286 | - return std::sqrt(magnitude); | |
285 | + mag += a[i]*a[i]; | |
286 | + return std::sqrt(mag); | |
287 | 287 | } |
288 | 288 | |
289 | 289 | template <typename Type1, typename Type2> |
290 | 290 | Type1 angle(std::vector<Type1> a, std::vector<Type2> b) { |
291 | - if(magnitude_(a) ==0 || magnitude_(b) == 0){ | |
291 | + if(magnitude(a) ==0 || magnitude(b) == 0){ | |
292 | 292 | BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_OPER_NOT_ALLOWED) << AMDA::ex_msg("One of the two vectors is NULL")); |
293 | 293 | } |
294 | - return std::acos(dot(a,b)/magnitude_(a)/magnitude_(b)); | |
294 | + return std::acos(dot(a,b)/magnitude(a)/magnitude(b)); | |
295 | 295 | } |
296 | 296 | |
297 | 297 | /** | ... | ... |
test/FitNesseRoot/ReleaseS/SecondPart/ReLease1/SprinT2/UserStory43/.txt
test/data/functions.xml
... | ... | @@ -100,7 +100,7 @@ |
100 | 100 | |
101 | 101 | <function name="magnitude_(,)" args="2" kind="vectors"> |
102 | 102 | <info_brief>magnitude of a vector</info_brief> |
103 | - <new_kernel>magnitude_</new_kernel> | |
103 | + <new_kernel>magnitude</new_kernel> | |
104 | 104 | </function> |
105 | 105 | |
106 | 106 | <function name="dot(,)" args="2" kind="vectors"> | ... | ... |