Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Tensors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module Tensors

import Base.@pure

import ForwardDiff: Dual, partials, value, Tag

import Statistics
using Statistics: mean
using LinearAlgebra
Expand Down
2 changes: 0 additions & 2 deletions src/automatic_differentiation.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import ForwardDiff: Dual, partials, value, Tag

@static if isdefined(LinearAlgebra, :gradient)
import LinearAlgebra.gradient
end
Expand Down
6 changes: 5 additions & 1 deletion src/eigen.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Support functions
get_max_iterations(::Type{T}) where{T} = 2 * (1 + precision(T) - exponent(floatmin(T)))
get_max_iterations(::Type{T}) where{T<:Dual{TT,VT}} where{TT,VT} = get_max_iterations(VT)

# MIT License: Copyright (c) 2016: Andy Ferris.
# See LICENSE.md for further licensing test

Expand Down Expand Up @@ -134,7 +138,7 @@ function LinearAlgebra.eigen(R::SymmetricTensor{2,3,T′}) where T′
b22 = a22

# Givens reflections, B' = G^T * B * G, preserve tridiagonal matrices
max_iteration = 2 * (1 + precision(T) - exponent(floatmin(T)))
max_iteration = get_max_iterations(T)

if abs(b12) <= abs(b01)
saveB00, saveB01, saveB11 = b00, b01, b11
Expand Down