@@ -166,13 +166,8 @@ function underlying_dimensions(a::PE_Function)
166166 return Set(keys(a. units_))
167167end
168168
169- function evaluate(f:: MultivariateFunction , coordinate:: Float64 )
170- if length(setdiff(underlying_dimensions(f), Set([default_symbol]))) == 0
171- coordinates = Dict([default_symbol] .=> coordinate)
172- return evaluate(f, coordinates)
173- else
174- error(" It is not possible to use the evaluate method without using a dict unless the only variable is the default one." )
175- end
169+ function evaluate(f:: MultivariateFunction , coordinate:: Float64 ; variable:: Symbol = default_symbol)
170+ return evaluate(f, Dict{Symbol,Float64}(variable => coordinate))
176171end
177172
178173"""
@@ -252,10 +247,6 @@ struct Sum_Of_Functions <: MultivariateFunction
252247end
253248Base. broadcastable(e:: Sum_Of_Functions ) = Ref(e)
254249
255- # function zero(f::Sum_Of_Functions)
256- # return Sum_Of_Functions([])
257- # end
258-
259250function evaluate(f:: Sum_Of_Functions , coordinates:: Dict{Symbol,Float64} )
260251 if length(f. functions_) > 0
261252 vals = evaluate.(f. functions_, Ref(coordinates))
@@ -283,15 +274,6 @@ function rebadge(f::Sum_Of_Functions, mapping::Dict{Symbol,Symbol})
283274 return Sum_Of_Functions(funcs)
284275end
285276
286- function evaluate(f:: Sum_Of_Functions , coordinates:: Float64 )
287- if length(f. functions_) > 0
288- vals = evaluate.(f. functions_, Ref(coordinates))
289- return sum(vals)
290- else
291- return 0.0
292- end
293- end
294-
295277function convert(:: Type{Sum_Of_Functions} , f:: PE_Function )
296278 return Sum_Of_Functions(f)
297279end
495477function evaluate(f:: Missing , coordinates:: Dict{Symbol,Float64} )
496478 return missing
497479end
498- function evaluate(f:: Piecewise_Function , coordinate:: Float64 )
499- if underlying_dimensions(f) == Set([default_symbol])
500- coordinates_ = Dict{Symbol,Float64}(default_symbol => coordinate)
501- return evaluate(f, coordinates_)
502- else
503- error(" Cannot evaluate a Piecewise function without a dictionary set of coordinates unless it is a MultivariateFunction with only the default dimension being used." )
504- end
505- end
506480
507481function underlying_dimensions(f:: Piecewise_Function )
508482 underlying = union(underlying_dimensions.(f. functions_). .. )
0 commit comments