x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
common_error_handling.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\math\distributions\detail\common_error_handling.hpp
Girar
Efecto
Propiedad
Historial
// 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
Dirección de la página
Dirección del archivo
Anterior 1/3
Siguiente
Descargar
( 3 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.