diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2304b7..0c2e94c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: - fail-fast: false + fail-fast: true matrix: version: - '1.10' diff --git a/Project.toml b/Project.toml index 5c749c3..8433eb9 100644 --- a/Project.toml +++ b/Project.toml @@ -6,6 +6,7 @@ version = "0.4.0" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" @@ -13,7 +14,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" [compat] MacroTools = "0.5" +SparseArrays = "1" SpecialFunctions = "2" StaticArrays = "1" -SparseArrays = "1" julia = "1.10,1.11" diff --git a/src/Multiplex.jl b/src/Multiplex.jl deleted file mode 100644 index 880771f..0000000 --- a/src/Multiplex.jl +++ /dev/null @@ -1,27 +0,0 @@ -using SpecialFunctions -struct Multiplex{A} <:ℝ where{A<:AbstractVector{R}} where{R<:ℝ} - x :: A -end - -demultiplex(a::Multiplex) = a.x -demultiplex(a::SVector{L1, Multiplex{SVector{M,R}}}) where{L1 ,M,R} = SMatrix{L1,M,R,L1*M}(aᵢ.x[j] for aᵢ∈a, j=1:length(a[1].x)) -#demultiplex(a::SArray{S,Multiplex{SVector{M,R}}}) where{S<:Tuple{s},M,R} where{s} = SArray{Tuple{s...,M},R}(aᵢ.x[j] for aᵢ∈a, j=1:length(a[1].x)) -demultiplex(a::AbstractArray) = [ aᵢ.x[j] for aᵢ∈a, j=1:length(a[1].x)] - -for OP =(:zero,:one,:typemax,:typemin,:floatmax,:floatmin,:eps) - eval(:(@inline Base.$OP(::Multiplex{A}) where{A<:AbstractVector{R}} where{R<:ℝ} = $OP(R))) -end -for OP = (:atan,:hypot,:(+),:(-),:(*),:(/),:(^)) - eval(quote - @inline Base.$OP(a::Multiplex,b::Multiplex) = Multiplex($OP.(a.x,b.x)) - @inline Base.$OP(a::Multiplex,b::ℝ ) = Multiplex($OP.(a.x,b )) - @inline Base.$OP(a::ℝ ,b::Multiplex) = Multiplex($OP.(a ,b.x)) - end) -end -for OP =(:(+),:(-),:abs,:conj,:sqrt,:cbrt,:abs2,:inv,:log,:log10,:log2,:log1p,:exp,:exp2,:exp10,:expm1,:sin,:cos,:tan,:sinpi,:cospi,:sec,:csc,:cot, - :sind,:cosd,:tand,:secd,:acsc,:acot,:asind,:acosd,:atand,:asecd,:acscd,:acotd,:sinh,:cosh,:tanh,:sech,:csch,:coth,:asinh,:acosh,:atanh,:asech,:acsch,:acoth) - eval(:(@inline Base.$OP(a::Multiplex) = Multiplex($OP.(a.x)))) -end -for OP =(:erf,:erfc,:erfi,:gamma,:lgamma,:airy,:airyprime,:airyai,:airybi,:airyaiprime,:airybiprime,:besselj0,:besselj1,:bessely0,:bessely1) - eval(:(@inline SpecialFunctions.$OP(a::Multiplex) = Multiplex($OP.(a.x)))) -end diff --git a/src/Muscade.jl b/src/Muscade.jl index 357321b..222b647 100644 --- a/src/Muscade.jl +++ b/src/Muscade.jl @@ -14,8 +14,6 @@ module Muscade export value,VALUE,∂,value_∂ # \partial, \nabla export constants,precedence,npartial,norm - include("Multiplex.jl") - include("Dots.jl") export dots,∘₀,∘₁,∘₂,⊗ diff --git a/test/Project.toml b/test/Project.toml index 1a2238b..763ae27 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -5,6 +5,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" Muscade = "93488820-1883-11ed-0c34-05177b029e4d" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" diff --git a/test/TestMultiplex.jl b/test/TestMultiplex.jl deleted file mode 100644 index e389242..0000000 --- a/test/TestMultiplex.jl +++ /dev/null @@ -1,35 +0,0 @@ -module TestMultiplex - -using Test -using Muscade -using Muscade: Multiplex,demultiplex -using StaticArrays - -t = Multiplex(1.:3.) -x = 1. +sin(t) -y = 3. *t -r = SVector(x,y) -dr = demultiplex(r) -dx = demultiplex(x) - -@testset "Multiplex Vector" begin - @test dr ≈ [1.8414709848078965 1.9092974268256817 1.1411200080598671; 3. 6. 9.] - @test dx ≈ [1.8414709848078965,1.9092974268256817,1.1411200080598671] - # @test -end - -st = Multiplex(SVector(1.,2.,3.)) -sx = 1. +sin(st) -sy = 3. *st -sr = SVector(sx,sy) -se = SMatrix{2,2}(sx,sy,-sy,sx) -sdr = demultiplex(sr) -sdx = demultiplex(sx) -@testset "Multiplex SVector" begin - @test sdr ≈ [1.8414709848078965 1.9092974268256817 1.1411200080598671; 3. 6. 9.] - @test sdx ≈ [1.8414709848078965,1.9092974268256817,1.1411200080598671] - @test zero(sx) ≈ zero(𝕣) -end - - -end \ No newline at end of file diff --git a/test/run.jl b/test/run.jl new file mode 100644 index 0000000..14e2fc9 --- /dev/null +++ b/test/run.jl @@ -0,0 +1,8 @@ +test = @__DIR__ +muscade = normpath(joinpath(test,"..")) +#docs = normpath(joinpath(test,"../docs")) +using Pkg +Pkg.activate(test) +#using Muscade # seems necessary for doc test to work on a cold start +include(normpath(joinpath(test,"runtests.jl"))) +Pkg.activate(muscade) diff --git a/test/runtests.jl b/test/runtests.jl index 51a5de5..f87d331 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,10 +1,3 @@ -test = @__DIR__ -muscade = normpath(joinpath(test,"..")) -docs = normpath(joinpath(test,"../docs")) -import Pkg; Pkg.add("Pkg") # for CI on headless server -#using Pkg -Pkg.activate(test) -using Muscade # seems necessary for doc test to work on a cold start module Runtest using Test,Literate, DocumenterCitations,Printf,Documenter,Muscade @@ -18,9 +11,6 @@ module Runtest @testset "TestAdiff" begin include("TestAdiff.jl") end - @testset "TestMultiplex" begin - include("TestMultiplex.jl") - end @testset "TestModelDescription" begin include("TestModelDescription.jl") end @@ -66,5 +56,3 @@ module Runtest # doctest(Muscade) we do not use doctest, we run Literate.jl on mydemo.jl files that are included in a unit test file end end - -Pkg.activate(muscade)