norms.cpp
Go to the documentation of this file.
00001 
00009 /*****************************************************************************
00010 ** Includes
00011 *****************************************************************************/
00012 
00013 #include <iostream>
00014 #include <gtest/gtest.h>
00015 #include "../../include/ecl/math/norms.hpp"
00016 
00017 /*****************************************************************************
00018 ** Using
00019 *****************************************************************************/
00020 
00021 using ecl::EuclideanNorm;
00022 using ecl::euclidean_norm;
00023 
00024 /*****************************************************************************
00025 ** Tests
00026 *****************************************************************************/
00027 
00028 TEST(NormTests,euclideanNorm) {
00029         EXPECT_EQ(5,EuclideanNorm()(3,4));
00030 }
00031 
00032 TEST(NormTests,euclideanNormFloats) {
00033         float x = 3.0;
00034         float y = 4.0;
00035         float z = 5.0;
00036         EXPECT_EQ(z,EuclideanNorm()(x,y));
00037 }
00038 
00039 TEST(NormTests,euclideanNormDoubles) {
00040         double x = 3.0;
00041         double y = 4.0;
00042         double z = 5.0;
00043         EXPECT_EQ(z,EuclideanNorm()(x,y));
00044 }
00045 
00046 TEST(NormTests,euclideanNormFunctions) {
00047         double x = 3.0;
00048         double y = 4.0;
00049         double z = 5.0;
00050         EXPECT_EQ(z,euclidean_norm(x,y));
00051         float xf = 3.0;
00052         float yf = 4.0;
00053         float zf = 5.0;
00054         EXPECT_EQ(zf,euclidean_norm(xf,yf));
00055 }
00056 
00057 /*****************************************************************************
00058 ** Main program
00059 *****************************************************************************/
00060 
00061 int main(int argc, char **argv) {
00062         std::cout << "Numeric Limits<float>: " << std::numeric_limits<float>::min() << std::endl;
00063         std::cout << "Numeric Limits<float>: " << std::numeric_limits<float>::max() << std::endl;
00064     testing::InitGoogleTest(&argc,argv);
00065     return RUN_ALL_TESTS();
00066 }
00067 


ecl_math
Author(s): Daniel Stonier
autogenerated on Mon Jul 3 2017 02:21:34