/
orthogonality.jl
59 lines (42 loc) · 1.24 KB
/
orthogonality.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""
BasisOrthogonality
Base type for the orthogonality trait of a basis.
"""
abstract type BasisOrthogonality end
"""
Ortho <: BasisOrthogonality
Intermediate type for the trait for all orthogonal bases.
"""
abstract type Ortho <: BasisOrthogonality end
"""
Orthogonal <: Ortho
Concrete type for the trait of orthogonal bases, i.e. with diagonal metric.
"""
struct Orthogonal <: Ortho end
"""
Orthonormal <: Ortho
Concrete type for the trait of orthonormal bases, i.e. with metric `I`.
"""
struct Orthonormal <: Ortho end
"""
NonOrthogonal <: BasisOrthogonality
Concrete type for the trait of non-orthogonal bases, i.e. with non-diagonal metric.
"""
struct NonOrthogonal <: BasisOrthogonality end
"""
orthogonality(B)
Returns the [`BasisOrthogonality`](@ref) trait of the basis `B`.
# Examples
```julia
julia> orthogonality(BSpline(LinearKnotSet(7, 0, 1, 11)))
CompactBases.NonOrthogonal()
julia> orthogonality(FEDVR(range(0, stop=1, length=11), 7))
CompactBases.Orthonormal()
julia> orthogonality(StaggeredFiniteDifferences(0.1, 0.3, 0.1, 10.0))
CompactBases.Orthonormal()
julia> orthogonality(FiniteDifferences(range(0, stop=1, length=11)))
CompactBases.Orthogonal()
```
"""
function orthogonality end
export orthogonality