|
new
|
The new function creates a new instance of a complex vector with optional
initialization of the elements of the new vector. Like a pair, a list, or other vectors,
a complex vector can have a tail. The tail can be of any type, but it is most often used
to store a complex number. The number of complex numbers that can be stored in the
vector is specified by a length. A single tilde (~) can be substituted for the length.
In this case, the number of elements is determined by the number of initial values
provided following the tilde. The first two initial values specify the real part and the imaginary part of the first
complex number, respectively. If only one value is specified, the imaginary part is taken
to be zero. If no initial values are provided, the initial value of the elements in the
array are all zero. If fewer than len pairs of values are provided, then the initial
values are repeated until all of the elements are initialized. If more than len pairs
are provided, the extra values are ignored.
Use the new function to create a new vector object and initialize it with some values.
(new Vector: size) (new Vector: subtype: size ) (new Vector: subtype: size initialValues ) A Vector Object.
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Here are the links to the data types of the function arguments. Here are also a number of links to functions having arguments with any of these data types.
You can always talk with the AIS at aiserver.sourceforge.net.
Name
Description
AIS Types Vector: Mandatory keyword Symbol subtype: An optional argument. If present it must be one of the following types:
Word:
Bit:
Integer:
Float:
Number:
Short:
Object:
Pcode:
Short:
If omitted, then the default will be a word vector. Symbol size An integer indicating how many elements in the vector. Integer initialValues An optional argument. If present, it must be a list of initial values, each
value separated by a space. If no initial values are specified, the vector
is filled with zeros. If too few initial values are specified, the vector
is filled with repeating patterns of initial values. Character String Symbol Vector BitVector ByteVector IntVector
FltVector ObjVector Structure Dictionary Directory
Matrix NumMatrix Integer Float Number Complex Boolean
Returns:
Examples
Argument Types
How do I contact the AIS team?