Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heads up about changes in Julia LinearAlgebra stdlib affecting this package #221

Closed
KristofferC opened this issue Sep 5, 2019 · 2 comments · Fixed by #223
Closed

Heads up about changes in Julia LinearAlgebra stdlib affecting this package #221

KristofferC opened this issue Sep 5, 2019 · 2 comments · Fixed by #223

Comments

@KristofferC
Copy link

Pivoting in the LU factorization is now used in more cases after: JuliaLang/julia#32989

This means that the line https://github.com/JuliaLang/julia/blame/master/stdlib/LinearAlgebra/src/lu.jl#L143 gets executed which breaks this package tests:

Tests for Taylor1 expansions: Error During Test at /root/.julia/packages/TaylorSeries/STRph/test/onevariable.jl:10
  Got exception outside of a @test
  ArgumentError: The 0th order Taylor1 coefficient must be non-zero
  (abs(x) is not differentiable at x=0).
  Stacktrace:
   [1] abs at /root/.julia/packages/TaylorSeries/STRph/src/other_functions.jl:88 [inlined]
   [2] #generic_lufact!#134(::Bool, ::typeof(LinearAlgebra.generic_lufact!), ::Array{Taylor1{Float64},2}, ::Val{true}) at /workspace/srcdir/julia/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/lu.jl:143
   [3] #generic_lufact! at ./none:0 [inlined]
   [4] #lu!#133 at /workspace/srcdir/julia/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/lu.jl:130 [inlined]
   [5] #lu! at ./none:0 [inlined]
   [6] #lu#135 at /workspace/srcdir/julia/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/lu.jl:273 [inlined]
   [7] lu at /workspace/srcdir/julia/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/lu.jl:272 [inlined] (repeats 2 times)
   [8] inv(::Array{Taylor1{Float64},2}) at /workspace/srcdir/julia/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/dense.jl:770
   [9] top-level scope at /root/.julia/packages/TaylorSeries/STRph/test/onevariable.jl:509
   [10] top-level scope at /workspace/srcdir/julia/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107
   [11] top-level scope at /root/.julia/packages/TaylorSeries/STRph/test/onevariable.jl:11
   [12] include at ./boot.jl:328 [inlined]
   [13] include_relative(::Module, ::String) at ./loading.jl:1105
   [14] include(::Module, ::String) at ./Base.jl:31
   [15] include(::String) at ./client.jl:432
   [16] top-level scope at /root/.julia/packages/TaylorSeries/STRph/test/runtests.jl:17
   [17] include at ./boot.jl:328 [inlined]
   [18] include_relative(::Module, ::String) at ./loading.jl:1105
   [19] include(::Module, ::String) at ./Base.jl:31
   [20] include(::String) at ./client.jl:432
   [21] top-level scope at none:6
   [22] eval(::Module, ::Any) at ./boot.jl:330
   [23] exec_options(::Base.JLOptions) at ./client.jl:271
   [24] _start() at ./client.jl:468
@lbenet
Copy link
Member

lbenet commented Sep 5, 2019

Thanks for reporting. I'll take a look on this.

@lbenet
Copy link
Member

lbenet commented Sep 5, 2019

The problem is indeed the fact that abs(zero(T)) for T::Taylor1 is not defined, throws actually an error; polynomials do not form an ordered field, which is required for pivoting.

A possible solution could be to extend lu(A::AbstractMatrix{T}, ...) for T::Taylor1 so it uses the old method without pivoting. Does that make sense? Would that be a good solution?

cc @andreasnoack

dpsanders pushed a commit that referenced this issue Sep 6, 2019
* Add `inv` for `Matrix{Taylor1{T}}`, without pivoting in `lu`

Fixes #221

* Fixes tests for inv by shifting the diagonal

* Specialize `lu` instead of `inv`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants