/usr/share/axiom-20170501/src/algebra/E04JAFA.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | )abbrev domain E04JAFA e04jafAnnaType
++ Author: Brian Dupee
++ Date Created: February 1996
++ Date Last Updated: February 1996
++ References:
++ Dupe95 Using Computer Algebra to Choose and Apply Numerical Routines
++ Dewa92 Using Computer Algebra to Select Numerical Algorithms
++ Description:
++ \axiomType{e04jafAnnaType} is a domain of \axiomType{NumericalOptimization}
++ for the NAG routine E04JAF, a general optimization routine which
++ can handle some singularities in the input function. The function
++ \axiomFun{measure} measures the usefulness of the routine E04JAF
++ for the given problem. The function \axiomFun{numericalOptimization}
++ performs the optimization by using \axiomType{NagOptimisationPackage}.
e04jafAnnaType() : SIG == CODE where
DF ==> DoubleFloat
EF ==> Expression Float
EDF ==> Expression DoubleFloat
PDF ==> Polynomial DoubleFloat
VPDF ==> Vector Polynomial DoubleFloat
LDF ==> List DoubleFloat
LOCDF ==> List OrderedCompletion DoubleFloat
MDF ==> Matrix DoubleFloat
MPDF ==> Matrix Polynomial DoubleFloat
MF ==> Matrix Float
MEF ==> Matrix Expression Float
LEDF ==> List Expression DoubleFloat
VEF ==> Vector Expression Float
NOA ==> Record(fn:EDF, init:LDF, lb:LOCDF, cf:LEDF, ub:LOCDF)
LSA ==> Record(lfn:LEDF, init:LDF)
EF2 ==> ExpressionFunctions2
MI ==> Matrix Integer
INT ==> Integer
F ==> Float
NNI ==> NonNegativeInteger
S ==> Symbol
LS ==> List Symbol
MVCF ==> MultiVariableCalculusFunctions
ESTOOLS2 ==> ExpertSystemToolsPackage2
SDF ==> Stream DoubleFloat
LSDF ==> List Stream DoubleFloat
SOCDF ==> Segment OrderedCompletion DoubleFloat
OCDF ==> OrderedCompletion DoubleFloat
SIG ==> NumericalOptimizationCategory
CODE ==> Result add
Rep:=Result
import Rep, NagOptimisationPackage
import e04AgentsPackage,ExpertSystemToolsPackage
bound(a:LOCDF,b:LOCDF):Integer ==
empty?(concat(a,b)) => 1
(#(removeDuplicates(a)) = 1) and zero?(first(a)) => 2
(#(removeDuplicates(a)) = 1) and (#(removeDuplicates(b)) = 1) => 3
0
measure(R:RoutinesTable,args:NOA) ==
string:String := "e04jaf is "
if positive?(#(args.cf)) then
if not simpleBounds?(args.cf) then
string :=
concat(string,_
"suitable for simple bounds only, not constraint functions.")
(# string) < 20 =>
if zero?(#(args.lb) + #(args.ub)) then
string := concat(string, "usable if there are no constraints")
[getMeasure(R,e04jaf@Symbol)$RoutinesTable*0.5,string]
else
string := concat(string,"recommended")
[getMeasure(R,e04jaf@Symbol)$RoutinesTable, string]
[0.0,string]
numericalOptimization(args:NOA) ==
argsFn:EDF := args.fn
n:NNI := #(variables(argsFn)$EDF)
ibound:INT := bound(args.lb,args.ub)
m:INT := n
lw:INT := max(13,12 * m + ((m * (m - 1)) quo 2)$INT)$INT
bl := mat(finiteBound(args.lb,float(1,6,10)$DF),n)
bu := mat(finiteBound(args.ub,float(1,6,10)$DF),n)
x := mat(args.init,n)
ArgsFn:EF := edf2ef(argsFn)
fr:Union(fn:FileName,fp:Asp24(FUNCT1)) := [retract(ArgsFn)$Asp24(FUNCT1)]
out:Result := e04jaf(n,ibound,n+2,lw,bl,bu,x,-1,fr)
changeNameToObjf(f@Symbol,out)
|