Skip to content

Commit

Permalink
Implement size and length to BasisInfo (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojukka5 authored Jan 30, 2018
1 parent 049ef88 commit 87ba789
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ type BasisInfo{B<:AbstractBasis,T}
detJ::T
end

function length{T<:AbstractBasis}(B::BasisInfo{T})
return length(T)
end

function size{T<:AbstractBasis}(B::BasisInfo{T})
return size(T)
end

"""
Initialization of data type `BasisInfo`.
Expand Down
2 changes: 2 additions & 0 deletions test/test_math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ end

@testset "test BasisInfo" begin
B = BasisInfo(Seg2)
@test length(B) == 2
@test size(B) == (1, 2)
X = ((0.0,), (1.1))
xi = (0.0,)
eval_basis!(B, X, xi)
Expand Down

0 comments on commit 87ba789

Please sign in to comment.