22#ifndef LIBSEMIGROUPS_DETAIL_MATRIX_EXCEPTIONS_HPP_
23#define LIBSEMIGROUPS_DETAIL_MATRIX_EXCEPTIONS_HPP_
26#include <initializer_list>
33#include "libsemigroups/exception.hpp"
34#include "libsemigroups/is-matrix.hpp"
53 template <
typename Mat>
55 std::string_view arg_desc =
"the argument");
75 template <
typename Mat>
78 std::string_view arg_desc_x =
"the 1st argument",
79 std::string_view arg_desc_y =
"the 2nd argument");
96 template <
typename Mat>
101 template <
typename Mat>
102 void throw_if_semiring_nullptr(Mat
const& m);
104 template <
typename Mat,
typename Container>
105 auto throw_if_bad_dim(Container
const& m)
106 -> std::enable_if_t<IsStaticMatrix<Mat>>;
109 template <
typename Mat,
typename Container>
110 auto throw_if_bad_dim(Container
const&)
111 -> std::enable_if_t<IsDynamicMatrix<Mat>> {}
113 template <
typename Mat,
typename Container>
114 auto throw_if_bad_row_dim(Container
const& row)
115 -> std::enable_if_t<IsStaticMatrix<Mat>>;
117 template <
typename Mat,
typename Container>
118 auto throw_if_bad_row_dim(Container
const&)
119 -> std::enable_if_t<IsDynamicMatrix<Mat>> {}
121 template <
typename Container>
122 void throw_if_any_row_wrong_size(Container
const& m);
124 template <
typename Scalar>
125 void throw_if_any_row_wrong_size(
126 std::initializer_list<std::initializer_list<Scalar>> m) {
127 throw_if_any_row_wrong_size<
128 std::initializer_list<std::initializer_list<Scalar>>>(m);
133#include "matrix-exceptions.tpp"
Namespace for helper functions for matrices.
Definition matrix-exceptions.hpp:37
void throw_if_not_square(Mat const &x, std::string_view arg_desc="the argument")
Throws if a matrix is not square.
void throw_if_bad_coords(Mat const &x, size_t r, size_t c)
Throws the arguments do not index an entry of a matrix.
void throw_if_bad_dim(Mat const &x, Mat const &y, std::string_view arg_desc_x="the 1st argument", std::string_view arg_desc_y="the 2nd argument")
Throws if two matrices do not have the same dimensions.
Namespace for everything in the libsemigroups library.
Definition action.hpp:44