mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
test_tools.hpp File Reference
Include dependency graph for test_tools.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BOOST_REQUIRE_GE(L, R)   BOOST_REQUIRE_EQUAL( (L >= R), true )
 
#define BOOST_REQUIRE_GT(L, R)   BOOST_REQUIRE_EQUAL( (L > R), true )
 
#define BOOST_REQUIRE_LE(L, R)   BOOST_REQUIRE_EQUAL( (L <= R), true )
 
#define BOOST_REQUIRE_LT(L, R)   BOOST_REQUIRE_EQUAL( (L < R), true )
 
#define BOOST_REQUIRE_NE(L, R)   BOOST_REQUIRE_EQUAL( (L != R), true )
 
#define REQUIRE_RELATIVE_ERR(L, R, E)   BOOST_REQUIRE_LE( std::abs((R) - (L)), (E) * std::abs(R))
 

Functions

void CheckMatrices (const arma::mat &a, const arma::mat &b, double tolerance=1e-5)
 
void CheckMatrices (const arma::Mat< size_t > &a, const arma::Mat< size_t > &b)
 

Detailed Description

Author
Ryan Curtin

This file includes some useful macros for tests.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Definition in file test_tools.hpp.

Macro Definition Documentation

#define BOOST_REQUIRE_GE (   L,
 
)    BOOST_REQUIRE_EQUAL( (L >= R), true )

Definition at line 25 of file test_tools.hpp.

#define BOOST_REQUIRE_GT (   L,
 
)    BOOST_REQUIRE_EQUAL( (L > R), true )

Definition at line 37 of file test_tools.hpp.

#define BOOST_REQUIRE_LE (   L,
 
)    BOOST_REQUIRE_EQUAL( (L <= R), true )

Definition at line 31 of file test_tools.hpp.

#define BOOST_REQUIRE_LT (   L,
 
)    BOOST_REQUIRE_EQUAL( (L < R), true )

Definition at line 34 of file test_tools.hpp.

#define BOOST_REQUIRE_NE (   L,
 
)    BOOST_REQUIRE_EQUAL( (L != R), true )

Definition at line 28 of file test_tools.hpp.

#define REQUIRE_RELATIVE_ERR (   L,
  R,
 
)    BOOST_REQUIRE_LE( std::abs((R) - (L)), (E) * std::abs(R))

Definition at line 44 of file test_tools.hpp.

Function Documentation

void CheckMatrices ( const arma::mat &  a,
const arma::mat &  b,
double  tolerance = 1e-5 
)
inline

Definition at line 50 of file test_tools.hpp.

void CheckMatrices ( const arma::Mat< size_t > &  a,
const arma::Mat< size_t > &  b 
)
inline

Definition at line 66 of file test_tools.hpp.