Skip to content

exp_generic mutates #125

@chriselrod

Description

@chriselrod
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions