Classes | Namespaces | Macros | Functions | Variables
main.h File Reference
#include <cstdlib>
#include <cerrno>
#include <ctime>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <typeinfo>
#include <functional>
#include <limits>
#include <algorithm>
#include <complex>
#include <deque>
#include <queue>
#include <cassert>
#include <list>
#include "split_test_helper.h"
#include <Eigen/QR>
Include dependency graph for main.h:

Go to the source code of this file.

Classes

struct  Eigen::eigen_assert_exception
 
struct  Eigen::eigen_static_assert_exception
 
class  Eigen::EigenTest
 
struct  GetDifferentType< T >
 
struct  GetDifferentType< double >
 
struct  GetDifferentType< float >
 
struct  GetDifferentType< std::complex< T > >
 
struct  imag
 
struct  real
 
class  Eigen::SparseMatrixBase
 Base class of any sparse matrices or sparse expressions. More...
 
class  Eigen::SparseMatrixBase
 Base class of any sparse matrices or sparse expressions. More...
 
class  Eigen::SparseMatrixBase
 Base class of any sparse matrices or sparse expressions. More...
 

Namespaces

 Eigen
 Namespace containing all symbols from the Eigen library.
 

Macros

#define _OVERRIDE_COMPLEX_SPECIALIZATION_   1
 
#define B0   FORBIDDEN_IDENTIFIER
 
#define CALL_SUBTEST(FUNC)
 
#define DEBUG
 
#define DEFAULT_REPEAT   10
 
#define eigen_assert(a)
 
#define EIGEN_CUDA_SDK_VER   0
 
#define EIGEN_DEBUG_SMALL_PRODUCT_BLOCKS
 
#define EIGEN_DECLARE_TEST(X)
 
#define EIGEN_DEFAULT_IO_FORMAT   IOFormat(4, 0, " ", "\n", "", "", "", "")
 
#define EIGEN_INTERNAL_DEBUGGING
 
#define EIGEN_TEST_SCALAR_TEST_OVERLOAD(TYPE)
 
#define EIGEN_USE_CUSTOM_ASSERT
 
#define FORBIDDEN_IDENTIFIER   (this_identifier_is_forbidden_to_avoid_clashes) this_identifier_is_forbidden_to_avoid_clashes
 
#define I   FORBIDDEN_IDENTIFIER
 
#define isfinite(X)   please_protect_your_isfinite_with_parentheses
 
#define isinf(X)   please_protect_your_isinf_with_parentheses
 
#define isnan(X)   please_protect_your_isnan_with_parentheses
 
#define M_PI   please_use_EIGEN_PI_instead_of_M_PI
 
#define max(A, B)   please_protect_your_max_with_parentheses
 
#define min(A, B)   please_protect_your_min_with_parentheses
 
#define STATIC_CHECK(COND)   EIGEN_STATIC_ASSERT( (COND) , EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT )
 
#define TEST_SET_BUT_UNUSED_VARIABLE(X)   EIGEN_UNUSED_VARIABLE(X)
 
#define TRACK   std::cerr << __FILE__ << " " << __LINE__ << std::endl
 
#define VERIFY(a)   ::verify_impl(a, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a))
 
#define VERIFY_GE(a, b)   ::verify_impl(a >= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a >= b))
 
#define VERIFY_IS_APPROX(a, b)   VERIFY(verifyIsApprox(a, b))
 
#define VERIFY_IS_APPROX_OR_LESS_THAN(a, b)   VERIFY(test_isApproxOrLessThan(a, b))
 
#define VERIFY_IS_EQUAL(a, b)   VERIFY(test_is_equal(a, b, true))
 
#define VERIFY_IS_MUCH_SMALLER_THAN(a, b)   VERIFY(test_isMuchSmallerThan(a, b))
 
#define VERIFY_IS_NOT_APPROX(a, b)   VERIFY(!test_isApprox(a, b))
 
#define VERIFY_IS_NOT_APPROX_OR_LESS_THAN(a, b)   VERIFY(!test_isApproxOrLessThan(a, b))
 
#define VERIFY_IS_NOT_EQUAL(a, b)   VERIFY(test_is_equal(a, b, false))
 
#define VERIFY_IS_NOT_MUCH_SMALLER_THAN(a, b)   VERIFY(!test_isMuchSmallerThan(a, b))
 
#define VERIFY_IS_UNITARY(a)   VERIFY(test_isUnitary(a))
 
#define VERIFY_LE(a, b)   ::verify_impl(a <= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a <= b))
 
