RandomTools Flavor: Vector - Maple Programming Help

Home : Support : Online Help : Programming : Random Objects : RandomTools package : Flavors : RandomTools/flavor/Vector

RandomTools Flavor: Vector

describe a Vector of random objects

 Calling Sequence 'Vector'(flav, n, ... ) 'Vector[o]'(flav, n, ... )

Parameters

 flav - random flavor n - positive integer or a flavor that generates a positive integer density - a numeric value with 0 <= density <= 1 [o] - use either [row] or [column] to specify the orientation of the resulting Vector ... - additional options to the Vector constructor

Description

 • The flavor 'Vector' describes a Vector with n rows (or columns).  Each entry is described by the given random flavor flav.  The default flavor is integer and the default value for n is 10.
 • Specifying [row] or [column] will select if a row or column Vector is generated.  By default, a column vector is generated.
 • The density value is a probability that an entry will be assigned a value.  By default, this value is 1.
 • Additional arguments can be specified that will be passed to the Vector constructor.  For example, datatype, shape,etc.
 This flavor can be used as an argument to RandomTools[Generate] or as part of a structured flavor.

Examples

 > $\mathrm{with}\left(\mathrm{RandomTools}\right):$
 > $\mathrm{Generate}\left('\mathrm{Vector}'\left(\mathrm{integer},3\right)\right)$
 $\left[\begin{array}{c}{-276532064796}\\ {459444310976}\\ {-100885603451}\end{array}\right]$ (1)
 > $\mathrm{Generate}\left('\mathrm{Vector}'\left(\mathrm{rational}\left(\mathrm{denominator}=30\right),2\right)\right)$
 $\left[\begin{array}{c}{-}\frac{{4}}{{5}}\\ \frac{{2}}{{15}}\end{array}\right]$ (2)
 > $H≔\mathrm{Generate}\left('\mathrm{Vector}'\left(\mathrm{float}\left(\mathrm{method}=\mathrm{uniform},\mathrm{range}=0..10\right),5,\mathrm{datatype}=\mathrm{float}\left[8\right]\right)\right)$
 ${H}{≔}\left[\begin{array}{c}{9.57506835434298}\\ {5.46881519204984}\\ {2.78498218867048}\\ {0.975404049994095}\\ {6.32359246225410}\end{array}\right]$ (3)
 > $H≔\mathrm{Generate}\left('\mathrm{Vector}\left[\mathrm{row}\right]'\left(\mathrm{float}\left(\mathrm{range}=0..10,\mathrm{method}=\mathrm{uniform}\right),5,\mathrm{datatype}=\mathrm{float}\left[8\right]\right)\right)$
 ${H}{≔}\left[\begin{array}{ccccc}{4.85375648722841}& {9.57166948242946}& {9.70592781760616}& {1.57613081677548}& {9.64888535199277}\end{array}\right]$ (4)

Compatibility

 • The RandomTools Flavor: Vector command was introduced in Maple 18.