Commit 715dc550c752871bd32bc98394226fcad599ef32

Authored by Benjamin Renard
2 parents 4a88c8f9 4200776e

Merge branch 'FER_11537' into amdadev

CMakeLists.txt
... ... @@ -184,6 +184,7 @@ add_subdirectory(src/ExternLib/Shue)
184 184 add_subdirectory(src/ExternLib/StatisticFunctions)
185 185 add_subdirectory(src/ExternLib/Fix)
186 186 add_subdirectory(src/ExternLib/Ceil)
  187 +add_subdirectory(src/ExternLib/IsNaN)
187 188 add_subdirectory(src/ExternLib/Floor)
188 189 add_subdirectory(src/ExternLib/Sign)
189 190 add_subdirectory(src/ExternLib/ttcat_to_param)
... ...
src/ExternLib/IsNaN/CMakeLists.txt 0 → 100644
... ... @@ -0,0 +1,23 @@
  1 +
  2 +PROJECT(IsNaN)
  3 +
  4 +set(LIBRARY_OUTPUT_PATH ${PLUGIN_OUTPUT_PATH}/IsNaN)
  5 +
  6 +include_directories(
  7 +)
  8 +
  9 +#Library configuration
  10 +file(
  11 + GLOB_RECURSE
  12 + source_files
  13 + ./*
  14 +)
  15 +
  16 +ADD_LIBRARY( IsNaN SHARED ${source_files} )
  17 +
  18 +target_link_libraries(
  19 + IsNaN
  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/IsNaN/IsNaN.hh 0 → 100644
... ... @@ -0,0 +1,36 @@
  1 +/**
  2 + *
  3 + * Created on: 18 jun. 2024
  4 + * Author: AKKODIS - Furkan
  5 + */
  6 +
  7 +
  8 +#ifndef ISNAN_HH_
  9 +#define ISNAN_HH_
  10 +
  11 +#include <vector>
  12 +
  13 +/**
  14 + * @bried Checks if el is a NaN
  15 + */
  16 +int IsNaN(const float& el);
  17 +
  18 +int IsNaN(const double& el);
  19 +
  20 +int IsNaN(const long double& el);
  21 +
  22 +int IsNaN(const int& el);
  23 +
  24 +int IsNaN(const short& el);
  25 +
  26 +std::vector<int> IsNaN(const std::vector<float>& el);
  27 +
  28 +std::vector<int> IsNaN(const std::vector<double>& el);
  29 +
  30 +std::vector<int> IsNaN(const std::vector<long double>& el);
  31 +
  32 +std::vector<int> IsNaN(const std::vector<int>& el);
  33 +
  34 +std::vector<int> IsNaN(const std::vector<short>& el);
  35 +
  36 +#endif /* ISNAN_HH_ */
... ...
src/ExternLib/IsNaN/IsNan.cc 0 → 100644
... ... @@ -0,0 +1,66 @@
  1 +/**
  2 + *
  3 + *
  4 + * Created on: 18 jun. 2024
  5 + * Author: AKKODIS - Furkan
  6 + */
  7 +
  8 +#include "IsNaN.hh"
  9 +
  10 +#include <cmath>
  11 +
  12 +
  13 +template <typename Type>
  14 +int _isNaN(const Type& el) {
  15 + double dEl = (double)el;
  16 + return (int)std::isnan(dEl);
  17 +}
  18 +
  19 +template <typename Type>
  20 +std::vector<int> _isNaN(const std::vector<Type>& el) {
  21 + std::vector<int> result;
  22 + for (typename std::vector<Type>::const_iterator it = el.begin(); it != el.end(); ++it) {
  23 + result.push_back(_isNaN(*it));
  24 + }
  25 + return result;
  26 +}
  27 +
  28 +int IsNaN(const float& el) {
  29 + return _isNaN(el);
  30 +}
  31 +
  32 +int IsNaN(const double& el) {
  33 + return _isNaN(el);
  34 +}
  35 +
  36 +int IsNaN(const long double& el) {
  37 + return _isNaN(el);
  38 +}
  39 +
  40 +int IsNaN(const int& el) {
  41 + return _isNaN(el);
  42 +}
  43 +
  44 +int IsNaN(const short& el) {
  45 + return _isNaN(el);
  46 +}
  47 +
  48 +std::vector<int> IsNaN(const std::vector<float>& el) {
  49 + return _isNaN(el);
  50 +}
  51 +
  52 +std::vector<int> IsNaN_(const std::vector<double>& el) {
  53 + return _isNaN(el);
  54 +}
  55 +
  56 +std::vector<int> IsNaN_(const std::vector<long double>& el) {
  57 + return _isNaN(el);
  58 +}
  59 +
  60 +std::vector<int> IsNaN_(const std::vector<int>& el) {
  61 + return _isNaN(el);
  62 +}
  63 +
  64 +std::vector<int> IsNaN_(const std::vector<short>& el) {
  65 + return _isNaN(el);
  66 +}
... ...