libsemigroups
v3.6.3
C++ library for semigroups and monoids
Toggle main menu visibility
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
33
namespace
libsemigroups
{
44
70
template
<
typename
Mat,
71
typename
72
= std::enable_if_t<IsMatrix<Mat> && !IsMatWithSemiring<Mat>>>
73
[[nodiscard]] Mat
74
make
(
std::vector
<
std::vector<typename Mat::scalar_type>
>
const
& rows);
75
101
template
<
typename
Mat,
102
typename
103
= std::enable_if_t<IsMatrix<Mat> && !IsMatWithSemiring<Mat>>>
104
[[nodiscard]] Mat
105
make
(
std::initializer_list
<
std::vector<typename Mat::scalar_type>
>
const
&
106
rows) {
107
return
make<Mat>
(
std::vector
<
std::vector<typename Mat::scalar_type>
>(rows));
108
}
109
136
template
<
typename
Mat,
137
typename
138
= std::enable_if_t<IsMatrix<Mat> && !IsMatWithSemiring<Mat>>>
139
// TODO(1) vector version
140
[[nodiscard]] Mat
141
make
(
std::initializer_list<typename Mat::scalar_type>
const
& row);
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,
181
std::initializer_list
<
182
std::initializer_list<typename Mat::scalar_type>
>
const
& rows);
183
215
template
<
typename
Mat,
216
typename
Semiring,
217
typename
= std::enable_if_t<IsMatrix<Mat>>>
218
[[nodiscard]] Mat
219
make
(Semiring
const
* semiring,
220
std::vector
<
std::vector<typename Mat::scalar_type>
>
const
& rows);
221
244
template
<
typename
Mat,
245
typename
Semiring,
246
typename
= std::enable_if_t<IsMatrix<Mat>>>
247
[[nodiscard]] Mat
248
make
(Semiring
const
* semiring,
249
std::initializer_list<typename Mat::scalar_type>
const
& row);
250
278
template
<
size_t
R,
size_t
C,
typename
Scalar>
279
[[nodiscard]]
ProjMaxPlusMat<R, C, Scalar>
280
make
(
std::initializer_list
<
std::initializer_list<Scalar>
>
const
& rows) {
281
return
ProjMaxPlusMat<R, C, Scalar>
(
282
make
<
ProjMaxPlusMat<R, C, Scalar>::underlying_matrix_type
>(rows));
283
}
284
}
// namespace libsemigroups
285
286
#include "matrix-make.tpp"
287
#endif
// LIBSEMIGROUPS_MATRIX_MAKE_HPP_
libsemigroups::make
enable_if_is_same< Return, Blocks > make(Container const &cont)
Check the arguments, construct a Blocks object, and check it.
Definition
bipart.hpp:856
libsemigroups::ProjMaxPlusMat
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
std::initializer_list
libsemigroups
Namespace for everything in the libsemigroups library.
Definition
action.hpp:44
std::vector
include
libsemigroups
matrix-make.hpp
Generated by
1.18.0