From dd22bd15f6ed3e5eb5c77ab427029be50fe20148 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Tue, 24 Jun 2014 20:05:13 +0100 Subject: libavg (1.8.1-1) unstable; urgency=medium * New upstream release (Closes: #739664) * Mark libdc1394-22-dev as linux-any build-dependency. * Add libvdpau-dev build-dependency. * Add libavresample-dev build-dependency. # imported from the archive --- src/glm/core/func_exponential.inl | 358 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 358 insertions(+) create mode 100644 src/glm/core/func_exponential.inl (limited to 'src/glm/core/func_exponential.inl') diff --git a/src/glm/core/func_exponential.inl b/src/glm/core/func_exponential.inl new file mode 100644 index 0000000..181596f --- /dev/null +++ b/src/glm/core/func_exponential.inl @@ -0,0 +1,358 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-03 +// Updated : 2010-02-04 +// Licence : This source is under MIT License +// File : glm/core/func_exponential.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace core{ + namespace function{ + namespace exponential{ + + // pow + template + GLM_FUNC_QUALIFIER genType pow + ( + genType const & x, + genType const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'pow' only accept floating-point input"); + + return ::std::pow(x, y); + } + + template + GLM_FUNC_QUALIFIER detail::tvec2 pow + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + return detail::tvec2( + pow(x.x, y.x), + pow(x.y, y.y)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec3 pow + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + return detail::tvec3( + pow(x.x, y.x), + pow(x.y, y.y), + pow(x.z, y.z)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec4 pow + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + return detail::tvec4( + pow(x.x, y.x), + pow(x.y, y.y), + pow(x.z, y.z), + pow(x.w, y.w)); + } + + // exp + template + GLM_FUNC_QUALIFIER genType exp + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'exp' only accept floating-point input"); + + return ::std::exp(x); + } + + template + GLM_FUNC_QUALIFIER detail::tvec2 exp + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + exp(x.x), + exp(x.y)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec3 exp + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + exp(x.x), + exp(x.y), + exp(x.z)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec4 exp + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + exp(x.x), + exp(x.y), + exp(x.z), + exp(x.w)); + } + + // log + template + GLM_FUNC_QUALIFIER genType log + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'log' only accept floating-point input"); + + return ::std::log(x); + } + + template + GLM_FUNC_QUALIFIER detail::tvec2 log + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + log(x.x), + log(x.y)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec3 log + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + log(x.x), + log(x.y), + log(x.z)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec4 log + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + log(x.x), + log(x.y), + log(x.z), + log(x.w)); + } + + //exp2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType exp2 + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'exp2' only accept floating-point input"); + + return ::std::exp(genType(0.69314718055994530941723212145818) * x); + } + + template + GLM_FUNC_QUALIFIER detail::tvec2 exp2 + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + exp2(x.x), + exp2(x.y)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec3 exp2 + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + exp2(x.x), + exp2(x.y), + exp2(x.z)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec4 exp2 + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + exp2(x.x), + exp2(x.y), + exp2(x.z), + exp2(x.w)); + } + + // log2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType log2 + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'log2' only accept floating-point input"); + + return ::std::log(x) / genType(0.69314718055994530941723212145818); + } + + template + GLM_FUNC_QUALIFIER detail::tvec2 log2 + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + log2(x.x), + log2(x.y)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec3 log2 + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + log2(x.x), + log2(x.y), + log2(x.z)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec4 log2 + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + log2(x.x), + log2(x.y), + log2(x.z), + log2(x.w)); + } + + // sqrt + template + GLM_FUNC_QUALIFIER genType sqrt + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'sqrt' only accept floating-point input"); + + return genType(::std::sqrt(x)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec2 sqrt + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + sqrt(x.x), + sqrt(x.y)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec3 sqrt + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + sqrt(x.x), + sqrt(x.y), + sqrt(x.z)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec4 sqrt + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + sqrt(x.x), + sqrt(x.y), + sqrt(x.z), + sqrt(x.w)); + } + + template + GLM_FUNC_QUALIFIER genType inversesqrt + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'inversesqrt' only accept floating-point input"); + + return genType(1) / ::std::sqrt(x); + } + + template + GLM_FUNC_QUALIFIER detail::tvec2 inversesqrt + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + inversesqrt(x.x), + inversesqrt(x.y)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec3 inversesqrt + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + inversesqrt(x.x), + inversesqrt(x.y), + inversesqrt(x.z)); + } + + template + GLM_FUNC_QUALIFIER detail::tvec4 inversesqrt + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + inversesqrt(x.x), + inversesqrt(x.y), + inversesqrt(x.z), + inversesqrt(x.w)); + } + + }//namespace exponential + }//namespace function + }//namespace core +}//namespace glm -- cgit v1.2.3