![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
List of common assertions that throw an Exceptions::Exception if not satistified. More...
Functions | |
| void | IsWithinBounds (const std::string &location, const size_t n, const size_t i) |
| Asserts that the index that is accessed is within bounds. More... | |
| void | IsProbability (const std::string &location, const std::string &what, const double &p, const bool nonzero=true, const bool noncert=true) |
| Asserts that the value represents a probability (0 < p < 1) More... | |
| template<typename T > | |
| void | IsNonZero (const std::string &location, const std::string &what, const T &value) |
| Asserts that a value is non zero. More... | |
| template<typename T > | |
| void | IsGreater (const std::string &location, const std::string &what, const T &value, const T &limit, const bool strictly=false) |
| Asserts that a value is greater than another. More... | |
| template<typename T > | |
| void | IsLower (const std::string &location, const std::string &what, const T &value, const T &limit, const bool strictly=false) |
| Asserts that a value is lower than another. More... | |
| template<typename T > | |
| void | IsEqual (const std::string &location, const std::string &what, const T &a, const T &b) |
| Asserts that the values are equal. More... | |
| template<typename T > | |
| void | IsNotEmpty (const std::string &location, const std::string &what, const std::vector< T > &vector) |
| Asserts that a vector is not empty. More... | |
| template<typename T > | |
| void | HasAtLeast (const std::string &location, const std::string &what, const std::vector< T > &vector, const size_t n) |
| Asserts that a vector has at least n elements. More... | |
| template<typename T > | |
| void | HasAtMost (const std::string &location, const std::string &what, const std::vector< T > &vector, const size_t n) |
| Asserts that a vector has at most n elements. More... | |
| template<typename T > | |
| void | SameSize (const std::string &location, const std::string &what, const std::vector< T > &va, const std::vector< T > &vb) |
| Asserts that two vectors have the same size. More... | |
| template<typename T > | |
| void | SameSize (const std::string &location, const std::string &what, const std::vector< std::vector< T >> &ma, const std::vector< std::vector< T >> &mb) |
| Asserts that two matrices have the same size. More... | |
| template<typename T > | |
| void | Multiplicable (const std::string &location, const std::string &what, const std::vector< std::vector< T >> &ma, const std::vector< std::vector< T >> &mb) |
| Asserts that two matrices are multiplicable. More... | |
| template<typename T > | |
| void | IsSquare (const std::string &location, const std::string &what, const std::vector< std::vector< T >> &matrix) |
| Asserts that a matrix is square. More... | |
| template<typename T > | |
| void | IsSymmetric (const std::string &location, const std::string &what, const std::vector< std::vector< T >> &matrix) |
| Asserts that a matrix is symmetric. More... | |
| template<typename T1 , typename T2 > | |
| void | Contains (const std::string &location, const std::string &what, const std::map< T1, T2 > &map, const T1 &key) |
| Asserts that a map contains a specific entry. More... | |
List of common assertions that throw an Exceptions::Exception if not satistified.
Simplifies the code down the line. All the assertions take two common inputs:
| void Assert::Contains | ( | const std::string & | location, |
| const std::string & | what, | ||
| const std::map< T1, T2 > & | map, | ||
| const T1 & | key | ||
| ) |
Asserts that a map contains a specific entry.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| map | Map to check |
| key | Key to look for |
| void Assert::HasAtLeast | ( | const std::string & | location, |
| const std::string & | what, | ||
| const std::vector< T > & | vector, | ||
| const size_t | n | ||
| ) |
Asserts that a vector has at least n elements.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| vector | Vector to check |
| n | Minimum number of elements |
| void Assert::HasAtMost | ( | const std::string & | location, |
| const std::string & | what, | ||
| const std::vector< T > & | vector, | ||
| const size_t | n | ||
| ) |
Asserts that a vector has at most n elements.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| vector | Vector to check |
| n | Maximum number of elements |
| void Assert::IsEqual | ( | const std::string & | location, |
| const std::string & | what, | ||
| const T & | a, | ||
| const T & | b | ||
| ) |
Asserts that the values are equal.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| a | First value |
| b | Second value |
| void Assert::IsGreater | ( | const std::string & | location, |
| const std::string & | what, | ||
| const T & | value, | ||
| const T & | limit, | ||
| const bool | strictly = false |
||
| ) |
Asserts that a value is greater than another.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| value | Value to check |
| limit | Minimum value |
| strictly | If true, must be strictly greater |
| void Assert::IsLower | ( | const std::string & | location, |
| const std::string & | what, | ||
| const T & | value, | ||
| const T & | limit, | ||
| const bool | strictly = false |
||
| ) |
Asserts that a value is lower than another.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| value | Value to check |
| limit | Maximum value |
| strictly | If true, must be strictly lower |
| void Assert::IsNonZero | ( | const std::string & | location, |
| const std::string & | what, | ||
| const T & | value | ||
| ) |
Asserts that a value is non zero.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| value | Value to check |
| void Assert::IsNotEmpty | ( | const std::string & | location, |
| const std::string & | what, | ||
| const std::vector< T > & | vector | ||
| ) |
Asserts that a vector is not empty.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| vector | Vector to check |
| void Assert::IsProbability | ( | const std::string & | location, |
| const std::string & | what, | ||
| const double & | p, | ||
| const bool | nonzero = true, |
||
| const bool | noncert = true |
||
| ) |
Asserts that the value represents a probability (0 < p < 1)
| location | Name of the function that called the assert |
| what | Name of the object to check |
| p | Value to check |
| nonzero | Check that it is non zero |
| noncert | Check that it is non certain |
| void Assert::IsSquare | ( | const std::string & | location, |
| const std::string & | what, | ||
| const std::vector< std::vector< T >> & | matrix | ||
| ) |
Asserts that a matrix is square.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| matrix | Matrix to check |
| void Assert::IsSymmetric | ( | const std::string & | location, |
| const std::string & | what, | ||
| const std::vector< std::vector< T >> & | matrix | ||
| ) |
Asserts that a matrix is symmetric.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| matrix | Matrix to check |
| void Assert::IsWithinBounds | ( | const std::string & | location, |
| const size_t | n, | ||
| const size_t | i | ||
| ) |
Asserts that the index that is accessed is within bounds.
| location | Name of the function that called the assert |
| n | Size of the vector |
| i | Index |
| void Assert::Multiplicable | ( | const std::string & | location, |
| const std::string & | what, | ||
| const std::vector< std::vector< T >> & | ma, | ||
| const std::vector< std::vector< T >> & | mb | ||
| ) |
Asserts that two matrices are multiplicable.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| ma | First matrix |
| mb | Second matrix |
| void Assert::SameSize | ( | const std::string & | location, |
| const std::string & | what, | ||
| const std::vector< T > & | va, | ||
| const std::vector< T > & | vb | ||
| ) |
Asserts that two vectors have the same size.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| va | First vector |
| vb | Second vector |
| void Assert::SameSize | ( | const std::string & | location, |
| const std::string & | what, | ||
| const std::vector< std::vector< T >> & | ma, | ||
| const std::vector< std::vector< T >> & | mb | ||
| ) |
Asserts that two matrices have the same size.
| location | Name of the function that called the assert |
| what | Name of the object to check |
| ma | First matrix |
| mb | Second matrix |
1.8.6