diff --git a/Project.toml b/Project.toml index fee500e..19ed20f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NonlinearNormalForm" uuid = "05e19671-dec8-4f15-984f-54eaa6ca64be" authors = ["Matt Signorelli"] -version = "0.5.2" +version = "0.5.3" [deps] DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" @@ -28,7 +28,7 @@ Reexport = "1" ReferenceFrameRotations = "3" SkewLinearAlgebra = "1" StaticArrays = "1" -TPSAInterface = "0.3.0" +TPSAInterface = "0.3.1" julia = "1.9" [extras] diff --git a/src/utils.jl b/src/utils.jl index e81d6e2..31a4642 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -51,7 +51,7 @@ end factor_in(t, var::Int, n::Int=1) = (out = zero(t); factor_in!(out, t, var, n)) -function factor_in!(out, t, var::Int, n::Int=1) +function factor_in!(out, t, var::Int, n::Int=1, ) TI.is_tps_type(typeof(t)) isa TI.IsTPSType || error("Function only accepts TPS types") TI.is_tps_type(typeof(out)) isa TI.IsTPSType || error("Function only accepts TPS types") nn = ndiffs(t) @@ -65,7 +65,9 @@ function factor_in!(out, t, var::Int, n::Int=1) idx = TI.cycle!(t, 0, mono=tmpmono, val=v) while idx > 0 tmpmono[var] += n - TI.setm!(out, v[], tmpmono) + if TI.isvalidm(out, tmpmono) + TI.setm!(out, v[], tmpmono) + end idx = TI.cycle!(t, idx, mono=tmpmono, val=v) end return out