From: Eric S. Raymond Date: Mon, 28 Jun 2004 16:04:57 +0000 (+0000) Subject: Index up to Matrices. X-Git-Tag: 1.0~11 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=17f4e5c41bbf6b6b6430074e93f07e6ffe880771;p=mad.git Index up to Matrices. --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index 57bc972..6243c3e 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -689,6 +689,8 @@ iteration box, (not related to the example above) might be: increasing it by the amount 3 after each time until either α > 90, or |x + y| ≤ ε. +Iteration Statement + We shall abbreviate this by the form: @@ -1863,6 +1865,9 @@ to be performed by its presence or absence. THROUGH (Iteration) Statement +Iteration Statement +Iteration Variable + The following program segment illustrates the use of this statement. @@ -2016,6 +2021,8 @@ might write the iteration as follows: +Iteration, Nested + THROUGH END, FOR J = 2, .GE. K ... @@ -2231,6 +2238,8 @@ will raise a compile-time error. List Manipulation Statements +List Manipulation + These statements facilitate the writing of recursive internal and external functions. (see ) They cause the designation and use of a vector for the temporary storage of data @@ -3126,13 +3135,15 @@ Vector Variables may be declared to be array variables, such as vectors or matrices of various dimensions, rather than individual variables. - Each array is stored in a region whose elements may be referred to by -means of a single subscript, such as A(0), A(1), B(16), etc. Even -elements of higher dimensional arrays may be referred to in this way -at any time. We shall call the subscript thus associated with each -element of an array its "linear subscript." If A is an array then the -name A is equivalent to A(0), e.e., the name A written without a -subscript is assumed to have a subscript of zero. + Each array is stored in a region whose elements may be referred +to by means of a single subscript, such as A(0), A(1), B(16), etc. +Even elements of higher dimensional arrays may be referred to in this +way at any time. We shall call the subscript thus associated with +each element of an array its "linear +subscript."Linear Subscript +If A is an array then the name A is equivalent to A(0), e.e., the name +A written without a subscript is assumed to have a subscript of +zero. Two dimensional matrices are stored internally by rows, i.e., an m × n matrix will be stored in the order: a11, @@ -3148,6 +3159,8 @@ a1122, ... a112q, ..., a11pq, a1211,..., a1npq, ... amnpq. +Matrix Notation + Elements of higher dimensional arrays may be referred to not only by their linear subscripts but also by the usual matrix notation, such as A(1,1), A(I,J), B(I+6,J/3+3). @@ -3426,6 +3439,7 @@ identical in all sections of the program. Function Definitions Function Definition +INTERNAL FUNCTION @@ -3484,6 +3498,8 @@ Functions Internal Function Definitions +INTERNAL FUNCTION + These statements define functions not yet available in the language or as standard package programs ("subroutines"). The designation "INTERNAL" implies that the definition program which @@ -3563,6 +3579,7 @@ ZQ = SIN.(J * Y).P.(M + 1) - Y/XBAR + COS.(J*Z).P.(M-1)-Z/XBAR. Internal and External Functions Function Definition +INTERNAL FUNCTION Each function definition (except single statement definitions described in ) may define any @@ -3675,6 +3692,7 @@ some Boolean expression. It is important to note that internal function definitions of any kind whatever (including the single statement definition of ) may occur anywhere in the program, +INTERNAL FUNCTION except within another internal function definition. Internal function definitions may occur within external function definitions, however. External function definitions may not occur within any other programs, @@ -3824,6 +3842,8 @@ form: +Iteration Statement + Here the scope of the iteration lies between the hexagonal box and diamond box A, and the calculation proceeds from A when the stated relation is true. @@ -4147,6 +4167,8 @@ program deck. Example 5<emphasis role='note'>: Compute the transpose of a matrix</emphasis> +Matrix Transpose Example + Problem: Find the transpose A' of an n×n matrix A = (aij). @@ -4233,6 +4255,8 @@ compile this example. The problem is the array I/O. Example 7<emphasis role='note'>: Solve simultaneous linear equations</emphasis> +Jordan Elimination Method Example + Problem Solve a system of n ≤ 20 simultaneous linear equations in n unknowns, assuming that one does not encounter a zero on the main diagonal of the coefficient matrix during the @@ -4802,6 +4826,9 @@ character per word in W(1)...W(L). <emphasis role='note'>Example 2: Compute the factorial function</emphasis> Problem: Evaluate the recursive function, + +List Manipulation + f(0) = 1 f(n) = f(n-1) * n @@ -6178,7 +6205,9 @@ example, if A is a 4 x 3 matrix (m = 4, n = 3) and b = 1, then V(1) = Hierarchy of ParenthesesParentheses Individual VariablesSingle Variables Input-Output BlocksBlocks, Input-Output - +Labels, StatementStatement, Labels +List, Input-OutputInput-Output List +MatricesArray Variables