#define VERIFY_RAISES_ASSERT(a)   std::cout << "Can't VERIFY_RAISES_ASSERT( " #a " ) with exceptions disabled\n";
 
#define VERIFY_RAISES_STATIC_ASSERT(a)   std::cout << "Can't VERIFY_RAISES_STATIC_ASSERT( " #a " ) with exceptions disabled\n";
 

Functions

template<typename MatrixType >
void Eigen::createRandomPIMatrixOfRank (Index desired_rank, Index rows, Index cols, MatrixType &m)
 
template<typename T >
NumTraits< typename T::Scalar >::Real Eigen::get_test_precision (const T &, const typename T::Scalar *=0)
 
template<typename T >
NumTraits< T >::Real Eigen::get_test_precision (const T &, typename internal::enable_if< internal::is_arithmetic< typename NumTraits< T >::Real >::value, T >::type *=0)
 
template<typename T1 , typename T2 >
internal::enable_if< internal::is_same< T1, T2 >::value, bool >::type Eigen::is_same_type (const T1 &, const T2 &)
 
template<typename T >
bool Eigen::isMinusInf (const T &x)
 
template<typename T >
bool Eigen::isNotNaN (const T &x)
 
template<typename T >
bool Eigen::isPlusInf (const T &x)
 
int main (int argc, char *argv[])
 
template<typename PermutationVectorType >
void Eigen::randomPermutationVector (PermutationVectorType &v, Index size)
 
void set_repeat_from_string (const char *str)
 
void set_seed_from_string (const char *str)
 
template<typename T , typename U >
bool Eigen::test_is_equal (const T &actual, const U &expected, bool expect_equal=true)
 
bool Eigen::test_isApprox (const long double &a, const long double &b)
 
bool Eigen::test_isApprox (const std::complex< double > &a, const std::complex< double > &b)
 
bool Eigen::test_isApprox (const std::complex< float > &a, const std::complex< float > &b)
 
bool Eigen::test_isApprox (const std::complex< long double > &a, const std::complex< long double > &b)
 
template<typename Type1 , typename Type2 >
bool Eigen::test_isApprox (const Type1 &a, const Type2 &b, typename Type1::Scalar *=0)
 
bool Eigen::test_isApproxOrLessThan (const long double &a, const long double &b)
 
template<typename Scalar , typename ScalarRef >
bool Eigen::test_isApproxWithRef (const Scalar &a, const Scalar &b, const ScalarRef &ref)
 
bool Eigen::test_isMuchSmallerThan (const long double &a, const long double &b)
 
template<typename Derived >
bool Eigen::test_isMuchSmallerThan (const MatrixBase< Derived > &m, const typename NumTraits< typename internal::traits< Derived >::Scalar >::Real &s)
 
template<typename Derived1 , typename Derived2 >
bool Eigen::test_isMuchSmallerThan (const MatrixBase< Derived1 > &m1, const MatrixBase< Derived2 > &m2)
 
bool Eigen::test_isMuchSmallerThan (const std::complex< double > &a, const std::complex< double > &b)
 
bool Eigen::test_isMuchSmallerThan (const std::complex< float > &a, const std::complex< float > &b)
 
bool Eigen::test_isMuchSmallerThan (const std::complex< long double > &a, const std::complex< long double > &b)
 
template<typename Derived >
bool Eigen::test_isUnitary (const MatrixBase< Derived > &m)
 
template<typename T >
NumTraits< T >::Real Eigen::test_precision ()
 
template<>
double Eigen::test_precision< double > ()
 
template<>
float Eigen::test_precision< float > ()
 
template<>
long double Eigen::test_precision< long double > ()
 
template<>
double Eigen::test_precision< std::complex< double > > ()
 
template<>
float Eigen::test_precision< std::complex< float > > ()
 
template<>
long double Eigen::test_precision< std::complex< long double > > ()
 
template<typename S , int D>
S Eigen::test_relative_error (const AlignedBox< S, D > &a, const AlignedBox< S, D > &b)
 
template<typename T >
T Eigen::test_relative_error (const AngleAxis< T > &a, const AngleAxis< T > &b)
 
template<typename T1 , typename T2 >
NumTraits< typename T1::RealScalar >::NonInteger Eigen::test_relative_error (const EigenBase< T1 > &a, const EigenBase< T2 > &b)
 
template<typename T1 , typename T2 >
T1::RealScalar Eigen::test_relative_error (const MatrixBase< T1 > &a, const SparseMatrixBase< T2 > &b)
 
