\(\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}} }\)
valvector_element¶
View page sourceAccessing Elements of a valvector¶
Returns a reference to the specified element of this valvector.
Prototype¶
scalar_type& operator[](size_t j)
const scalar_type& operator[](size_t j) const
j¶
This is the index of the element we are accessing.
If the size this valvector is one, j can have any value and the return is the single element in this valvector.
If the size of this valvector is not one, j must be less than its size and the return is the j-th element in this valvector.
Example¶
The file valvector_element.cpp is an example and test of valvector element access.