Skip to content

Commit 948c21c

Browse files
committed
Update 1_MainFunctions.jl
1 parent 89e1a46 commit 948c21c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/1_MainFunctions.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ A function for finding the fixed point of another function
114114
#' F = fixed_point(Func, Inputs; Algorithm = Anderson, MaxM = 4, ReportingSigFig = 13)
115115
"""
116116
function fixed_point(func::Function, previous_FixedPointResults::FixedPointResults;
117-
Algorithm::FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric::Function = supnorm(input::Array, output::Array) = maximum(abs.(output .- input)),
117+
Algorithm::FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric::Function = supnorm(input, output) = maximum(abs.(output .- input)),
118118
ConvergenceMetricThreshold::R = 1e-10, MaxIter::Integer = Integer(1000), MaxM::Integer = Integer(10), ExtrapolationPeriod::Integer = Integer(7), Dampening::Real = AbstractFloat(1.0),
119119
PrintReports::Bool = false, ReportingSigFig::Integer = Integer(10), ReplaceInvalids::InvalidReplacement = NoAction, ConditionNumberThreshold::Real = 1e3) where R<:Real
120120
Inputs = previous_FixedPointResults.Inputs_
@@ -124,7 +124,7 @@ function fixed_point(func::Function, previous_FixedPointResults::FixedPointResul
124124
ReplaceInvalids = ReplaceInvalids, ConditionNumberThreshold = ConditionNumberThreshold)
125125
end
126126
function fixed_point(func::Function, Inputs::Array{T, 1};
127-
Algorithm::FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric::Function = supnorm(input::Array, output::Array) = maximum(abs.(output .- input)),
127+
Algorithm::FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric::Function = supnorm(input, output) = maximum(abs.(output .- input)),
128128
ConvergenceMetricThreshold::Real = 1e-10, MaxIter::Integer = Integer(1000), MaxM::Integer = Integer(10), ExtrapolationPeriod::Integer = Integer(7), Dampening::Real = AbstractFloat(1.0),
129129
PrintReports::Bool = false, ReportingSigFig::Integer = Integer(10), ReplaceInvalids::InvalidReplacement = NoAction, ConditionNumberThreshold::Real = 1e3) where T<:Real
130130
Inputs2 = Array{Float64, 2}(undef,size(Inputs)[1],1)
@@ -134,7 +134,7 @@ function fixed_point(func::Function, Inputs::Array{T, 1};
134134
ReplaceInvalids = ReplaceInvalids, ConditionNumberThreshold = ConditionNumberThreshold)
135135
end
136136
function fixed_point(func::Function, Inputs::Real;
137-
Algorithm::FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric::Function = supnorm(input::Array, output::Array) = maximum(abs.(output .- input)),
137+
Algorithm::FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric::Function = supnorm(input, output) = maximum(abs.(output .- input)),
138138
ConvergenceMetricThreshold::Real = 1e-10, MaxIter::Integer = Integer(1000), MaxM::Integer = Integer(10), ExtrapolationPeriod::Integer = Integer(7), Dampening::Real = AbstractFloat(1.0),
139139
PrintReports::Bool = false, ReportingSigFig::Integer = Integer(10), ReplaceInvalids::InvalidReplacement = NoAction, ConditionNumberThreshold::Real = 1e3)
140140
Inputs2 = Array{typeof(Inputs), 2}(undef,1,1)
@@ -144,7 +144,7 @@ function fixed_point(func::Function, Inputs::Real;
144144
ReplaceInvalids = ReplaceInvalids, ConditionNumberThreshold = ConditionNumberThreshold)
145145
end
146146
function fixed_point(func::Function, Inputs::Array{T, 2}; Outputs::Array{T,2} = Array{T,2}(undef,size(Inputs)[1],0),
147-
Algorithm::FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric::Function = supnorm(input::Array, output::Array) = maximum(abs.(output .- input)),
147+
Algorithm::FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric::Function = supnorm(input, output) = maximum(abs.(output .- input)),
148148
ConvergenceMetricThreshold::Real = 1e-10, MaxIter::Integer = Integer(1000), MaxM::Integer = Integer(10), ExtrapolationPeriod::Integer = Integer(7), Dampening::Real = AbstractFloat(1.0),
149149
PrintReports::Bool = false, ReportingSigFig::Integer = Integer(10), ReplaceInvalids::InvalidReplacement = NoAction, ConditionNumberThreshold::Real = 1e3) where T<:Real where R<:Real
150150
# This code first tests if the input point is a fixed point. Then if it is not a while loop runs to try to find a fixed point.

0 commit comments

Comments
 (0)