template<typename S , int D, int O>
S Eigen::test_relative_error (const ParametrizedLine< S, D, O > &a, const ParametrizedLine< S, D, O > &b)
 
template<typename T >
T Eigen::test_relative_error (const Rotation2D< T > &a, const Rotation2D< T > &b)
 
template<typename T1 , typename T2 >
T1::RealScalar Eigen::test_relative_error (const SparseMatrixBase< T1 > &a, const MatrixBase< T2 > &b)
 
template<typename T1 , typename T2 >
T1::RealScalar Eigen::test_relative_error (const SparseMatrixBase< T1 > &a, const SparseMatrixBase< T2 > &b)
 
template<typename T1 , typename T2 >
T1::RealScalar Eigen::test_relative_error (const T1 &a, const T2 &b, const typename T1::Coefficients *=0)
 
template<typename T1 , typename T2 >
T1::Scalar Eigen::test_relative_error (const T1 &a, const T2 &b, const typename T1::MatrixType *=0)
 
template<typename T1 , typename T2 >
NumTraits< typename NumTraits< T1 >::Real >::NonInteger Eigen::test_relative_error (const T1 &a, const T2 &b, typename internal::enable_if< internal::is_arithmetic< typename NumTraits< T1 >::Real >::value, T1 >::type *=0)
 
template<typename S , int D>
S Eigen::test_relative_error (const Translation< S, D > &a, const Translation< S, D > &b)
 
template<typename T >
std::string type_name ()
 
template<>
std::string type_name< double > ()
 
template<>
std::string type_name< float > ()
 
template<>
std::string type_name< int > ()
 
template<>
std::string type_name< long double > ()
 
template<>
std::string type_name< std::complex< double > > ()
 
template<>
std::string type_name< std::complex< float > > ()
 
template<>
std::string type_name< std::complex< int > > ()
 
template<>
std::string type_name< std::complex< long double > > ()
 
void verify_impl (bool condition, const char *testname, const char *file, int line, const char *condition_as_string)
 
template<typename Type1 , typename Type2 >
bool Eigen::verifyIsApprox (const Type1 &a, const Type2 &b)
 

Variables

static bool Eigen::g_has_set_repeat = false
 
static bool Eigen::g_has_set_seed = false
 
static int Eigen::g_repeat = 1
 
static unsigned int Eigen::g_seed = 0
 
static int Eigen::g_test_level = 0
 
static std::vector< std::string > Eigen::g_test_stack
 
static bool Eigen::no_more_assert = false
 
static bool Eigen::report_on_cerr_on_assert_failure = true
 
static const bool Eigen::should_raise_an_assert = false
 

Macro Definition Documentation

◆ _OVERRIDE_COMPLEX_SPECIALIZATION_

#define _OVERRIDE_COMPLEX_SPECIALIZATION_   1

Definition at line 44 of file main.h.

◆ B0

#define B0   FORBIDDEN_IDENTIFIER

Definition at line 110 of file main.h.

◆ CALL_SUBTEST

#define CALL_SUBTEST (   FUNC)
Value:
do { \
g_test_stack.push_back(EIGEN_MAKESTRING(FUNC)); \
FUNC; \
g_test_stack.pop_back(); \
} while (0)

Definition at line 399 of file main.h.

◆ DEBUG

#define DEBUG

Definition at line 153 of file main.h.

◆ DEFAULT_REPEAT

#define DEFAULT_REPEAT   10

Definition at line 161 of file main.h.

◆ eigen_assert

#define eigen_assert (   a)
Value:

Definition at line 293 of file main.h.

◆ EIGEN_CUDA_SDK_VER

#define EIGEN_CUDA_SDK_VER   0

Definition at line 67 of file main.h.

◆ EIGEN_DEBUG_SMALL_PRODUCT_BLOCKS

#define EIGEN_DEBUG_SMALL_PRODUCT_BLOCKS

Definition at line 117 of file main.h.

◆ EIGEN_DECLARE_TEST

#define EIGEN_DECLARE_TEST (   X)
Value:
void EIGEN_CAT(test_,X) (); \
static EigenTest EIGEN_CAT(test_handler_,X) (EIGEN_MAKESTRING(X), & EIGEN_CAT(test_,X)); \
void EIGEN_CAT(test_,X) ()

Definition at line 201 of file main.h.

◆ EIGEN_DEFAULT_IO_FORMAT

#define EIGEN_DEFAULT_IO_FORMAT   IOFormat(4, 0, " ", "\n", "", "", "", "")

Definition at line 210 of file main.h.

