Skip to content

Commit c17a393

Browse files
author
Alexey Stukalov
committed
SemImpliedState: tweak
1 parent 92a7da9 commit c17a393

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/types.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,18 @@ abstract type SemImplied end
5555
abstract type SemImpliedSymbolic <: SemImplied end
5656

5757
"""
58-
State of `SemImplied` that corresponds to the specific SEM parameter values.
58+
State of [`SemImplied`](@ref) that corresponds to the specific SEM parameter values.
5959
6060
Contains the necessary vectors and matrices for calculating the SEM
6161
objective, gradient and hessian (whichever is requested).
6262
"""
63-
abstract type SemImpliedState end
63+
abstract type SemImpliedState{I <: SemImplied} end
6464

65+
impliedtype(::Type{SemImpliedState{I}}) where I = I
66+
impliedtype(state::SemImpliedState) = impliedtype(typeof(state))
6567
implied(state::SemImpliedState) = state.implied
66-
MeanStruct(state::SemImpliedState) = MeanStruct(implied(state))
67-
HessianEval(state::SemImpliedState) = HessianEval(implied(state))
68+
MeanStruct(::Type{S}) where {S <: SemImpliedState} = MeanStruct(impliedtype(state))
69+
HessianEval(::Type{S}) where {S <: SemImpliedState} = HessianEval(impliedtype(state))
6870

6971
"""
7072
abstract type SemLoss{O <: SemObserved, I <: SemImplied} <: AbstractLoss end

0 commit comments

Comments
 (0)