@@ -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"""
116116function fixed_point(func:: Function , previous_FixedPointResults:: FixedPointResults ;
117- Algorithm:: FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric:: Function = ConvergenceMetric (input:: Array , output:: Array ) = maximum(abs.(output .- input)),
117+ Algorithm:: FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric:: Function = supnorm (input:: Array , output:: Array ) = 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)
125125end
126126function fixed_point(func:: Function , Inputs:: Array{T, 1} ;
127- Algorithm:: FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric:: Function = ConvergenceMetric (input:: Array , output:: Array ) = maximum(abs.(output .- input)),
127+ Algorithm:: FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric:: Function = supnorm (input:: Array , output:: Array ) = 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)
135135end
136136function fixed_point(func:: Function , Inputs:: Real ;
137- Algorithm:: FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric:: Function = ConvergenceMetric (input:: Array , output:: Array ) = maximum(abs.(output .- input)),
137+ Algorithm:: FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric:: Function = supnorm (input:: Array , output:: Array ) = 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)
145145end
146146function 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 = ConvergenceMetric (input:: Array , output:: Array ) = maximum(abs.(output .- input)),
147+ Algorithm:: FixedPointAccelerationAlgorithm = Anderson, ConvergenceMetric:: Function = supnorm (input:: Array , output:: Array ) = 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