11 #include "Exception.hh"
27 template<
typename T>
void IsNonZero(
const std::string& location,
28 const std::string& what,
39 template<
typename T>
void IsGreater(
const std::string& location,
40 const std::string& what,
43 const bool strictly=
false);
53 template<
typename T>
void IsLower(
const std::string& location,
54 const std::string& what,
57 const bool strictly=
false);
66 template<
typename T>
void IsEqual(
const std::string& location,
67 const std::string& what,
77 template<
typename T>
void IsNotEmpty(
const std::string& location,
78 const std::string& what,
79 const std::vector<T>& vector);
98 template<
typename T>
void HasAtLeast(
const std::string& location,
99 const std::string& what,
100 const std::vector<T>& vector,
110 template<
typename T>
void HasAtMost(
const std::string& location,
111 const std::string& what,
112 const std::vector<T>& vector,
121 template<
typename T>
void SameSize(
const std::string& location,
122 const std::string& what,
123 const std::vector<T>& va,
124 const std::vector<T>& vb);
133 template<
typename T>
void SameSize(
const std::string& location,
134 const std::string& what,
135 const std::vector<std::vector<T>>& ma,
136 const std::vector<std::vector<T>>& mb);
145 template<
typename T>
void Multiplicable(
const std::string& location,
146 const std::string& what,
147 const std::vector<std::vector<T>>& ma,
148 const std::vector<std::vector<T>>& mb);
156 template<
typename T>
void IsSquare(
const std::string& location,
157 const std::string& what,
158 const std::vector<std::vector<T>>& matrix);
166 template<
typename T>
void IsSymmetric(
const std::string& location,
167 const std::string& what,
168 const std::vector<std::vector<T>>& matrix);
177 template<
typename T1,
typename T2>
void Contains(
const std::string& location,
178 const std::string& what,
179 const std::map<T1, T2>& map,
191 const std::string& what,
193 const bool nonzero=
true,
194 const bool noncert=
true);
196 #include "Assert-inl.hh"
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.
Definition: Assert.hh:10
void IsNonZero(const std::string &location, const std::string &what, const T &value)
Asserts that a value is non zero.
Definition: Assert.hh:2
void IsProbability(const std::string &location, const std::string &what, const double &p, const bool nonzero, const bool noncert)
Asserts that the value represents a probability (0 < p < 1)
Definition: Assert.cc:13
void IsSquare(const std::string &location, const std::string &what, const std::vector< std::vector< T >> &matrix)
Asserts that a matrix is square.
Definition: Assert.hh:116
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.
Definition: Assert.hh:61
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.
Definition: Assert.hh:147
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.
Definition: Assert.hh:27
void IsEqual(const std::string &location, const std::string &what, const T &a, const T &b)
Asserts that the values are equal.
Definition: Assert.hh:44
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.
Definition: Assert.hh:72
void IsWithinBounds(const std::string &location, const size_t n, const size_t i)
Asserts that the index that is accessed is within bounds.
Definition: Assert.cc:5
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.
Definition: Assert.hh:105
void IsNotEmpty(const std::string &location, const std::string &what, const std::vector< T > &vector)
Asserts that a vector is not empty.
Definition: Assert.hh:53
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.
Definition: Assert.hh:83
void IsSymmetric(const std::string &location, const std::string &what, const std::vector< std::vector< T >> &matrix)
Asserts that a matrix is symmetric.
Definition: Assert.hh:126