Classes | |
struct | f_sqr |
Square fctor. More... | |
struct | f_abs |
Absolute value fctor. More... | |
Namespaces | |
namespace | internal |
Internal purpose only. | |
Functions | |
template<class T> | |
const T | sqr (const T &val) |
Square function. | |
template<class T> | |
const T | abs (const T &val) |
Absolute value function. | |
template<typename DestValue, typename I, typename J> | |
DestValue | dot_product (const I &i, const J &j) |
Dot product. |
DestValue oln::math::dot_product | ( | const I & | i, | |
const J & | j | |||
) |
Dot product.
#include <oln/math/macros.hh> #include <ntg/all.hh> int main() { ntg::int_u8 i(3), j(4); // Print "12" std::cout << oln::math::dot_product<ntg::float_s>(i, j) << std::endl; ntg::rgb_8 blue(0, 0, 200), yellow(0, 30, 10); // Print "2000" std::cout << oln::math::dot_product<ntg::float_s>(blue, yellow) << std::endl; }
Definition at line 142 of file olena/oln/math/macros.hh.
00143 { 00144 typedef typename mlc::if_<ntg_is_a(I, ntg::vectorial)::ret, 00145 internal::f_dot_product_v<DestValue, I, J>, 00146 internal::f_dot_product_nv<DestValue, I, J> >::ret fctor; 00147 return fctor::product(i, j); 00148 }