home *** CD-ROM | disk | FTP | other *** search
-
- ────────────────────────────────────────────────────────────
- ────────────────────────────────────────────────────────────
-
- DOCTOR MATRIX
- Version 1.00
-
- ────────────────────────────────────────────────────────────
-
- Shareware Vector and Matrix Algebra
- Programming Package for C++
-
- ────────────────────────────────────────────────────────────
-
- FUNCTION REFERENCE
-
- ────────────────────────────────────────────────────────────
-
- by Zvika Ben-Haim
-
- ────────────────────────────────────────────────────────────
- ────────────────────────────────────────────────────────────
-
-
-
- ────────────────────────────────────────────────────────────
- TABLE OF CONTENTS
- ────────────────────────────────────────────────────────────
-
- GENERAL NOTES
-
- VECTOR OPERATORS
- Addition
- Assignment (=)
- Equality
- Input (>>)
- Multiplication by Scalar
- Multiplication (Dot Product)
- Output (<<)
- Subscript
- Subtraction (Binary)
- Subtraction (Unary)
-
- VECTOR MEMBER FUNCTIONS
- Absolute Value
- Alignment
- Constructors
- Destructor
- Leading Element
- Length (Order)
- Transpose
-
- MATRIX OPERATORS
- Addition
- Assignment (=)
- Equality
- Input (>>)
- Multiplication by Scalar
- Multiplication (Matrix by Matrix)
- Output (<<)
- Subscript
- Subtraction (Binary)
- Subtraction (Unary)
-
- MATRIX MEMBER FUNCTIONS
- Canonized Matrix, Equivalent
- Column
- Constructors
- Destructor
- Determinant
- Equivalent Matrices, see Canonized and Stepped Matrices
- Invert
- Leading Element
- Number of Columns
- Number of Rows
- Rank
- Row
- Stepped Matrix, Equivalent
- Trace
- Transpose
-
- MATRIX PROPERTIES
- Antisymmetric Matrix
- Diagonal Matrix
- Identity Matrix
- Regular (Invertible) Matrix
- Scalar Matrix
- Singular (Non-Invertible) Matrix
- Square Matrix
- Stepped Matrix
- Symmetric Matrix
-
- LIST OF ERROR MESSAGES
-
-
- ────────────────────────────────────────────────────────────
- GENERAL NOTES
- ────────────────────────────────────────────────────────────
- The following list describes all of the functions and
- operators supported by Doctor Matrix. Basic familiarity with
- Doctor Matrix classes is assumed. It is recommended that you
- read the Programmer's Guide before using the more advanced
- functions described here. Furthermore, a basic understanding
- of the C++ class mechanism is highly recommended.
- Throughout this document, the word `scalar', where it
- refers to a data type, is to be understood as an object of
- the data type of the elements of the matrix or vector in
- question.
- In general, whenever an error is encountered, a message
- is sent to the `cerr' stream. When such an error is
- reported, the value returned by the function is meaningless,
- and is to be ignored. However, all such cases can
- effectively be avoided by checking the validity of the
- parameters passed to the function before calling it. For
- instance, to avoid the `Subscript out of range' error, the
- programmer should call the member functions len() (for
- vectors) or nrows() and ncols() (for matrices), and ensure
- that the subscripts are within the range returned by these
- functions. The only exception is the "out of memory" errors,
- which cause the program to abort. A full list of errors and
- their explanations is supplied at the end of this document.
-
-
- ────────────────────────────────────────────────────────────
- VECTOR OPERATORS
- ────────────────────────────────────────────────────────────
-
- ADDITION
- ────────────────────────────────────────────────────────────
- Syntax: v1+v2
- Operands:v1 and v2 must be vectors of the same order and
- data type
- Returns: The sum of v1 and v2
- Notes: The sum of two vectors is defined as the sum of
- their respective elements. In particular, if
- S=v1+v2, then S(i)=v1(i)+v2(i) for all i.
-
- ASSIGNMENT
- ────────────────────────────────────────────────────────────
- Syntax: v1=v2;
- Operands:v1 and v2 must be vectors of the same type
- Returns: v2 is copied into v1, and is also the return value
- Notes: v1's new alignment, order and elements are equal
- to those of v2.
- The effect of this operator is equal in all
- respects to the effects of Form 4 of the
- constructor. The operator is required for reasons
- of internal memory management.
-
- EQUALITY
- ────────────────────────────────────────────────────────────
- Syntax: v1==v2
- Operands:v1 and v2 must be vectors of the same data type
- Returns: TRUE (1) if v1 is equal to v2; FALSE (0) otherwise
- Notes: Two vectors v1 and v2 are said to be equal if they
- are of the same order and alignment and if all
- elements in v1 are equal to their corresponding
- elements in v2. In other words, v1(i)==v2(i) for
- all i.
-
- INPUT (>>)
- ────────────────────────────────────────────────────────────
- Syntax: istr >> v;
- Operands:istr is any object of type istream or derived
- types, e.g. cin
- v is any vector
- Returns: istr
- Notes: The contents of v are overwritten with values
- entered from the specified stream. The number of
- items read from the stream is equal to the order
- of the vector. The vector preserves its original
- alignment.
-
- MULTIPLICATION BY SCALAR
- ────────────────────────────────────────────────────────────
- Syntax: a*v
- Operands:v is any vector
- a is any number of data type equal to that of the
- vector's elements, or a type that can be
- implicitly cast to the vector's elements (e.g. a
- Vector<float> can be multiplied by ints)
- Returns: The product of a and v
- Notes: The product of a scalar by a vector is a vector of
- the same order and alignment as the original, in
- which all elements are equal to the original
- elements multiplied by the scalar. For instance,
- if P=n*V then P(i)=n*V(i) for all i.
-
- MULTIPLICATION (DOT PRODUCT)
- ────────────────────────────────────────────────────────────
- Syntax: v1*v2
- Operands:v1 and v2 are vectors of the same data type and
- order
- v1 is aligned horizontally and v2 is aligned
- vertically
- Returns: The dot product v1.v2, which is a scalar of the
- same type as the elements of v1 and v2
- Notes: The scalar product (or dot product) of v1 and v2
- is equal to |v1|*|v2|*cos , where |vn| is the
- length of the vector vn, and is the angle between
- v1 and v2. It can be shown that this is also equal
- to:
- v1(1)*v2(1) + v1(2)*v2(2) + ... + v1(n)*v2(n)
- where n is the order of the two vectors.
- Notice that the vector alignment must be as
- defined above, otherwise an error is generated.
-
- OUTPUT (<<)
- ────────────────────────────────────────────────────────────
- Syntax: ostr << v;
- Operands:ostr is any object of type ostream or derived
- types, e.g. cout
- v is any vector
- Returns: ostr
- Notes: The elements of v are displayed, starting at the
- current cursor position. The elements are
- separated by `\n' (for vertically aligned vectors)
- or `\t' (for horizontally aligned vectors). No
- delimiter is added after the final element.
-
- SUBSCRIPT
- ────────────────────────────────────────────────────────────
- Syntax: v(i)
- Operands:v is any vector
- i is an integer between 1 and the order of v
- Returns: Reference to the i-th element in v
- Notes: The first element is v(1), as opposed to C/C++
- arrays, in which the first element is a[0].
-
- SUBTRACTION (BINARY)
- ────────────────────────────────────────────────────────────
- Syntax: v1-v2
- Operands:v1 and v2 must be vectors of the same order and
- data type
- Returns: The difference between v1 and v2
- Notes: The difference between two vectors is defined as
- the difference between their respective elements.
- In particular, if S=v1-v2, then S(i)=m1(i)-m2(i)
- for all i.
-
- SUBTRACTION (UNARY)
- ────────────────────────────────────────────────────────────
- Syntax: -v
- Operands:v can be any vector type
- Returns: The additive inverse of v, which is a vector of
- the same type, order and alignment
- Notes: The additive inverse is a vector vtag, such that
- v+vtag is equal to a vector containing only
- zeroes. It follows that for all i, v(i)=-vtag(i).
-
-
- ────────────────────────────────────────────────────────────
- VECTOR MEMBER FUNCTIONS
- ────────────────────────────────────────────────────────────
-
- ABSOLUTE VALUE
- ────────────────────────────────────────────────────────────
- Syntax: v.abs()
- Parameters: None
- Returns: Scalar equal to the length (or absolute value) of
- v
- Notes: The abosulte value of a vector is equal to the
- following:
- sqrt(v(1)*v(1) + v(2)*v(2) + ... + v(n)*v(n))
- The geometric meaning of this value is the length
- of the vector v.
- This member function can be used only if
- MATH_FUNCS is defined. See the Programmer's Guide
- for more information on the MATH_FUNCS setting.
-
- ALIGNMENT
- ────────────────────────────────────────────────────────────
- Syntax: v.align()
- Parameters: None
- Returns: If v is aligned horizontally (default), return
- value is V_HORIZ (0). Otherwise, return value is
- V_VERT (1).
- Notes: The return value is of an enumeration type called
- V_ALIGN.
-
- CONSTRUCTORS
- ────────────────────────────────────────────────────────────
- Syntax: Form 1: Vector<type> v(order);
- Form 2: Vector<type> v(order, V_VERT);
- Form 3: Vector<type> v(order, V_HORIZ);
- Form 4: Vector<type> v=v2;
- Parameters: type is any numeric data type (such as float,
- int, etc.) or any numeric class (see below)
- order is an integer specifying the number of
- elements in the vector
- V_VERT (1) or V_HORIZ (0) can optionally be added
- to specify the vector's alignment. If no alignment
- is specified, the vector is assumed to be aligned
- horizontally (V_HORIZ). The enumeration V_ALIGN
- defines the two alignment types.
- In Form 4, v2 must be of the same type as the new
- vector. The new vector will have the order,
- alignment and exact same elements as the original.
- Notes: Numeric classes used as data types must support
- arithmetic operators, assignment operators (=, +=,
- etc.), the equality operator (==), and stream
- operators (<< and >>). They must also support
- implicit casting from type int. If MATH_FUNCS is
- included, an sqrt() function receiving and
- returning an object of this type must also be
- supplied.
-
- DESTRUCTOR
- ────────────────────────────────────────────────────────────
- The destructor is invoked transparently by the
- compiler when a static Vector object goes out of
- scope or when a dynamic Vector object is deleted.
- The destructor frees dynamic memory which is
- internally used by the Vector class.
-
- LEADING ELEMENT
- ────────────────────────────────────────────────────────────
- Syntax: lead()
- Parameters: None
- Returns: Integer specifying the location of the leading
- element in v
- Notes: The leading element in a vector is the first
- nonzero element, going from left to right (or from
- top to bottom, in vertically aligned vectors).
-
- LENGTH (ORDER)
- ────────────────────────────────────────────────────────────
- Syntax: v.len()
- Parameters: None
- Returns: Integer specifying the order (or number of
- elements) of the vector v
- Notes: The last element in v is accessed using
- v(v.len()).
-
- TRANSPOSE
- ────────────────────────────────────────────────────────────
- Syntax: v.T()
- Parameters: None
- Returns: A vector which is the transpose of v
- Notes: The transposed vector is of the same type and
- order as v, and contains the same elements in the
- same order, but its alignment is opposite: if v is
- aligned vertically, then v.T() is aligned
- horizontally, and vice versa.
-
-
-
- ────────────────────────────────────────────────────────────
- MATRIX OPERATORS
- ────────────────────────────────────────────────────────────
-
- ADDITION
- ────────────────────────────────────────────────────────────
- Syntax: m1+m2
- Operands:m1 and m2 must be matrices of the same order and
- data type
- Returns: The sum of m1 and m2
- Notes: The sum of two matrices is defined as the sum of
- their respective elements. In particular, if
- S=m1+m2, then S(i,j)=m1(i,j)+m2(i,j) for all i,j.
-
- ASSIGNMENT
- ────────────────────────────────────────────────────────────
- Syntax: m1=m2;
- Operands:m1 and m2 must be matrices of the same type
- Returns: m2 is copied into m1, and is also the return value
- Notes: m1's new alignment, order and elements are equal
- to those of m2.
- The effect of this operator is equal in all
- respects to the effects of Form 2 of the
- constructor. The operator is required for reasons
- of internal memory management.
-
- EQUALITY
- ────────────────────────────────────────────────────────────
- Syntax: m1==m2
- Operands:m1 and m2 must be matrices of the same data type
- Returns: TRUE (1) if m1 is equal to m2; FALSE (0) otherwise
- Notes: Two matrices m1 and m2 are said to be equal if
- they are of the same order and if all elements in
- m1 are equal to their corresponding elements in
- m2. In other words, m1(i,j)==m2(i,j) for all i,j.
-
- INPUT (>>)
- ────────────────────────────────────────────────────────────
- Syntax: istr >> m;
- Operands:istr is any object of type istream or derived
- types, e.g. cin
- m is any matrix
- Returns: istr
- Notes: The elements of m are overwritten with values
- entered from the specified stream. The matrix
- preserves its original order. If the matrix has i
- rows and j columns, the total number of items read
- from istr is i*j.
-
- MULTIPLICATION BY SCALAR
- ────────────────────────────────────────────────────────────
- Syntax: a*m
- Operands:m is any matrix
- a is any number of data type equal to that of the
- matrix elements, or a type that can be implicitly
- cast to the matrix elements type (e.g. a
- Vector<float> can be multiplied by ints)
- Returns: The product of a and m
- Notes: The product of a scalar by a matrix is a matrix of
- the same order as the original, in which all
- elements are equal to the original respective
- elements multiplied by the scalar. For instance,
- if P=n*M then P(i,j)=n*M(i,j) for all i,j.
-
- MULTIPLICATION (MATRIX BY MATRIX)
- ────────────────────────────────────────────────────────────
- Syntax: m1*m2
- Operands:m1 and m2 are matrices of the same type, and the
- number of columns in m1 is equal to the number of
- rows in m2
- Returns: A matrix containing the product of the two
- matrices. The type of the matrix is the same as
- the type of the original matrices. The number of
- rows in the result is equal to the number of rows
- in m1, and the number of columns in the result is
- equal to the number of columns in m2.
- Notes: If R=m1*m2, then R(i,j) is given by:
- R(i,j) = m1(i,1)*m2(1,j) + m1(i,2)*m2(2,j) + ... +
- m1(i,k)*m2(k,j)
- where k is the number of columns in m1, and also
- the number of rows in m2.
-
- OUTPUT (<<)
- ────────────────────────────────────────────────────────────
- Syntax: ostr << m;
- Operands:ostr is any object of type ostream or derived
- types, e.g. cout
- m is any matrix
- Returns: ostr
- Notes: The elements of m are displayed, starting at the
- current cursor position. The elements in each row
- are separated by `\t', and the rows are separated
- from each other by `\n'. No delimiter is added
- after the final element.
-
- SUBSCRIPT
- ────────────────────────────────────────────────────────────
- Syntax: m(i,j)
- Operands:m is any matrix
- i is an integer between 1 and the number of rows
- in m
- j is an integer between 1 and the number of
- columns in m
- Returns: Reference to element in the i-th row and j-th
- column in m
- Notes: The first element is m(1,1), and not m(0,0).
-
- SUBTRACTION (BINARY)
- ────────────────────────────────────────────────────────────
- Syntax: m1-m2
- Operands:m1 and m2 must be matrices of the same order and
- data type
- Returns: The difference between m1 and m2
- Notes: The difference between two matrices is defined as
- the difference between their respective elements.
- In particular, if S=m1-m2, then S(i,j)=m1(i,j)-
- m2(i,j) for all i,j.
-
- SUBTRACTION (UNARY)
- ────────────────────────────────────────────────────────────
- Syntax: -m
- Operands:m can be any matrix
- Returns: The additive inverse of m, which is a matrix of
- the same type and order
- Notes: The additive inverse is a matrix mtag, such that
- m+mtag is equal to a mastrix containing only
- zeroes. It follows that for all i and j, m(i,j)=-
- mtag(i,j).
-
-
-
- ────────────────────────────────────────────────────────────
- MATRIX MEMBER FUNCTIONS
- ────────────────────────────────────────────────────────────
-
- CANONIZED MATRIX, EQUIVALENT
- ────────────────────────────────────────────────────────────
- Syntax: m.canon()
- Parameters: None
- Returns: The equivalent, canonical matrix
- Notes: A canonical matrix is a matrix which satisfies the
- follows:
- (a) it is stepped (see the step() function);
- (b) all leading elements are 1;
- (c) a column containing a leading element can
- contain only zeroes, except for the leading
- element itself.
- Two matrices are said to be equivalent if one can
- be obtained from the other using a series of
- allowed operations. Allowed operations are
- operations of the following forms:
- (1) Rn = Rn + k*Ri
- (2) Rn and Ri are switched
- Where Rn and Ri are the n-th and i-th rows in the
- matrix (treated as vectors), and k is any real
- number.
- Any matrix has only one equivalent canonical
- matrix, so that two matrices are equivalent if,
- and only if, their canonical matrices are
- identical.
-
- COLUMN
- ────────────────────────────────────────────────────────────
- Syntax: m.col(i)
- Parameters: i is an integer specifying the column number
- to be returned
- Returns: Vector containing the elements of column i
- Notes: The returned vector is a copy of the elements in
- the i-th column. Changing the returned vector does
- not alter the actual elements in the original
- matrix.
-
- CONSTRUCTORS
- ────────────────────────────────────────────────────────────
- Syntax: Form 1: Matrix<type> m(i,j);
- Form 2: Matrix<type> m = mtag;
- Parameters: type is any allowed data type
- i is an integer specifying the number of rows
- j is an integer specifying the number of columns
- mtag is any matrix of the same type as the new
- matrix
- Notes: In Form 1, a new matrix is allocated and its
- elements are uninitialized. In Form 2, a new
- matrix is created having the same order as the
- specified matrix, and containing elements equal to
- their respective elements in mtag.
-
- DESTRUCTOR
- ────────────────────────────────────────────────────────────
- The destructor is invoked transparently by the
- compiler when a static Vector object goes out of
- scope or when a dynamic Vector object is deleted.
- The destructor frees dynamic memory which is
- internally used by the Vector class.
-
- DETERMINANT
- ────────────────────────────────────────────────────────────
- Syntax: m.det()
- Parameters: None
- Returns: The determinant of m (of type equal to the type of
- the matrix elements)
- Notes: The determinant of a square matrix of order 2-by-2
- is equal to:
- m(1,1)*m(2,2) - m(1,2)*m(2,1)
- The determinant of a square matrix of order n-by-n
- is defined recursively as being equal to:
- m(1,1)*mwithout11.det() - m(2,2)*mwithout22.det() +
- + ... + m(n,n)*mwithoutnn.det()
- where mwithoutkk is a matrix equal to m, but with
- the k-th row and k-th column removed. Notice that
- the signs of the sum are alternating.
-
- INVERT
- ────────────────────────────────────────────────────────────
- Syntax: m.inv()
- Parameters: m is any square, regular matrix
- Returns: The inverse of matrix m
- Notes: If q is the inverse of m, then q*m=m*q=I, where I
- is the identity matrix of that order.
-
- LEADING ELEMENT
- ────────────────────────────────────────────────────────────
- Syntax: m.lead(i)
- Parameters: m is any matrix with x rows
- i is an integer between 1 and x
- Returns: The location of the leading element in row i
- Notes: The leading element of a row is the first nonzero
- element in that row.
-
- NUMBER OF COLUMNS
- ────────────────────────────────────────────────────────────
- Syntax: m.ncols()
- Parameters: None
- Returns: Number of columns in m
-
- NUMBER OF ROWS
- ────────────────────────────────────────────────────────────
- Syntax: m.nrows()
- Parameters: None
- Returns: Number of rows in m
-
- RANK
- ────────────────────────────────────────────────────────────
- Syntax: m.rank()
- Parameters: None
- Returns: The rank of the matrix (integer)
- Notes: The rank of a matrix is the number of independent
- rows in that matrix. A set of rows
- R(1), R(2),... R(n) is said to be independent if
- there are no coefficients a(1), a(2),... a(n),
- such that one of the rows (for instance R(n)) can
- be described as:
- R(n) = a(1)*R(1) + a(2)*R(2) + ... a(n-1)*R(n-1)
- where each row is considered to be a vector.
- It can be shown that all equivalent matrices have
- the same rank (but not all matrices of the same
- rank are equivalent).
- If you have already found an equivalent steppeor
- canonical matrix of the matrix m, checking the
- rank on the equivalent matrix (rather than on m
- itself) will give the same result and work much
- faster.
-
- ROW
- ────────────────────────────────────────────────────────────
- Syntax: m.row(i)
- Parameters: i is an integer specifying the row number to
- be returned
- Returns: Vector containing the elements of row i
- Notes: The returned vector is a copy of the elements in
- the i-th row. Changing the returned vector does
- not alter the actual elements in the original
- matrix.
-
- STEPPED MATRIX, EQUIVALENT
- ────────────────────────────────────────────────────────────
- Syntax: m.step()
- Parameters: None
- Returns: An equivalent, stepped matrix
- Notes: A stepped matrix is a matrix in which:
- (a) all rows containing only zeroes are at the
- bottom of the matrix (in the highest-index
- rows);
- (b) for every row except zero rows, the leading
- element is at least one place to the right of
- the leading element in the previous row.
- Two matrices are said to be equivalent if one can
- be obtained from the other using a series of
- allowed operations. Allowed operations are
- operations of the following forms:
- (1) Rn = Rn + k*Ri
- (2) Rn and Ri are switched
- Where Rn and Ri are the n-th and i-th rows in the
- matrix (treated as vectors), and k is any real
- number.
- Finding an equivalent, stepped matrix is useful,
- among other things, to determine matrix rank, to
- solve linear equations and to invert matrices.
- Equivalent matrices have the same rank, and
- stepped matrices are ranked very quickly compared
- to non-stepped matrices. If you intend to find
- both the rank of a matrix and an equivalent
- stepped matrix, perform the rank check on the
- stepped matrix to increase execution speed.
-
- TRACE
- ────────────────────────────────────────────────────────────
- Syntax: m.tr()
- Parameters: None
- Returns: The trace of the given matrix
- Notes: The trace of a square matrix is defined as the sum
- of the diagonal elements (those having a row index
- equal to their column index).
-
- TRANSPOSE
- ────────────────────────────────────────────────────────────
- Syntax: m.T()
- Parameters: None
- Returns: The transposed matrix of m
- Notes: The transpose of a matrix is a matrix in which
- each row was rewritten as a column, and vice
- versa. Thus element (i,j) in m will be found as
- element (j,i) in m.T().
- Writing values into m.T() has no effect. To change
- the values in the transposed matrix, use the
- syntax:
- Matrix m2 = m.T();
-
-
-
-
- ────────────────────────────────────────────────────────────
- MATRIX PROPERTIES
- ────────────────────────────────────────────────────────────
- All of these functions take no parameters, and return a
- value of type BOOL. A return value of TRUE indicates the
- matrix possesses the specified property. A return value of
- FALSE specifies the matrix does not possess the specified
- property, including cases where matrices of that type cannot
- possess the specified property (e.g. diag() for a non-square
- matrix).
-
- ANTISYMMETRIC MATRIX
- ────────────────────────────────────────────────────────────
- Syntax: m.antisym()
- Returns TRUE if the specified matrix is antisymmetric. An
- antisymmetric matrix is a square matrix that satisfies the
- following property: For all i and j, m(i,j)=m(j,i). It
- follows from this that the diagonal of such a matrix
- contains only zeroes.
-
- DIAGONAL MATRIX
- ────────────────────────────────────────────────────────────
- Syntax: m.diag()
- Returns TRUE if the specified matrix is diagonal. A diagonal
- matrix is a square matrix that contains zeroes in all
- elements except for the diagonal, that is, except for the
- elements of the form m(i,i) for all i.
-
- IDENTITY MATRIX
- ────────────────────────────────────────────────────────────
- Syntax: m.iden()
- Returns TRUE if the specified matrix is the identity matrix.
- The identity matrix is a diagonal matrix containing only the
- number 1 in its diagonal.
-
- REGULAR MATRIX
- ────────────────────────────────────────────────────────────
- Syntax: m.reg()
- Returns TRUE if the specified matrix is square and regular.
- A regular matrix is one that has an inverse.
-
- SCALAR MATRIX
- ────────────────────────────────────────────────────────────
- Syntax: m.scalar()
- Returns TRUE if the specified matrix is scalar. A scalar
- matrix is a matrix that can be obtained by multiplying the
- identity matrix by a scalar.
-
- SINGULAR MATRIX
- ────────────────────────────────────────────────────────────
- Syntax: m.sing()
- Returns TRUE if the matrix is either non-square or singular.
- A singular matrix is one that has no inverse.
-
- SQUARE MATRIX
- ────────────────────────────────────────────────────────────
- Syntax: m.square()
- Returns TRUE if the specified matrix is square. A square
- matrix has the same number of rows and columns.
-
- STEPPED MATRIX
- ────────────────────────────────────────────────────────────
- Syntax: m.stepped()
- Returns TRUE if the specified matrix is stepped. A matrix is
- stepped if it satisfies the following conditions:
- (a) all rows containing only zeroes are at the bottom of the
- matrix (in the highest-index rows);
- (b) for every row except zero rows, the leading element is
- at least one place to the right of the leading element
- in the previous row.
-
-
- SYMMETRIC MATRIX
- ────────────────────────────────────────────────────────────
- Syntax: m.sym()
- Returns TRUE if the specified matrix is symmetric. A
- symmetric matrix is a square matrix that satisfies
- m(i,j)=m(j,i) for all i and j.
-
-
-
- ────────────────────────────────────────────────────────────
- LIST OF ERROR MESSAGES
- ────────────────────────────────────────────────────────────
- Error messages are printed when a critical error has
- occured, or when the function called has no other way of
- informing the program and/or user that an error has occured.
- Error messages are sent to cerr and can be redirected by the
- programmer.
-
- Not enough memory to allocate vector!
- Not enough memory to create matrix!
- ────────────────────────────────────────────────────────────
- There is not enough memory for a dynamic allocation
- during construction of a vector or matrix. If you are
- using a tiny, small or medium memory model, switch to a
- larger memory model (registered version only).Try to
- free up memory by using operators new and delete to
- construct memory-intensive classes when they are
- required and destroy them as soon as they are not
- needed. Avoid large wide-scope objects, including
- global and static objects. If you are compiling for
- Windows, increase the size of the local memory heap.
- If all else fails, you may consider overloading
- operators new and delete to allocate dynamic memory
- from EMS or XMS (under DOS), or to allocate memory from
- the global heap (under Windows). For this to reduce
- memory use of Dr. Matrix classes, you will need to
- purchase Doctor Matrix Pro.
- You will also get this message if you attempt to create
- a vector or matrix with a non-positive number of rows
- or columns.
-
- Not enough memory!
- ────────────────────────────────────────────────────────────
- This error occurs when an internal dynamic memory
- allocation has failed, probably due to a shortage of
- available dynamic memory.
- See the above error for information on freeing up more
- memory.
-
- Subscript out of range - #
- Subscript out of range - (#,#)
- Subscript out of range - Matrix::row(#)!
- Subscript out of range - Matrix::col(#)!
- Subscript out of range - Matrix::lead(#)!
- ────────────────────────────────────────────────────────────
- The subscript operator was used to obtain an element of
- a vector or matrix, but the index was out of range for
- the specified object. The requested index is indicated.
- The special forms appear when a function requiring a
- subscript as a parameter receives an invalid subscript.
- The requested subscript is indicated, along with the
- function name and the class of which it is a member.
- You will also get this error message if you enter a non-
- positive number as a subscript.
-
- Lengths of added vectors must be identical!
- Lengths of subtracted vectors must be identical!
- ────────────────────────────────────────────────────────────
- Two vectors which were added using the addition
- operator, or subtracted using the subtraction operator,
- are not of equal length. Only equal vectors can be
- added to one another.
-
- Orientation of both vectors in vector sum must be identical!
- Orientation of both vectors in vector subtraction must be
- identical!
- ────────────────────────────────────────────────────────────
- You attempted to add or subtract two vectors with the
- same number of items, but with different alignment.
- Only vectors with the same alignment can be added to or
- subtracted from one another.
- To change the alignment of a vector, use the transpose
- function.
-
- Both vectors must be the same length!
- ────────────────────────────────────────────────────────────
- You have attempted to multiply two vectors of different
- lengths. Only vectors of identical lengths can be
- multiplied by one another.
-
- Orientation of first vector in vector product must be
- horizontal!
- Orientation of second vector in vector product must be
- vertical!
- ────────────────────────────────────────────────────────────
- When multiplying two vectors by one another, the first
- vector must be aligned horizontally and the second must
- be aligned vertically.
- You can change the alignment of a vector using the
- transpose function.
-
- Trace function can only be used on square matrices!
- ────────────────────────────────────────────────────────────
- The trace function tr() can only be performed on square
- matrices, but you attempted to perform a trace function
- on a non-square matrix.
-
- Added matrices must have identical dimensions!
- Subtracted matrices must have identical dimensions!
- ────────────────────────────────────────────────────────────
- In order to add or subtract two matrices, they must
- have the same number of rows and columns.
-
- Undefined matrix multiplication!
- ────────────────────────────────────────────────────────────
- You have attempted to multiply two matrices by one
- another, but the matrices dnot have the correct
- dimensions in order to be multiplied. The number of
- columns in the left operand must equal the number of
- rows in the right operand.
-
- Can't calculate determinant of non-square matrix!
- Attempting to invert a non-square matrix!
- ────────────────────────────────────────────────────────────
- You have called a function which works only on square
- matrices from a non-square matrix.
-
- Attempting to invert a singular matrix!
- ────────────────────────────────────────────────────────────
- You have attempted to invert a singular matrix, but
- singular matrices are non-invertible.
- Singular matrices are matrices for which the rank is
- not equal to the number of rows. You can determine
- whether a matrix is singular using the sing() function.
- You can determine whether it is invertible (regular)
- using the reg() function.
-