array#

swordfish.function.array()#

Return a vector.

Parameters:
  • dataType (Union[Alias[Literal["template"]], Constant]) – The data type for the vector.

  • initialSize (Constant, optional) – An existing vector, by default DFLT. The existing vector serves as a template and its data type determines the new vector’s data type.

  • capacity (Constant, optional) – The initial size (in terms of the number of elements) of the vector, by default DFLT. When the number of elements exceeds capacity, the system will first allocate memory of 1.2~2 times of capacity, copy the data to the new memory space, and release the original memory.

  • defaultValue (Constant, optional) – The default value of the vector, by default DFLT