access element of symbolic object
e: Elem( v, i ) e: v( i ) e: Elem( A, i, j ) e: A( i, j ) B: Elem( A, i, j, s ) A( i, j ) = s
vector or set of symbolic scalars
matrix of symbolic scalars
vector of non-negative integers
vector non-negative integers
symbolic scalar, matrix of symbolic scalars,
matrix of integers, doubles, or strings
symbolic scalar, vector or matrix of symbolic scalars
matrix of symbolic scalars
Returns the i-th element of a vector or set v as symbolic scalar.
If i is a vector of indices, then the corresponding subvector of v is returned.
Returns the element in row i and column j of a matrix A as symbolic scalar.
If i or j are vectors of indices, then the corresponding submatrix of A is returned.Sets the element in row i and column j of a matrix A in-place to s and returns the modified matrix A.
If i or j are vectors of indices, then every element of the corresponding submatrix of A is set to a scalar s or the corresponding submatrix of A if filled one-by-one with the elements of a matrix s.
// create a vector v = %(Vec()) v: int32(1) v: int32(2) v: int32(3) // get 2nd element of v v(2) // get 1st and 3rd element of v as vector v([1,3]) // create a empty set S = %(Set()) // insert elements S: "a" S: "b" S: "c" // get elements of S S(1) S(2) S(3) // create (3,3)-matrix of zeros A = %(Zeros(3,3)) // create a symbol x = %(Sym("x")) // set (2,2)-element of A A(2,2) = 2*x+5 // get a submatrix of A A(1:2,1:3) // set a submatrix of A A(2:3,2:3) = 5*Ones(2,2) // clean-up reset(); clear v S A x; | ![]() | ![]() |
SymEngine: C++ library for fast symbolic manipulation.