\(\newcommand{\W}[1]{ \; #1 \; }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }\) \(\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }\) \(\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }\) \(\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }\)
abs_print_mat¶
View page sourceabs_normal: Print a Vector or Matrix¶
Syntax¶
abs_print_mat
( name , nr , nc , mat )Prototype¶
template <class Vector>
void abs_print_mat(
const std::string& name ,
size_t nr ,
size_t nc ,
const Vector& mat )
Purpose¶
This routine is used by the abs_normal examples to print vectors and matrices. A new-line is printed at the end of this output.
name¶
This is a name that is printed before the vector or matrix.
nr¶
This is the number of rows in the matrix. Use nr = 1 for row vectors.
nc¶
This is the number of columns in the matrix. Use nc = 1 for column vectors.
mat¶
This is a row-major representation of the matrix (hence a SimpleVector ). The syntax
std::cout <<
mat
[i
]
must output the i-th element of the simple vector mat .