/* * ZeroInstance.hpp * * Created on: Aug 10, 2012 * Author: heber */ #ifndef ZEROINSTANCE_HPP_ #define ZEROINSTANCE_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif /** This functions returns an instance equal to zero. * * This serves two functions: One the one hand we need a zero value to intialize * the (Orthogonal)Summation. On the other hand, ZeroInstance also marks a * special (Set)Value of a subset that should not contribute, i.e. whose * contribution is set to zero. * * @return instance initialized to zero */ template T ZeroInstance() { return NULL; } template<> inline double ZeroInstance() { return 0.; } template<> inline int ZeroInstance() { return 0; } template<> inline size_t ZeroInstance() { return (size_t)0; } #endif /* ZEROINSTANCE_HPP_ */