]> thyrsus.com Git - mad.git/commitdiff
Added example 3.
authorEric S. Raymond <esr@thyrsus,com>
Wed, 18 Feb 2004 11:01:44 +0000 (11:01 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Wed, 18 Feb 2004 11:01:44 +0000 (11:01 +0000)
doc/flowchart.pic
doc/mad-manual.xml

index 4fb2561a05384a0748dd1bf83ecc63ab6f79de15..4c2b1f742d755be70e17b6780cd11c35ee83f6d0 100644 (file)
@@ -1,4 +1,5 @@
 define terminal {box $1 ht 0.3 rad 0.2}
+define bigterminal {box $1 ht 0.6 wid 1.8 rad 0.3}
 
 define diamond {[
    FRAME: box invis "$1" $2 $3 $4
@@ -96,5 +97,7 @@ define label {[
    circle rad 0.2 with .c at FRAME.c
 ]}
 
+
+
 # It would be nice to make this work inside [], but pic refuses
 define annotate {$2 at $1.end + (-0.1,0.1)}
index 694c06066370d3cb4d5b3f484a6652632b6fb4d1..eef3f59afae7002c10a14ca1bac096192ad594b3 100644 (file)
@@ -7,6 +7,8 @@
 <!ENTITY newton2 SYSTEM "../madhouse/newton2.mad">
 <!ENTITY quadratic SYSTEM "../madhouse/quadratic.mad">
 <!ENTITY truthtable SYSTEM "../madhouse/truthtable.mad">
+<!ENTITY simpsfunc SYSTEM "../madhouse/simpsfunc.mad">
+<!ENTITY simpsmain SYSTEM "../madhouse/simpsmain.mad">
 <!ENTITY scope1 SYSTEM "scope1.xml">
 <!ENTITY scope2 SYSTEM "scope2.xml">
 <!ENTITY scope3 SYSTEM "scope3.xml">
@@ -3089,7 +3091,46 @@ external function or an internal function.</para>
   </imageobject>
 </mediaobject>
 
+<para><emphasis>The Program:</emphasis></para>
+
+<programlisting>
+&simpsfunc;
+</programlisting>
+
+<para>If, for some reason, the integral of sin 3x - cos(rx + 1) were
+needed if 0 &le; x &le; 3, and the integral of sin 3x - cos(rx)
+otherwise, the program might then be as follows:</para>
+
+<para><emphasis>The Program:</emphasis></para>
+
+<programlisting>
+&simpsmain;
+</programlisting>
+
+<para><emphasis>External Functions:</emphasis></para>
 
+<programlisting>
+&simpsfunc;
+*DATA
+         0          2.         10          10.
+</programlisting>
+
+<para>An alternate way tio write the first eight lines of this
+program, illustrating one use of the FUNCTION NAME mode, would
+be:</para>
+
+<programlisting>
+READ   READ FORMAT INPUTS,A,B,N,R
+       INTEGER N
+       WHENEVER 0. .LE. R .AND. R .LE. 3
+       S = F1.
+       OTHERWISE
+       S = F2.
+       END OF CONDITIONAL
+       PRINT FORMAT RESULT,A,B,N,R,SIMPS.(A,B,N,S)
+       TRANSFER TO READ
+       FUNCTION NAME S
+</programlisting>
 
 </sect2>
 </sect1>