x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
common_error_handling.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\math\distributions\detail\common_error_handling.hpp
旋转
特效
属性
历史版本
// Copyright John Maddock 2006, 2007. // Copyright Paul A. Bristow 2006, 2007. // Use, modification and distribution are subject to 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) #ifndef BOOST_MATH_DISTRIBUTIONS_COMMON_ERROR_HANDLING_HPP #define BOOST_MATH_DISTRIBUTIONS_COMMON_ERROR_HANDLING_HPP #include
#include
// using boost::math::isfinite; namespace boost{ namespace math{ namespace detail { template
inline bool check_probability(const char* function, RealType const& prob, RealType* result, const Policy& pol) { if((prob < 0) || (prob > 1) || !(boost::math::isfinite)(prob)) { *result = policies::raise_domain_error
( function, "Probability argument is %1%, but must be >= 0 and <= 1 !", prob, pol); return false; } return true; } template
inline bool check_df(const char* function, RealType const& df, RealType* result, const Policy& pol) { if((df <= 0) || !(boost::math::isfinite)(df)) { *result = policies::raise_domain_error
( function, "Degrees of freedom argument is %1%, but must be > 0 !", df, pol); return false; } return true; } template
inline bool check_scale( const char* function, RealType scale, RealType* result, const Policy& pol) { if((scale <= 0) || !(boost::math::isfinite)(scale)) { // Assume scale == 0 is NOT valid for any distribution. *result = policies::raise_domain_error
( function, "Scale parameter is %1%, but must be > 0 !", scale, pol); return false; } return true; } template
inline bool check_location( const char* function, RealType location, RealType* result, const Policy& pol) { if(!(boost::math::isfinite)(location)) { *result = policies::raise_domain_error
( function, "Location parameter is %1%, but must be finite!", location, pol); return false; } return true; } template
inline bool check_x( const char* function, RealType x, RealType* result, const Policy& pol) { if(!(boost::math::isfinite)(x)) { *result = policies::raise_domain_error
( function, "Random variate x is %1%, but must be finite!", x, pol); return false; } return true; // Note that this test catches both infinity and NaN. // Some special cases permit x to be infinite, so these must be tested 1st, // leaving this test to catch any NaNs. see Normal and cauchy for example. } } // namespace detail } // namespace math } // namespace boost #endif // BOOST_MATH_DISTRIBUTIONS_COMMON_ERROR_HANDLING_HPP
common_error_handling.hpp
网页地址
文件地址
上一页 1/3
下一页
下载
( 3 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.