libsemigroups  v3.6.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
matrix-make.hpp
1//
2// libsemigroups - C++ library for semigroups and monoids
3// Copyright (C) 2026 James D. Mitchell
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//
18
19#ifndef LIBSEMIGROUPS_MATRIX_MAKE_HPP_
20#define LIBSEMIGROUPS_MATRIX_MAKE_HPP_
21
22#include <cstddef> // for size_t
23#include <initializer_list> // for initializer_list
24#include <type_traits> // for enable_if_t
25#include <vector> // for vector
26
27#include "is-matrix.hpp" // for IsMatrix, IsMa...
28#include "matrix-class.hpp" // for ProjMaxPlusMat
29#include "matrix-exceptions.hpp" // for throw_if_bad_e...
30
31#include "libsemigroups/detail/matrix-exceptions.hpp" // for throw_if_any_r
32
33namespace libsemigroups {
44
70 template <typename Mat,
71 typename
72 = std::enable_if_t<IsMatrix<Mat> && !IsMatWithSemiring<Mat>>>
73 [[nodiscard]] Mat
75
101 template <typename Mat,
102 typename
103 = std::enable_if_t<IsMatrix<Mat> && !IsMatWithSemiring<Mat>>>
104 [[nodiscard]] Mat
109
136 template <typename Mat,
137 typename
138 = std::enable_if_t<IsMatrix<Mat> && !IsMatWithSemiring<Mat>>>
139 // TODO(1) vector version
140 [[nodiscard]] Mat
142
174 template <typename Mat,
175 typename Semiring,
176 typename = std::enable_if_t<IsMatrix<Mat>>>
177 // TODO(1) pass Semiring by reference, this is hard mostly due to the way
178 // the tests are written, which is not optimal.
179 [[nodiscard]] Mat
180 make(Semiring const* semiring,
183
215 template <typename Mat,
216 typename Semiring,
217 typename = std::enable_if_t<IsMatrix<Mat>>>
218 [[nodiscard]] Mat
219 make(Semiring const* semiring,
221
244 template <typename Mat,
245 typename Semiring,
246 typename = std::enable_if_t<IsMatrix<Mat>>>
247 [[nodiscard]] Mat
248 make(Semiring const* semiring,
250
278 template <size_t R, size_t C, typename Scalar>
279 [[nodiscard]] ProjMaxPlusMat<R, C, Scalar>
284} // namespace libsemigroups
285
286#include "matrix-make.tpp"
287#endif // LIBSEMIGROUPS_MATRIX_MAKE_HPP_
enable_if_is_same< Return, Blocks > make(Container const &cont)
Check the arguments, construct a Blocks object, and check it.
Definition bipart.hpp:856
static constexpr bool IsMatWithSemiring
Helper variable template.
Definition is-matrix.hpp:127
std::conditional_t< R==0||C==0, DynamicProjMaxPlusMat< Scalar >, StaticProjMaxPlusMat< R, C, Scalar > > ProjMaxPlusMat
Alias template for projective max-plus matrices.
Definition matrix-class.hpp:4407
Namespace for everything in the libsemigroups library.
Definition action.hpp:44