vec#
- AnsMath.vec(size=0, dtype=<class 'numpy.float64'>, init=None, name=None, asarray=False)#
Create a vector.
- Parameters:
- size
int Size of the vector.
- dtype
np.dtype,optional NumPy data type of the vector. The options are
np.double,np.int32, andnp.int64. The default isnp.double.- init
str,optional Initialization options. Options are
"ones","zeros", or"rand". The default is"zeros".- name
str,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.
- size
- Returns:
AnsVecornumpy.ndarrayAnsMath vector or NumPy array vector, depending on the value for the
asarrayparameter.