]> thyrsus.com Git - cupl.git/commitdiff
Added 9-2.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 8 Nov 1994 00:00:04 +0000 (00:00 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 8 Nov 1994 00:00:04 +0000 (00:00 +0000)
cupl.doc

index 46a3c3b0911f24c2de53235265b5071a2a26849b..ea5bfef87f04986b3454a60f8d21bfbbb99060cc 100644 (file)
--- a/cupl.doc
+++ b/cupl.doc
@@ -118,8 +118,8 @@ ELEMENTS OF THE LANGUAGE
                    A(I,J)   refers to the element at the
                               intersection of the ith row
                               and the jth column
-                   A(*,J)   refers to the jth column
-                   A(I,*)   refers to the ith row
+                   A(*,J)   refers to the jth column [see 9-2]
+                   A(I,*)   refers to the ith row    [see 9-2]
 \f
                           A-2
 
@@ -325,7 +325,7 @@ form.
 
      Communication Statements
      ------------------------
-          READ v1, v2, ...   [See 5-2 for description]
+          READ v1, v2, ...   [See 5-2 and 9-2 for description]
 
           WRITE v1, v2, ... , 'title message', ... , /v3, /v4
 
@@ -378,7 +378,7 @@ form.
               later changed by another allocation the values of
               those elements common to the old and the new alloca-
               tions are unchanged; the values of new elements are
-              zero.
+              zero.  [See also 9-1]
 
      Tracing Changes in Value During Execution
      -----------------------------------------
@@ -505,6 +505,36 @@ the form
 
           M = m11      m21      m31     etc.
 
+From 9-1:
+
+Vectors as matrices
+-------------------
+     Consideration of relations involving matrices and vectors can be
+simplified by regarding a vector as a 1-column matrix.  This convention is
+adopted in CUPL, and so, for example
+
+          ALLOCATE X(7)
+
+and
+
+          ALLOCATE X(7, 1)
+
+have precisely the same meaning.  After either of these allocations the
+variables X(2) and X(2, 1) are meaningful and have the same value; X(M, N)
+is meaningful only if N has the value 1.
+
+From 9-2:
+
+     For any matrix M, N(*, J) denotes the 1-column matrix (a vector)
+which is the J-th column of M.  Similarly, M(I, *) denotes the 1-row matrix
+(not a vector) which is the I-th row of M.  If M is m x n, then M(*, J) and
+M(I, *) are m x 1 and 1 x m, and they can be used as matrices of these
+sizes in any statement except ALLOCATE.  For example:
+
+     READ M(*, 3)
+
+will read data into the third column of M, leaving the rest of M unchanged.
+
 From 9-8:
 
      So much space is needed to compute INV(A) or DET(A) that the size of