Population
Image processing library in C++
Classes | Functions

template class for tuple of numbers of fixed size for representing a point or a vector More...

Classes

class  pop::VecN< D, CoordinateType >
 tuple of numbers of fixed for the representation of a point or a vector as element position of a matrix More...
 

Functions

template<int DIM, typename Type1 >
pop::VecN< DIM, Type1 > pop::maximum (const pop::VecN< DIM, Type1 > &p1, const pop::VecN< DIM, Type1 > &p2)
 maximum of VecN u by the VecN v $\max(u,v)=(\max(u_0,v_0),\max(u_1,v_1))$ for each coordinate More...
 
template<int DIM, typename Type1 >
pop::VecN< DIM, Type1 > pop::minimum (const pop::VecN< DIM, Type1 > &p1, const pop::VecN< DIM, Type1 > &p2)
 minimum of VecN u by the VecN v $\min(u,v)=(\min(u_0,v_0),\min(u_1,v_1))$ for each coordinate More...
 
template<int DIM, typename Type1 >
pop::VecN< DIM, Type1 > pop::absolute (const pop::VecN< DIM, Type1 > &p1)
 absolute value of the VecN abs(u)=(abs(u_0),abs(u_1)) for each coordinate More...
 
template<int DIM, typename Type1 >
pop::VecN< DIM, Type1 > pop::floor (const pop::VecN< DIM, Type1 > &p1)
 floor value of the VecN for each coordinate More...
 
template<int DIM, typename Type1 >
F32 pop::normValue (const pop::VecN< DIM, Type1 > &x, int p=2)
 norm of the VecN $\vert u \vert_p=(\sum|u_i|^p)^{1/p}$ More...
 
template<int DIM, typename Type1 >
F32 pop::distance (const pop::VecN< DIM, Type1 > &u, const pop::VecN< DIM, Type1 > &v, int p=2)
 distance between two vectors $\vert u-v \vert^p$ More...
 
template<int DIM, typename Type1 >
F32 pop::normPowerValue (const pop::VecN< DIM, Type1 > &p1, int p=2)
 norm of the VecN $\vert u \vert_p=\sum|u_i|^p$ More...
 
template<int DIM, typename Type1 >
pop::VecN< DIM, Type1 > pop::round (const pop::VecN< DIM, Type1 > &v1)
 round functions return the integral value nearest to v1 rounding half-way cases away for each coordinate More...
 
template<int D, class Type1 >
Type1 pop::productInner (const pop::VecN< D, Type1 > &x1, const pop::VecN< D, Type1 > &x2)
 inner product between two 3d vector More...
 
template<class Type1 >
pop::VecN< 3, Type1 > pop::productVectoriel (const pop::VecN< 3, Type1 > &x1, const pop::VecN< 3, Type1 > &x2)
 vectoriel product between two 3d vector More...
 
template<int D, class Type >
std::ostream & pop::operator<< (std::ostream &out, const pop::VecN< D, Type > &x)
 
template<int D, class Type >
std::istream & pop::operator>> (std::istream &in, pop::VecN< D, Type > &x)
 

Detailed Description

template class for tuple of numbers of fixed size for representing a point or a vector

Function Documentation

template<int DIM, typename Type1 >
pop::VecN<DIM,Type1> pop::absolute ( const pop::VecN< DIM, Type1 > &  p1)
inline

absolute value of the VecN abs(u)=(abs(u_0),abs(u_1)) for each coordinate

Parameters
p1VecN
Returns
output VecN
pop::Vec2F32 x1(2.5,-4.5);
pop::Vec2F32 x = absolute(x1);//x=(2.5,2.5)
template<int DIM, typename Type1 >
F32 pop::distance ( const pop::VecN< DIM, Type1 > &  u,
const pop::VecN< DIM, Type1 > &  v,
int  p = 2 
)

distance between two vectors $\vert u-v \vert^p$

Parameters
uVecN
vVecN
pp-norm
Returns
output scalar value
template<int DIM, typename Type1 >
pop::VecN<DIM,Type1> pop::floor ( const pop::VecN< DIM, Type1 > &  p1)
inline

floor value of the VecN for each coordinate

Parameters
p1VecN
Returns
output VecN
template<int DIM, typename Type1 >
pop::VecN<DIM,Type1> pop::maximum ( const pop::VecN< DIM, Type1 > &  p1,
const pop::VecN< DIM, Type1 > &  p2 
)
inline

maximum of VecN u by the VecN v $\max(u,v)=(\max(u_0,v_0),\max(u_1,v_1))$ for each coordinate

Parameters
p1first VecN
p2second VecN
Returns
output VecN
pop::Vec2F32 x1(2.5,4.5);
pop::Vec2F32 x2(6.3,2.5);
pop::Vec2F32 x = maximum(x1,x2);//x=(6.3,2.5)
template<int DIM, typename Type1 >
pop::VecN<DIM,Type1> pop::minimum ( const pop::VecN< DIM, Type1 > &  p1,
const pop::VecN< DIM, Type1 > &  p2 
)

minimum of VecN u by the VecN v $\min(u,v)=(\min(u_0,v_0),\min(u_1,v_1))$ for each coordinate

Parameters
p1first VecN
p2second VecN
Returns
output VecN
pop::Vec2F32 x1(2.5,4.5);
pop::Vec2F32 x2(6.3,2.5);
pop::Vec2F32 x = minimum(x1,x2);//x=(2.5,2.5)
template<int DIM, typename Type1 >
F32 pop::normPowerValue ( const pop::VecN< DIM, Type1 > &  p1,
int  p = 2 
)

norm of the VecN $\vert u \vert_p=\sum|u_i|^p$

Parameters
p1input vector
pp-norm
Returns
output scalar value
template<int DIM, typename Type1 >
F32 pop::normValue ( const pop::VecN< DIM, Type1 > &  x,
int  p = 2 
)

norm of the VecN $\vert u \vert_p=(\sum|u_i|^p)^{1/p}$

Parameters
xinput vector
pp-norm
Returns
output scalar value
template<int D, class Type >
std::ostream& pop::operator<< ( std::ostream &  out,
const pop::VecN< D, Type > &  x 
)
Parameters
outoutput stream
xVecN

stream insertion from the VecN x

template<int D, class Type >
std::istream& pop::operator>> ( std::istream &  in,
pop::VecN< D, Type > &  x 
)
Parameters
ininput stream
xVecN

stream extraction to the VecN x

template<int D, class Type1 >
Type1 pop::productInner ( const pop::VecN< D, Type1 > &  x1,
const pop::VecN< D, Type1 > &  x2 
)

inner product between two 3d vector

Parameters
x1first vector
x2second vector
Returns
output vector

inner product of the two vectors $<u |v>= \sum_i u_i v_i.$

template<class Type1 >
pop::VecN<3, Type1> pop::productVectoriel ( const pop::VecN< 3, Type1 > &  x1,
const pop::VecN< 3, Type1 > &  x2 
)
inline

vectoriel product between two 3d vector

Parameters
x1first vector
x2second vector
Returns
output vector

vectoriel product of the two vectors $u\wedge v=\begin{pmatrix} u_1v_2-u_2v_1\\ u_2v_0-u_0v_2\\ u_0v_1-u_1v_0 \end{pmatrix}.$

template<int DIM, typename Type1 >
pop::VecN<DIM,Type1> pop::round ( const pop::VecN< DIM, Type1 > &  v1)

round functions return the integral value nearest to v1 rounding half-way cases away for each coordinate

Parameters
v1VecN
Returns
output VecN