Server IP : 104.21.38.3 / Your IP : 172.71.82.81 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/boost/boost_1_59_0/boost/math/ |
Upload File : |
// Boost common_factor_ct.hpp header file ----------------------------------// // (C) Copyright Daryle Walker and Stephen Cleary 2001-2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. #ifndef BOOST_MATH_COMMON_FACTOR_CT_HPP #define BOOST_MATH_COMMON_FACTOR_CT_HPP #include <boost/math_fwd.hpp> // self include #include <boost/config.hpp> // for BOOST_STATIC_CONSTANT, etc. #include <boost/mpl/integral_c.hpp> namespace boost { namespace math { // Implementation details --------------------------------------------------// namespace detail { // Build GCD with Euclid's recursive algorithm template < static_gcd_type Value1, static_gcd_type Value2 > struct static_gcd_helper_t { private: BOOST_STATIC_CONSTANT( static_gcd_type, new_value1 = Value2 ); BOOST_STATIC_CONSTANT( static_gcd_type, new_value2 = Value1 % Value2 ); #ifndef __BORLANDC__ #define BOOST_DETAIL_GCD_HELPER_VAL(Value) static_cast<static_gcd_type>(Value) #else typedef static_gcd_helper_t self_type; #define BOOST_DETAIL_GCD_HELPER_VAL(Value) (self_type:: Value ) #endif typedef static_gcd_helper_t< BOOST_DETAIL_GCD_HELPER_VAL(new_value1), BOOST_DETAIL_GCD_HELPER_VAL(new_value2) > next_step_type; #undef BOOST_DETAIL_GCD_HELPER_VAL public: BOOST_STATIC_CONSTANT( static_gcd_type, value = next_step_type::value ); }; // Non-recursive case template < static_gcd_type Value1 > struct static_gcd_helper_t< Value1, 0UL > { BOOST_STATIC_CONSTANT( static_gcd_type, value = Value1 ); }; // Build the LCM from the GCD template < static_gcd_type Value1, static_gcd_type Value2 > struct static_lcm_helper_t { typedef static_gcd_helper_t<Value1, Value2> gcd_type; BOOST_STATIC_CONSTANT( static_gcd_type, value = Value1 / gcd_type::value * Value2 ); }; // Special case for zero-GCD values template < > struct static_lcm_helper_t< 0UL, 0UL > { BOOST_STATIC_CONSTANT( static_gcd_type, value = 0UL ); }; } // namespace detail // Compile-time greatest common divisor evaluator class declaration --------// template < static_gcd_type Value1, static_gcd_type Value2 > struct static_gcd : public mpl::integral_c<static_gcd_type, (detail::static_gcd_helper_t<Value1, Value2>::value) > { }; // boost::math::static_gcd // Compile-time least common multiple evaluator class declaration ----------// template < static_gcd_type Value1, static_gcd_type Value2 > struct static_lcm : public mpl::integral_c<static_gcd_type, (detail::static_lcm_helper_t<Value1, Value2>::value) > { }; // boost::math::static_lcm } // namespace math } // namespace boost #endif // BOOST_MATH_COMMON_FACTOR_CT_HPP