-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add overloads for Base functions needed for tracing through matrix exponential from ExponentialUtilities #55
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,15 @@ for TT in (:JacobianTracer, :ConnectivityTracer, :HessianTracer) | |
@eval Base.similar(::Array, ::Type{$TT{S}}, dims::Dims{N}) where {N,S} = | ||
zeros($TT{S}, dims) | ||
end | ||
|
||
Base.real(sct::SparseConnectivityTracer.AbstractTracer) = sct | ||
Base.float(sct::SparseConnectivityTracer.AbstractTracer) = sct | ||
Base.max(x::SparseConnectivityTracer.AbstractTracer, y::SparseConnectivityTracer.AbstractTracer) = x | ||
Base.floatmin(x::Type{<:SparseConnectivityTracer.AbstractTracer}) = Base.floatmin(Float32) | ||
Base.eps(x::Type{<:SparseConnectivityTracer.AbstractTracer}) = Base.eps(Float32) | ||
Base.isinf(::SparseConnectivityTracer.AbstractTracer) = false | ||
Base.isless(x::SparseConnectivityTracer.AbstractTracer, ::SparseConnectivityTracer.AbstractTracer) = true | ||
Base.isless(::SparseConnectivityTracer.AbstractTracer, ::Float64) = true | ||
Comment on lines
+38
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comparisons like Any global pattern we return should be a conservative estimate of the sparsity over the entire input domain. We will add functionality for local sparsity detection soon. I opened #56 for the purpose of tracking. |
||
Base.isfinite(::SparseConnectivityTracer.AbstractTracer) = true | ||
Base.conj(x::SparseConnectivityTracer.AbstractTracer) = x | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should already exist:
SparseConnectivityTracer.jl/src/operators.jl
Lines 64 to 73 in 2fcd730
Did you encounter any errors on these functions?