vectorop.h File Reference

Add basic arithmetic support to vector. More...

#include <assert.h>
#include <vector>

Include dependency graph for vectorop.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  lemga
namespace  lemga::op

Functions

template<typename R, typename N>
vector< R > & lemga::op::operator+= (vector< R > &u, const vector< N > &v)
 u += v.
template<typename R>
vector< R > lemga::op::operator- (const vector< R > &v)
 -v.
template<typename R, typename N>
lemga::op::inner_product (const R &u, const N &v)
 Inner product of u and v.
template<typename RET, typename R, typename N>
RET lemga::op::inner_product (const vector< R > &u, const vector< N > &v)
template<typename R, typename N>
vector< R > & lemga::op::operator *= (vector< R > &v, const N &r)
 v *= r.


Detailed Description

Add basic arithmetic support to vector.

Let u and v be two vectos and r be a scalar. This file defines the following operators:

Note:
The template can `recursively' apply itself to vectors of vectors, such as two matrices of real numbers could add up (if they have the same size).
Warning:
u, v, and r can have different base types. For example, if u is a double vector and v an integer vector. When an inappropriate coercion happens, the compiler may complain (with gcc, turn options -Wconversion or -Wall on).
Id
vectorop.h 1907 2004-12-11 00:51:14Z ling

Definition in file vectorop.h.


Generated on Mon Jan 9 23:44:16 2006 for LEMGA by  doxygen 1.4.6