[nncc/foundation] Remove math functions (#2638)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 12 Dec 2018 10:12:46 +0000 (19:12 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 12 Dec 2018 10:12:46 +0000 (19:12 +0900)
These math functions are deprecated by "nike" library.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
libs/foundation/src/math/Float.cpp [deleted file]
libs/foundation/src/math/Float.test.cpp [deleted file]

diff --git a/libs/foundation/src/math/Float.cpp b/libs/foundation/src/math/Float.cpp
deleted file mode 100644 (file)
index 417d113..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "nncc/foundation/math/Float.h"
-
-#include <cmath>
-#include <cfloat>
-#include <algorithm>
-
-namespace nncc
-{
-namespace foundation
-{
-namespace math
-{
-
-bool relative_epsilon_equal(float lhs, float rhs, unsigned tolerance)
-{
-  if (std::isnan(lhs) && std::isnan(rhs))
-  {
-    return true;
-  }
-
-  const auto delta = std::fabs(lhs - rhs);
-  const auto max = std::max(std::fabs(lhs), std::fabs(rhs));
-
-  return delta <= (max * FLT_EPSILON * tolerance);
-}
-
-bool absolute_epsilon_equal(float lhs, float rhs, float tolerance)
-{
-  if (std::isnan(lhs) && std::isnan(rhs))
-  {
-    return true;
-  }
-
-  const auto diff = std::fabs(lhs - rhs);
-
-  return diff <= tolerance;
-}
-
-} // namespace math
-} // namespace foundation
-} // namespace nncc
diff --git a/libs/foundation/src/math/Float.test.cpp b/libs/foundation/src/math/Float.test.cpp
deleted file mode 100644 (file)
index 4cd62a1..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <nncc/foundation/math/Float.h>
-
-#include <cmath>
-
-#include <gtest/gtest.h>
-
-TEST(FOUNDATION_MATH_FLOAT, relative_epsilon_equal_nan_nan)
-{
-  ASSERT_TRUE(nncc::foundation::math::relative_epsilon_equal(NAN, NAN));
-}
-
-TEST(FOUNDATION_MATH_FLOAT, relative_epsilon_equal_num_pos)
-{
-  ASSERT_TRUE(nncc::foundation::math::relative_epsilon_equal(1.0f, 1.0f));
-}
-
-TEST(FOUNDATION_MATH_FLOAT, relative_epsilon_equal_num_neg)
-{
-  ASSERT_FALSE(nncc::foundation::math::relative_epsilon_equal(1.0f, 2.0f));
-}
-
-TEST(FOUNDATION_MATH_FLOAT, relative_epsilon_equal_tolerance_pos)
-{
-  ASSERT_TRUE(nncc::foundation::math::relative_epsilon_equal(1.0f, 1.0f + FLT_EPSILON, 2));
-}
-
-TEST(FOUNDATION_MATH_FLOAT, relative_epsilon_equal_tolerance_neg)
-{
-  ASSERT_FALSE(nncc::foundation::math::relative_epsilon_equal(1.0f, 1.0f + 3 * FLT_EPSILON, 2));
-}
-
-TEST(FOUNDATION_MATH_FLOAT, absolute_epsilon_equal_nan_nan)
-{
-  ASSERT_TRUE(nncc::foundation::math::absolute_epsilon_equal(NAN, NAN));
-}
-
-TEST(FOUNDATION_MATH_FLOAT, absolute_epsilon_equal_num_pos)
-{
-  ASSERT_TRUE(nncc::foundation::math::absolute_epsilon_equal(1.0f, 1.0f));
-}
-
-TEST(FOUNDATION_MATH_FLOAT, absolute_epsilon_equal_num_neg)
-{
-  ASSERT_FALSE(nncc::foundation::math::absolute_epsilon_equal(1.0f, 2.0f, 0.001f));
-}
-
-TEST(FOUNDATION_MATH_FLOAT, absolute_epsilon_equal_tolerance_pos)
-{
-  ASSERT_TRUE(nncc::foundation::math::absolute_epsilon_equal(1.0f, 1.0f + 0.0001f, 0.001f));
-}
-
-TEST(FOUNDATION_MATH_FLOAT, absolute_epsilon_equal_tolerance_neg)
-{
-  ASSERT_FALSE(nncc::foundation::math::absolute_epsilon_equal(1.0f, 1.0f + 0.01f, 0.001f));
-}