/usr/share/axiom-20170501/src/algebra/ASP12.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 | )abbrev domain ASP12 Asp12
++ Author: Mike Dewar and Godfrey Nolan
++ Date Created: Oct 1993
++ Date Last Updated: 21 June 1994 Changed print to printStatement
++ References:
++ Hawk95 Two more links to NAG numerics involving CA systems
++ Kead93 Production of Argument SubPrograms in the AXIOM -- NAG link
++ Description:
++ \spadtype{Asp12} produces Fortran for Type 12 ASPs, needed for NAG routine
++ d02kef etc., for example:
++
++ \tab{5}SUBROUTINE MONIT (MAXIT,IFLAG,ELAM,FINFO)\br
++ \tab{5}DOUBLE PRECISION ELAM,FINFO(15)\br
++ \tab{5}INTEGER MAXIT,IFLAG\br
++ \tab{5}IF(MAXIT.EQ.-1)THEN\br
++ \tab{7}PRINT*,"Output from Monit"\br
++ \tab{5}ENDIF\br
++ \tab{5}PRINT*,MAXIT,IFLAG,ELAM,(FINFO(I),I=1,4)\br
++ \tab{5}RETURN\br
++ \tab{5}END\
Asp12(name) : SIG == CODE where
name : Symbol
O ==> OutputForm
S ==> Symbol
FST ==> FortranScalarType
FT ==> FortranType
FC ==> FortranCode
SYMTAB ==> SymbolTable
EXI ==> Expression Integer
RSFC ==> Record(localSymbols:SymbolTable,code:List(FortranCode))
U ==> Union(I: Expression Integer,F: Expression Float,_
CF: Expression Complex Float,switch:Switch)
UFST ==> Union(fst:FST,void:"void")
SIG ==> FortranProgramCategory with
outputAsFortran : () -> Void
++outputAsFortran() generates the default code for \spadtype{ASP12}.
CODE ==> add
import FC
import Switch
real : FST := "real"::FST
syms : SYMTAB := empty()$SYMTAB
declare!(MAXIT,fortranInteger()$FT,syms)$SYMTAB
declare!(IFLAG,fortranInteger()$FT,syms)$SYMTAB
declare!(ELAM,fortranReal()$FT,syms)$SYMTAB
fType : FT := construct([real]$UFST,["15"::Symbol],false)$FT
declare!(FINFO,fType,syms)$SYMTAB
Rep := FortranProgram(name,["void"]$UFST,[MAXIT,IFLAG,ELAM,FINFO],syms)
-- eqn : O := (I::O)=(1@Integer::EXI::O)
code:=([cond(EQ([MAXIT@S::EXI]$U,[-1::EXI]$U),
printStatement(["_"Output from Monit_""::O])),
printStatement([MAXIT::O,IFLAG::O,ELAM::O,_
subscript("(FINFO"::S,[I::O])::O,"I=1"::S::O,"4)"::S::O]),
returns()]$List(FortranCode))::Rep
coerce(u:%):OutputForm == coerce(u)$Rep
outputAsFortran(u:%):Void == outputAsFortran(u)$Rep
outputAsFortran():Void == outputAsFortran(code)$Rep
|