Overview
Vectors in Giac are represented using thevecteur type, which is a C++ std::vector<gen>. This provides a flexible container for generic algebraic elements.
Type Definitions
vecteur
Iterator Types
Specialized Matrix Types
Vector Construction
makevecteur
Construct vectors with 1 to 14 elements.Elements to include in the vector
A new vector containing the specified elements
makesequence
Construct sequences (similar to makevecteur but returns gen).mergevecteur
Merge two vectors.First vector
Second vector
Concatenation of v and w
Vector Arithmetic
addvecteur
Add two vectors element-wise.First vector
Second vector
Output parameter for result (in-place version)
Element-wise sum a + b
subvecteur
Subtract vectors element-wise.First vector
Second vector
Element-wise difference a - b
negvecteur
Negate all elements of a vector.Input vector
Vector with all elements negated
Scalar Multiplication
Scalar multiplier
Vector to multiply
Vector with each element multiplied by a
Scalar Division
Vector to divide
Scalar divisor
Vector with each element divided by a
Vector Products
dotvecteur
Compute the dot (scalar) product of two vectors.First vector
Second vector
Scalar product (does not conjugate)
This function does not conjugate. For the standard inner product with conjugation, see
scalarproduct in misc.h.cross
Compute the cross product (3D vectors).First 3D vector
Second 3D vector
Cross product v × w
_cross
Utility Functions
vrows
Get the number of elements in a vector.Input vector
Number of elements in the vector
freecopy
Make a free (modifiable) copy of a vector.Vector to copy
Modifiable copy of the vector
is_fully_numeric
Check if all vector elements are numeric.Vector to check
Fraction/integer handling mode
true if all elements are numeric
is_exact
Check if vector contains only exact values.Vector to check
true if all elements are exact (no floating point)
is_integer_vecteur
Check if all vector elements are integers.Vector to check
Restrict to machine integers only
true if all elements are integers
Type Conversions
vecteur2index
Convert a vector to an index.vector_int2vecteur
Convert integer vector to vecteur.vecteur2vector_int
Convert vecteur to integer vector with modular reduction.See Also
- Matrix Operations - Matrix operations and linear algebra
- Gaussian Elimination - Row reduction and system solving
