FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | List of all members
math::Norm< FUNC > Struct Template Reference

Computation of norms in K-vector space. More...

#include <mathtools/norm.h>

Static Public Member Functions

template<typename COORD_ITERATOR >
static CompatibleRealType fromRange (COORD_ITERATOR begin, COORD_ITERATOR end)
 Returns the norm of the vector with coordinates in iterator range [ begin , end ]. More...
 
template<typename COORD_ITERATOR >
static bool isNullRange (COORD_ITERATOR begin, COORD_ITERATOR end)
 
template<std::size_t N, typename COORD_TYPE >
static CompatibleRealType fromPtr (const COORD_TYPE *coordPtr)
 Returns the norm of the vector with its N coordinates stored in memory at coordPtr. More...
 
template<std::size_t N, typename COORD_TYPE >
static bool isNullPtr (const COORD_TYPE *coordPtr)
 
template<std::size_t N, typename COORD_TYPE >
static CompatibleRealType fromArray (const COORD_TYPE(&coordArray)[N])
 Returns the norm of the vector with its N coordinates stored in array coordArray. More...
 
template<std::size_t N, typename COORD_TYPE >
static bool isNullArray (const COORD_TYPE(&coordArray)[N])
 
template<typename VEC >
static CompatibleRealType fromObject (const VEC &vec)
 Returns the norm of the vector object vec. More...
 
template<typename VEC >
static bool isNullObject (const VEC &vec)
 

Detailed Description

template<typename FUNC>
struct math::Norm< FUNC >

Computation of norms in K-vector space.

Template Parameters
FUNCClass providing the concrete computation functions

Example:

#include <iostream>
int main()
{
const double vec3[] = { 0, 1.5, 15 };
std::cout << "Euclidean norm: " << math::EuclideanNorm::fromArray(vec3) << std::endl;
std::cout << "Manhattan norm: " << math::ManhattanNorm::fromArray(vec3) << std::endl;
std::cout << "Maximum norm: " << math::MaximumNorm::fromArray(vec3) << std::endl;
std::cout << "Squared euclidenan norm: " << math::SqrEuclideanNorm::fromArray(vec3) << std::endl;
return 0;
}

Member Function Documentation

template<typename FUNC >
template<std::size_t N, typename COORD_TYPE >
static CompatibleRealType math::Norm< FUNC >::fromArray ( const COORD_TYPE(&)  coordArray[N])
static

Returns the norm of the vector with its N coordinates stored in array coordArray.

template<typename FUNC >
template<typename VEC >
static CompatibleRealType math::Norm< FUNC >::fromObject ( const VEC &  vec)
static

Returns the norm of the vector object vec.

template<typename FUNC >
template<std::size_t N, typename COORD_TYPE >
static CompatibleRealType math::Norm< FUNC >::fromPtr ( const COORD_TYPE *  coordPtr)
static

Returns the norm of the vector with its N coordinates stored in memory at coordPtr.

Template Parameters
NSize of the vector (count of coordinates)
COORD_TYPEType of the vector's corrdinates
template<typename FUNC >
template<typename COORD_ITERATOR >
static CompatibleRealType math::Norm< FUNC >::fromRange ( COORD_ITERATOR  begin,
COORD_ITERATOR  end 
)
static

Returns the norm of the vector with coordinates in iterator range [ begin , end ].

Template Parameters
COORD_ITERATORType of the iterator over the vector's coordinates
template<typename FUNC >
template<std::size_t N, typename COORD_TYPE >
static bool math::Norm< FUNC >::isNullArray ( const COORD_TYPE(&)  coordArray[N])
inlinestatic
template<typename FUNC >
template<typename VEC >
static bool math::Norm< FUNC >::isNullObject ( const VEC &  vec)
inlinestatic
template<typename FUNC >
template<std::size_t N, typename COORD_TYPE >
static bool math::Norm< FUNC >::isNullPtr ( const COORD_TYPE *  coordPtr)
inlinestatic
template<typename FUNC >
template<typename COORD_ITERATOR >
static bool math::Norm< FUNC >::isNullRange ( COORD_ITERATOR  begin,
COORD_ITERATOR  end 
)
inlinestatic

The documentation for this struct was generated from the following file: