Skip to content

Commit

Permalink
Add matrix like constructors for dense solution arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fu committed Sep 10, 2024
1 parent 1ea4ad4 commit 3763a51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vfvm_densesolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ mutable struct DenseSolutionArray{T, N} <: AbstractSolutionArray{T,N}
end

DenseSolutionArray(u::Matrix{T}) where {T} =DenseSolutionArray{T,2}(u,nothing)

DenseSolutionArray{T,2}(nspec::Int, nnodes::Int) where {T} =DenseSolutionArray{T,2}(Matrix{T}(nspec,nnodes),nothing)
DenseSolutionArray{T,2}(::UndefInitializer,nspec::Int, nnodes::Int) where {T} =DenseSolutionArray{T,2}(Matrix{T}(undef,nspec,nnodes),nothing)

Base.getindex(a::DenseSolutionArray, i::Int, j::Int)= getindex(a.u,i,j )
Base.setindex!(a::DenseSolutionArray,v, i::Int, j::Int) = setindex!(a.u,v,i,j)
Base.size(a::DenseSolutionArray)=size(a.u)
Expand Down

0 comments on commit 3763a51

Please sign in to comment.