Skip to content

Commit 9d9bf0e

Browse files
committed
namespace for alias changed
1 parent 9d98bdc commit 9d9bf0e

File tree

6 files changed

+26
-341
lines changed

6 files changed

+26
-341
lines changed

include/LinearAlgebra/StaticMatrix/AliasAndConcepts/staticmatrix_alias_and_concepts.hpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,49 @@
33
#include <concepts>
44
#include <cstddef>
55
#include <array>
6-
namespace klibrary::linear_algebra {
7-
// 添え字に使用する型の定義
6+
#include <optional>
7+
// 実装内のみで使用される型やコンセプト
8+
namespace klibrary::linear_algebra::alias_and_concepts {
89
using SizeT = std::size_t;
9-
// 浮動小数点型の定義
10+
1011
template <class T>
1112
concept FloatingPoint = std::is_floating_point_v<T>;
12-
// 配列型の定義
13+
1314
template <class ElemT, SizeT size>
1415
using Array = std::array<ElemT, size>;
15-
// T, Uから変換可能な共通の型が存在するか
16+
1617
template <class T, class U>
1718
concept HasCommonTypeWith = std::common_with<T, U>;
18-
// T, Uから変換可能な共通の型を返す
19+
1920
template <class T, class U>
2021
using CommonTypeOf = std::common_type<T, U>::type;
21-
// FromからToに変換可能であるか
22+
2223
template <class From, class To>
2324
concept IsConvertibleTo = std::convertible_to<From, To>;
24-
// 加算は定義されているか
25+
2526
template <class Operand_L, class Operand_R>
2627
concept IsAdditionDefined = requires(Operand_L a, Operand_R b) {
2728
{a + b};
2829
};
29-
// 減算は定義されているか
30+
3031
template <class Operand_L, class Operand_R>
3132
concept IsSubtractionDefined = requires(Operand_L a, Operand_R b) {
3233
{a - b};
3334
};
34-
// 乗算は定義されているか
35+
3536
template <class Operand_L, class Operand_R>
3637
concept IsMultiplicationDefined = requires(Operand_L a, Operand_R b) {
3738
{a * b};
3839
};
39-
// 除算は定義されているか
40+
4041
template <class Operand_L, class Operand_R>
4142
concept IsDivisionDefined = requires(Operand_L a, Operand_R b) {
4243
{a / b};
4344
};
4445
}
46+
// ユーザーが使用可能な型やコンセプト
47+
namespace klibrary::linear_algebra {
48+
template <class T>
49+
using Infinity = std::optional<T>::nullopt_t;
50+
}
4551
#endif // staticmatrix_alias_and_concepts_hpp

include/LinearAlgebra/StaticMatrix/Base/staticmatrix_base.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#include <cassert>
77
#include <iostream>
88
#include <concepts>
9+
namespace {
10+
using namespace klibrary::linear_algebra::alias_and_concepts;
11+
}
912
namespace klibrary::linear_algebra {
1013
template <class ElemT, SizeT Rows, SizeT Cols>
1114
class StaticMatrixBase {

include/LinearAlgebra/StaticMatrix/Base/staticmatrixbase.hpp

Lines changed: 0 additions & 311 deletions
This file was deleted.

0 commit comments

Comments
 (0)