\begin{ccRefConcept}{Vector}
\ccCreationVariable{v}

\ccDefinition

An instance of data type \ccc{Vector} is a vector of variables of
number type \ccc{NT}.  Together with the type \ccc{Matrix} it realizes
the basic operations of linear algebra.



\ccSetOneOfTwoColumns{5.5cm}

\ccTypes

\ccNestedType{NT}{the ring type of the components.  }

\ccNestedType{iterator}{the iterator type for accessing components.  }

\ccNestedType{const_iterator}{the const iterator type for accessing
  components.  }

\ccCreationVariable{v}

\ccSetOneOfTwoColumns{3.5cm}

\ccCreation

\ccConstructor{Vector()}{creates an instance \ccc{v} of type
  \ccc{Vector}.  }

\ccConstructor{Vector(int d)}{creates an instance \ccc{v} of type
  \ccc{Vector}.  \ccc{v} is initialized to a vector of dimension $d$.
  }

\ccConstructor{Vector(int d, NT x)}{creates an instance \ccc{v} of
  type \ccc{Vector}.  \ccc{v} is initialized to a vector of dimension
  $d$ with entries \ccc{x}.  }

\ccConstructor{template <class Forward_iterator>
  Vector(Forward_iterator first, Forward_iterator last)}{creates an
  instance \ccc{v} of type \ccc{Vector}; \ccc{v} is initialized to the
  vector with entries \ccc{set [first,last)}. \ccRequire
  \ccc{Forward_iterator} has value type \ccc{NT}.  }

\ccSetTwoOfThreeColumns{2cm}{3cm}

\ccOperations

\ccMethod{int dimension() ;}{returns the dimension of \ccc{v}.}

\ccMethod{bool is_zero() ;}{returns true iff \ccc{v} is the zero
  vector.}

\ccMethod{NT& operator[](int i) ;}{returns the $i$-th component of \ccc{v}.\\
  \ccPrecond $0\le i \le \ccc{v.dimension()-1}$.}

\ccMethod{iterator begin() ;}{iterator to the first component.}

\ccMethod{iterator end() ;}{iterator beyond the last component.}

The same operations \ccc{begin()}, \ccc{end()} exist for
\ccc{const_iterator}.


\ccMethod{Vector  operator+(const Vector& v1) ;}{Addition. \ccPrecond\\
  \ccc{v.dimension() == v1.dimension()}.  }

\ccMethod{Vector  operator-(const Vector& v1) ;}{Subtraction. \ccPrecond\\
  \ccc{v.dimension() = v1.dimension()}.  }

\ccMethod{NT operator*(const Vector& v1) ;}{Inner Product. \ccPrecond\\
  \ccc{v.dimension() = v1.dimension()}.  }

\ccMethod{Vector operator-() ;}{Negation.  }

\ccMethod{Vector& operator+=(const Vector& v1);}{Addition plus assignment. \ccPrecond\\
  \ccc{v.dimension() == v1.dimension()}.  }

\ccMethod{Vector& operator-=(const Vector& v1);}{Subtraction plus assignment. \ccPrecond\\
  \ccc{v.dimension() == v1.dimension()}.  }

\ccMethod{Vector& operator*=(const NT& s);}{Scalar multiplication plus
  assignment.  }

\ccMethod{Vector& operator/=(const NT& s);}{Scalar division plus assignment. 
}

\ccFunction{ Vector operator*(const NT& r, const Vector& v)
  ;}{Componentwise multiplication with number $r$.  }

\ccFunction{ Vector operator*(const Vector& v, const NT& r)
  ;}{Componentwise multiplication with number $r$.  }

\end{ccRefConcept}


