vec#

AnsMath.vec(size=0, dtype=<class 'numpy.float64'>, init=None, name=None, asarray=False)#

Create a vector.

Parameters:
sizeint

Size of the vector.

dtypenp.dtype, optional

NumPy data type of the vector. The options are np.double, np.int32, and np.int64. The default is np.double.

initstr, optional

Initialization options. Options are "ones", "zeros", or "rand". The default is "zeros".

namestr, optional

AnsMath vector name. The default is None, in which case a name is automatically generated.

asarraybool, optional

Whether the output is to be a NumPy array vector rather than an AnsMath vector. The default is False.

Returns:
AnsVec or numpy.ndarray

AnsMath vector or NumPy array vector, depending on the value for the asarray parameter.