<< Variable SYMSCI Toolbox Zeros >>

SYMSCI Toolbox >> SYMSCI Toolbox > Vec

Vec

create a vector of symbolic scalars

Calling Sequence

v: Vec()
v: Vec( a )
v: Vec( b, n )

Arguments

a

vector or matrix of symbolic scalars

b

symbolic scalar, string

n

non-negative integer

v

vector of symbolic scalars

Description

Vec()

Returns an empty vector.

Vec( a )

Returns a vector, which is either a copy of a vector a or contains the concatenated rows of a matrix a.

Vec( b, n)

Returns a vector with n elemtents. For a symbolic scalar b all elements are set to the value of b. For a string b the elements are different symbols named "b" appended by an index "1",..,"n".

Other symbolic object types (scalar, set, or matrix) are created using Sym(..), Set(..), or Mat(..).

Examples

// create an empty symbolic vector
a = %(Vec())

// create a symbol
x = %(Sym("x"))

// add some elements to vector a
a: int32(5)
a: 1.23
a: x

// create a copy of vector a
b = %(Vec(a))

// create a vector c with elements x, x, x
c = %(Vec(x,3))

// create a vector d with elements x1, x2, x3, x4
d = %(Vec("x",4))

// create a vector e from a (2,3)-matrix
e = %(Vec(Mat("a",2,3)))

// clean-up
free(a); free(x); free(b); free(c); free(d); free(e)
clear a x b c d e;

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< Variable SYMSCI Toolbox Zeros >>