Skip to content

Section documentation for STACK-Maxima /linearalgebra/vectors

Row and column vector notation available in every question. Use vec_convert to obtain ordinary Maxima matrices for arithmetic and answer tests.

For convenience, c(...) and r(...) are aliases for column_vector(...) and row_vector(...). Enable them by adding stack_linear_algebra_declare(true) to the question variables. They evaluate to the full forms, so expressions, inputs and answer tests use the same vector values. Contributed libraries that previously enabled this notation continue to enable the aliases.


column_vector([entries])

A column vector with comma-separated components, for example column_vector(a,b,c). Available in every question and displayed using the question's matrix delimiters.

This is inert notation: it keeps its column-vector identity instead of immediately evaluating to a matrix. Use vec_convert for matrix arithmetic and answer tests: vec_convert(column_vector(a,b,c)) gives matrix([a],[b],[c]). Matrix and variable-size matrix inputs preserve this constructor in responses.

Argument name type description
entries expressions the comma-separated vector components.
Return type description
column_vector the inert column-vector expression.

row_vector([entries])

A row vector with comma-separated components, for example row_vector(a,b,c). Available in every question and displayed using the question's matrix delimiters.

This is inert notation: it keeps its row-vector identity instead of immediately evaluating to a matrix. Use vec_convert for matrix arithmetic and answer tests: vec_convert(row_vector(a,b,c)) gives matrix([a,b,c]). Matrix and variable-size matrix inputs preserve this constructor in responses.

Argument name type description
entries expressions the comma-separated vector components.
Return type description
row_vector the inert row-vector expression.