*INIT
*INIT, Name, Method, Val1, Val2, Val3
Initializes a vector or matrix.
Argument Descriptions
NameVector or matrix which will be initialized. This can be a vector (created by the *VEC command), a dense matrix (created by the *DMAT command), or a sparse matrix (created by the *SMAT command).
MethodInitialization method to use:
- ZERO --
Fill the vector/matrix with zeros (default).
- CONST --
Fill the vector/matrix with a constant value.
- RAND --
Fill the vector/matrix with random values.
- DIAG --
Fill the
nth diagonal of the matrix with a constant value. Other values are not overwritten. For this option,Namemust be a dense matrix.- ADIAG --
Fill the
nth anti-diagonal of the matrix with a constant value. Other values are not overwritten. For this option,Namemust be a dense matrix.- CONJ --
Take the complex conjugate of the values in the vector/matrix (no change for non-complex values).
- FILTER --
Initialize a subset of values of a vector using a filtering vector. For this option,
Namemust be a vector.
Val1,Val2,Val3Additional input. The meaning of
Val1throughVal3will vary depending on the specifiedMethod. See details below.
The following Valx fields are used with Method = CONST:
Val1The real part of the constant value to use (default = 0).
Val2The imaginary part of the constant value to use (default = 0). Required only for a complex vector/matrix.
The following Valx fields are used with Method = DIAG or Method = ADIAG:
Val1The number of the diagonal to fill. A zero value (which is the default) indicates the main diagonal (or main anti-diagonal). A positive value indicates an upper diagonal; a negative value indicates a lower diagonal.
Val2The real part of the constant value to use (default = 1).
Val3The imaginary part of the constant value to use (default = 0). Required only for a complex matrix.
The following example demonstrates Method = DIAG:
The following Valx fields are used with Method = FILTER:
Val1The name of an existing integer vector (created by *VEC) to be used as the filter vector. The values in this vector indicate the locations in the
Namevector that are to be initialized toVal2(real value) andVal3(imaginary value, if applicable). Location values higher than the dimension of the original vector are ignored.Val2The real part of the value used for initialization (default = 0).
Val3The imaginary part of the value used for initialization (default = 0); applicable only if the
Namevector contains complex values.