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

exp_generic mutates #125

Open
chriselrod opened this issue Mar 28, 2023 · 1 comment
Open

exp_generic mutates #125

chriselrod opened this issue Mar 28, 2023 · 1 comment

Comments

@chriselrod
Copy link
Contributor

chriselrod commented Mar 28, 2023

julia> A = rand(4,4).*2 .- 1
4×4 Matrix{Float64}:
  0.610162  -0.729739   0.353308    0.580706
  0.13283    0.81543   -0.101152   -0.42284
  0.102145  -0.632171  -0.0403294  -0.676109
 -0.589665  -0.525069   0.908199    0.0735095

julia> ExponentialUtilities.exp_generic(A)
4×4 Matrix{Float64}:
  1.49472   -1.9331     0.852891   0.850057
  0.438917   2.38049   -0.319651  -0.511578
  0.2644    -0.824442   0.801718  -0.420251
 -0.764627  -0.76571    0.730733   0.736535

julia> A
4×4 Matrix{Float64}:
  1.49472   -1.9331     0.852891   0.850057
  0.438917   2.38049   -0.319651  -0.511578
  0.2644    -0.824442   0.801718  -0.420251
 -0.764627  -0.76571    0.730733   0.736535

I know it is deprecated

julia> ExponentialUtilities.exp_generic(A)
ERROR: `exp_generic` is deprecated, use `exponential!` instead.
Stacktrace:
 [1] depwarn(msg::String, funcsym::Symbol; force::Bool)
   @ Base ./deprecated.jl:124
 [2] depwarn(msg::String, funcsym::Symbol)
   @ Base ./deprecated.jl:121
 [3] exp_generic(args::Matrix{Float64}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ ExponentialUtilities ./deprecated.jl:115
 [4] exp_generic(args::Matrix{Float64})
   @ ExponentialUtilities ./deprecated.jl:113
 [5] top-level scope
   @ REPL[3]:1

but perhaps it's worth defining an exponential(A) = exponential!(copy(A)), and either removing exp_generic or forwarding it to exponential instead?

@ChrisRackauckas
Copy link
Member

but perhaps it's worth defining an exponential(A) = exponential!(copy(A)), and either removing exp_generic or forwarding it to exponential instead?

That sounds reasonable.

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

No branches or pull requests

2 participants