◆ EIGEN_INTERNAL_DEBUGGING

#define EIGEN_INTERNAL_DEBUGGING

Definition at line 359 of file main.h.

◆ EIGEN_TEST_SCALAR_TEST_OVERLOAD

#define EIGEN_TEST_SCALAR_TEST_OVERLOAD (   TYPE)
Value:
inline bool test_isApprox(TYPE a, TYPE b) \
{ return internal::isApprox(a, b, test_precision<TYPE>()); } \
{ return internal::isMuchSmallerThan(a, b, test_precision<TYPE>()); } \
{ return internal::isApproxOrLessThan(a, b, test_precision<TYPE>()); }

Definition at line 423 of file main.h.

◆ EIGEN_USE_CUSTOM_ASSERT

#define EIGEN_USE_CUSTOM_ASSERT

Definition at line 349 of file main.h.

◆ FORBIDDEN_IDENTIFIER

#define FORBIDDEN_IDENTIFIER   (this_identifier_is_forbidden_to_avoid_clashes) this_identifier_is_forbidden_to_avoid_clashes

Definition at line 108 of file main.h.

◆ I

#define I   FORBIDDEN_IDENTIFIER

Definition at line 112 of file main.h.

◆ isfinite

#define isfinite (   X)    please_protect_your_isfinite_with_parentheses

Definition at line 95 of file main.h.

◆ isinf

#define isinf (   X)    please_protect_your_isinf_with_parentheses

Definition at line 94 of file main.h.

◆ isnan

#define isnan (   X)    please_protect_your_isnan_with_parentheses

Definition at line 93 of file main.h.

◆ M_PI

#define M_PI   please_use_EIGEN_PI_instead_of_M_PI

Definition at line 106 of file main.h.

◆ max

#define max (   A,
  B 
)    please_protect_your_max_with_parentheses

Definition at line 92 of file main.h.

◆ min

#define min (   A,
  B 
)    please_protect_your_min_with_parentheses

Definition at line 91 of file main.h.

◆ STATIC_CHECK

#define STATIC_CHECK (   COND)    EIGEN_STATIC_ASSERT( (COND) , EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT )

Definition at line 397 of file main.h.

◆ TEST_SET_BUT_UNUSED_VARIABLE

#define TEST_SET_BUT_UNUSED_VARIABLE (   X)    EIGEN_UNUSED_VARIABLE(X)

Definition at line 121 of file main.h.

◆ TRACK

#define TRACK   std::cerr << __FILE__ << " " << __LINE__ << std::endl

Definition at line 207 of file main.h.

◆ VERIFY

#define VERIFY (   a)    ::verify_impl(a, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a))

Definition at line 380 of file main.h.

◆ VERIFY_GE

#define VERIFY_GE (   a,
  b 
)    ::verify_impl(a >= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a >= b))

Definition at line 382 of file main.h.

◆ VERIFY_IS_APPROX

#define VERIFY_IS_APPROX (   a,
  b 
)    VERIFY(verifyIsApprox(a, b))

Definition at line 388 of file main.h.

◆ VERIFY_IS_APPROX_OR_LESS_THAN

#define VERIFY_IS_APPROX_OR_LESS_THAN (   a,
  b 
)    VERIFY(test_isApproxOrLessThan(a, b))

Definition at line 392 of file main.h.

◆ VERIFY_IS_EQUAL

#define VERIFY_IS_EQUAL (   a,
  b 
)    VERIFY(test_is_equal(a, b, true))

Definition at line 386 of file main.h.

◆ VERIFY_IS_MUCH_SMALLER_THAN

#define VERIFY_IS_MUCH_SMALLER_THAN (   a,
  b 
)    VERIFY(test_isMuchSmallerThan(a, b))

Definition at line 390 of file main.h.

◆ VERIFY_IS_NOT_APPROX

#define VERIFY_IS_NOT_APPROX (   a,
  b 
)    VERIFY(!test_isApprox(a, b))

Definition at line 389 of file main.h.

◆ VERIFY_IS_NOT_APPROX_OR_LESS_THAN

#define VERIFY_IS_NOT_APPROX_OR_LESS_THAN (   a,
  b 
)    VERIFY(!test_isApproxOrLessThan(a, b))

Definition at line 393 of file main.h.

◆ VERIFY_IS_NOT_EQUAL

#define VERIFY_IS_NOT_EQUAL (   a,
  b 
)    VERIFY(test_is_equal(a, b, false))

Definition at line 387 of file main.h.

