MATRIX (kmatrix) functions
LIBRARY ROUTINE
lmgdiag - generate a diagonal matrix
LIBRARY CALL
int
lmgdiag(
kobject vec_obj,
int r,
int c,
double cr,
double ci,
int type,
kobject out_obj)
INPUT
- vec_obj - (kobject) vector of diagonal values
- r - number of rows in diagonal matrix
- c - number of columns in diagonal matrix
- cr - real part of constant diagonal value
- ci - imaginary part of constant diagonal value
- type - data type for matrix (FLOAT,DOUBLE,COMPLEX,DCOMPLEX)
OUTPUT
- out_obj - output matrix object
RETURN VALUE
TRUE (1) on success, FALSE (0) otherwise
DESCRIPTION
Generate a diagonal matrix (possible non-square) of
a specified data type and with either a constant
diagonal value (vec_obj == NULL) or non-constant values
(vec_obj != NULL). Matrix size is specified by r and c.
A non-NULL vec_obj overrides any values for cr and ci.
If the vector object is not supplied, then a single
WxH plane matrix will be generated with the specified
constant appearing on the diagonal. If the vector
object is non-NULL, then the matrix will be generated
with the same number of WxH planes as the vector object,
with the values in each vector plane appear on the diagonal
of the coresponding matrix plane. Values are transferred
to the diagonal until either there are no more available for
that plane or the matric boundary has been hit.
If the r and c values are <= 1 and the vector object is
supplied, then the output object will be sized so that the
diagonal will exactly contain all values for a WxH plane
of the vector object.
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
none
RESTRICTIONS
none
MODIFICATION
none
FILES
$MATRIX/objects/library/kmatrix/src/lmgdiag.c
SEE ALSO
kmatrix(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.