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 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)
 
void CheckMatrices (const arma::cube &a, const arma::cube &b, double tolerance=1e-5)
 
void CheckMatricesNotEqual (const arma::mat &a, const arma::mat &b, double tolerance=1e-5)
 
void CheckMatricesNotEqual (const arma::Mat< size_t > &a, const arma::Mat< size_t > &b)
 
void CheckMatricesNotEqual (const arma::cube &a, const arma::cube &b, double tolerance=1e-5)
 
std::string FilterFileName (const std::string &inputString)
 

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

◆ REQUIRE_RELATIVE_ERR

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

Definition at line 20 of file test_tools.hpp.

Function Documentation

◆ CheckMatrices() [1/3]

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

Definition at line 24 of file test_tools.hpp.

◆ CheckMatrices() [2/3]

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

Definition at line 41 of file test_tools.hpp.

◆ CheckMatrices() [3/3]

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

Definition at line 52 of file test_tools.hpp.

◆ CheckMatricesNotEqual() [1/3]

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

Definition at line 70 of file test_tools.hpp.

◆ CheckMatricesNotEqual() [2/3]

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

Definition at line 102 of file test_tools.hpp.

◆ CheckMatricesNotEqual() [3/3]

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

Definition at line 127 of file test_tools.hpp.

◆ FilterFileName()

std::string FilterFileName ( const std::string &  inputString)
inline

Definition at line 160 of file test_tools.hpp.