◆ VERIFY_IS_NOT_MUCH_SMALLER_THAN

#define VERIFY_IS_NOT_MUCH_SMALLER_THAN (   a,
  b 
)    VERIFY(!test_isMuchSmallerThan(a, b))

Definition at line 391 of file main.h.

◆ VERIFY_IS_UNITARY

#define VERIFY_IS_UNITARY (   a)    VERIFY(test_isUnitary(a))

Definition at line 395 of file main.h.

◆ VERIFY_LE

#define VERIFY_LE (   a,
  b 
)    ::verify_impl(a <= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a <= b))

Definition at line 383 of file main.h.

◆ VERIFY_RAISES_ASSERT

#define VERIFY_RAISES_ASSERT (   a)    std::cout << "Can't VERIFY_RAISES_ASSERT( " #a " ) with exceptions disabled\n";

Definition at line 340 of file main.h.

◆ VERIFY_RAISES_STATIC_ASSERT

#define VERIFY_RAISES_STATIC_ASSERT (   a)    std::cout << "Can't VERIFY_RAISES_STATIC_ASSERT( " #a " ) with exceptions disabled\n";

Definition at line 344 of file main.h.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 770 of file main.h.

◆ set_repeat_from_string()

void set_repeat_from_string ( const char *  str)
inline

Definition at line 746 of file main.h.

◆ set_seed_from_string()

void set_seed_from_string ( const char *  str)
inline

Definition at line 758 of file main.h.

◆ type_name()

template<typename T >
std::string type_name ( )

Definition at line 734 of file main.h.

◆ type_name< double >()

template<>
std::string type_name< double > ( )

Definition at line 736 of file main.h.

◆ type_name< float >()

template<>
std::string type_name< float > ( )

Definition at line 735 of file main.h.

◆ type_name< int >()

template<>
std::string type_name< int > ( )

Definition at line 738 of file main.h.

◆ type_name< long double >()

template<>
std::string type_name< long double > ( )

Definition at line 737 of file main.h.

◆ type_name< std::complex< double > >()

template<>
std::string type_name< std::complex< double > > ( )

Definition at line 740 of file main.h.

◆ type_name< std::complex< float > >()

template<>
std::string type_name< std::complex< float > > ( )

Definition at line 739 of file main.h.

◆ type_name< std::complex< int > >()

template<>
std::string type_name< std::complex< int > > ( )

Definition at line 742 of file main.h.

◆ type_name< std::complex< long double > >()

template<>
std::string type_name< std::complex< long double > > ( )

Definition at line 741 of file main.h.

◆ verify_impl()

void verify_impl ( bool  condition,
const char *  testname,
const char *  file,
int  line,
const char *  condition_as_string 
)
inline

Definition at line 362 of file main.h.

Eigen::internal::isApproxOrLessThan
EIGEN_DEVICE_FUNC bool isApproxOrLessThan(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: Eigen/src/Core/MathFunctions.h:1954
b
Scalar * b
Definition: benchVecAdd.cpp:17
Eigen::internal::isApprox
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: Eigen/src/Core/MathFunctions.h:1947
X
#define X
Definition: icosphere.cpp:20
Eigen::internal::isMuchSmallerThan
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: Eigen/src/Core/MathFunctions.h:1940
test_isMuchSmallerThan
bool test_isMuchSmallerThan(const AnnoyingScalar &a, const AnnoyingScalar &b)
Definition: AnnoyingScalar.h:162
Eigen::internal::copy_bool
bool copy_bool(bool b)
Definition: Macros.h:1004
test_isApprox
bool test_isApprox(const AnnoyingScalar &a, const AnnoyingScalar &b)
Definition: AnnoyingScalar.h:159
EIGEN_CAT
#define EIGEN_CAT(a, b)
Definition: Macros.h:902
Eigen::no_more_assert
static bool no_more_assert
Definition: main.h:225
Eigen::EigenTest
Definition: main.h:173
EIGEN_THROW_X
#define EIGEN_THROW_X(X)
Definition: Macros.h:1403
TYPE
#define TYPE
Definition: benchFFT.cpp:31
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Eigen::test_isApproxOrLessThan
bool test_isApproxOrLessThan(const long double &a, const long double &b)
Definition: main.h:479
Eigen::eigen_assert_exception
Definition: main.h:228
EIGEN_MAKESTRING
#define EIGEN_MAKESTRING(a)
Definition: Macros.h:908
Eigen::report_on_cerr_on_assert_failure
static bool report_on_cerr_on_assert_failure
Definition: main.h:226


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:18:31