*INIT

*INIT, Name, Method, Val1, Val2, Val3
Initializes a vector or matrix.

Compatible Products: – | Pro | Premium | Enterprise | Ent PP | Ent Solver | DYNA

Argument Descriptions

Name

Vector 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).

Method

Initialization 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, Name must 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, Name must 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, Name must be a vector.

Val1, Val2, Val3

Additional input. The meaning of Val1 through Val3 will vary depending on the specified Method. See details below.

The following Valx fields are used with Method = CONST:

Val1

The real part of the constant value to use (default = 0).

Val2

The 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:

Val1

The 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.

Val2

The real part of the constant value to use (default = 1).

Val3

The 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:

Val1

The 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 Name vector that are to be initialized to Val2 (real value) and Val3 (imaginary value, if applicable). Location values higher than the dimension of the original vector are ignored.

Val2

The real part of the value used for initialization (default = 0).

Val3

The imaginary part of the value used for initialization (default = 0); applicable only if the Name vector contains complex values.

Notes

This command initializes a previously defined vector (*VEC), dense matrix (*DMAT), or sparse matrix (*SMAT).

Menu Paths

This command cannot be accessed from a menu.

Release 18.2 - © ANSYS, Inc. All rights reserved.