Skip to content

Commit

Permalink
prepare v1.9.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
VanyaBelyaev committed Dec 17, 2022
1 parent 22aa01b commit 00b52c7
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 29 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include(CTest)
set(OSTAP_VERSION_MAJOR 1)
set(OSTAP_VERSION_MINOR 9)
set(OSTAP_VERSION_PATCH 5)
set(OSTAP_VERSION_TWEAK 3)
set(OSTAP_VERSION_TWEAK 4)

set(OSTAP_VERSION ${OSTAP_VERSION_MAJOR}.${OSTAP_VERSION_MINOR}.${OSTAP_VERSION_PATCH}.${OSTAP_VERSION_TWEAK})

Expand Down
2 changes: 2 additions & 0 deletions ReleaseNotes/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# v1.9.5.4

## New features:

1. add an explicit ouble-adaptive CQUAD integrator for `Integrator1D<FUN>` and `Ostap::Math::Integrator`
Expand Down
23 changes: 23 additions & 0 deletions ReleaseNotes/v1.9.5.4,md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# v1.9.5.4

## New features:

1. add an explicit ouble-adaptive CQUAD integrator for `Integrator1D<FUN>` and `Ostap::Math::Integrator`
1. add an explicit Romberg integrator for `Integrator1D<FUN>` and `Ostap::Math::Integrator`
1. add a new test for `Ostap::Math::Integrator`
1. extend and impove `Ostap::Math::Integrator`
1. backport functinality for the older versions of ROOT/PyROOT
1. fix the test for ROOT<6.18
1. add ROOT-version dependent switch in `add_new_branch`
1. some improvements for frame progress bar
1. some improvements for frame-based `tree_reduce`
1. disable new frame-test for old ROOT
1. add treatment of new `ROOT.RooFit.MaxCalls` agrument


## Backward incompatible:

1. rename some methods for `Ostap::Math::Integrator`

## Bug fixes:

109 changes: 89 additions & 20 deletions ostap/math/tests/test_math_ve2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
""" Test module for ostap/math/math_ve.py
"""
# =============================================================================
import math
from ostap.math.ve import VE
from ostap.math.base import cpp, iszero, isequal
from ostap.math.math_ve import *
import math, random
from ostap.math.ve import VE
from ostap.math.base import cpp, iszero, isequal
import ostap.logger.table as T
from ostap.math.math_ve import *
# =============================================================================
from ostap.logger.logger import getLogger
if '__main__' == __name__ : logger = getLogger ( 'test_math_ve2' )
Expand All @@ -22,34 +23,102 @@

vars = [ VE ( 0.001 , 0.0001**2 ) , VE(1,0) , VE(1,0.1**2) , VE(10,0.01**2) ]

funcs = [ exp , expm1 ,
log , log10 , log1p ,
sqrt , cbrt ,
sin , cos , tan ,
sinh , cosh , tanh , sech ,
asin , acos , atan ,
asinh , acosh , atanh ,
erf , erfc , erfi , erfcx ,
probit ,
gamma , tgamma , lgamma , igamma ]
funcs = [ exp , expm1 ,
log , log10 , log1p ,
sqrt , cbrt ,
sin , cos , tan ,
sinh , cosh , tanh , sech ,
asin , acos , atan ,
asinh , acosh , atanh ,
erf , erfc , erfi , erfcx ,
sinc ,
probit ,
gamma , tgamma , lgamma , igamma ,
psi , digamma , trigamma ,
]

## use helper object:
from ostap.math.derivative import EvalVE
funcs += [ EvalVE ( math.sin , math.cos ) ,
EvalVE ( math.sin ) ]

def test_math_ve():
# =============================================================================
def test_math_ve1 ():

logger = getLogger("test_math_ve1")

rows = [ ( 'Function' , 'argument' , 'value' ) ]

for v in vars :
logger.info ( 'Var = %s ' % v )
for f in funcs :
logger.info ( "\t%s\t%s = %s " % ( f.__name__ , v , f(v) ) )
row = f.__name__ , str ( v ) , str ( f ( v ) )
rows.append ( row )

title = 'Functions'
table = T.table ( rows, title = title , prefix = '# ' , alignment = 'lcc' )
logger.info ( '%s\n%s' % ( title , table ) )


# =============================================================================
def test_math_ve2 ():


logger = getLogger("test_math_ve2")


funcs = [ ( exp , -1 , 1 ) ,
( expm1 , -1 , 1 ) ,
( log , 1 , 2 ) ,
( log10 , 1 , 2 ) ,
( log1p , 1 , 2 ) ,
( sqrt , 1 , 2 ) ,
( cbrt , 1 , 2 ) ,
( sin , -1 , 1 ) ,
( cos , -1 , 1 ) ,
( tan , -1 , 1 ) ,
( sinh , -1 , 1 ) ,
( cosh , -1 , 1 ) ,
( tanh , -1 , 1 ) ,
( sech , -1 , 1 ) ,
( asin , -1 , 1 ) ,
( acos , -1 , 1 ) ,
( atan , -1 , 1 ) ,
( asinh , -1 , 1 ) ,
( acosh , 1 , 2 ) ,
( atanh , -1 , 1 ) ,
( erf , -1 , 1 ) ,
( erfc , -1 , 1 ) ,
( erfi , -1 , 1 ) ,
( erfcx , -1 , 1 ) ,
( sinc , -1 , 1 ) ,
( probit , -1 , 1 ) ,
( gamma , 1 , 2 ) ,
( tgamma , 1 , 2 ) ,
( lgamma , 1 , 2 ) ,
( igamma , 1 , 2 ) ,
( psi , 1 , 2 ) ,
( digamma , 1 , 2 ) ,
( trigamma , 1 , 2 ) ]

rows = [ ( 'Function' , 'argument' , 'value' ) ]

for f,a,b in funcs :

x = random.uniform ( a , b )
row = f.__name__ , '%s' % x , '%s' % f ( x )
## row = f.__name__ , '%+5.3f' % x , '+.3g' % f ( x ) )
rows.append ( row )

title = 'Functions'
table = T.table ( rows, title = title , prefix = '# ' , alignment = 'lcc' )
logger.info ( '%s\n%s' % ( title , table ) )


# =============================================================================
if '__main__' == __name__ :

test_math_ve()
test_math_ve1 ()
test_math_ve2 ()

# =============================================================================
# The END
## The END
# =============================================================================
17 changes: 9 additions & 8 deletions source/include/Ostap/MoreMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ namespace Ostap
* @see http://ab-initio.mit.edu/Faddeeva
* @see https://en.wikipedia.org/wiki/Error_function
*/
double erfi ( const double x ) ;
double erfi ( const double x ) ;
// ========================================================================
/** Dowson function
* \f[ f(x) = \frac{\sqrt{\pi}}{2} * e^{-z^2} * erfi(z) \f]
Expand All @@ -255,7 +255,7 @@ namespace Ostap
* @see https://en.wikipedia.org/wiki/Error_function
* @see https://en.wikipedia.org/wiki/Dowson_function
*/
double dowson ( const double x ) ;
double dowson ( const double x ) ;
// ========================================================================
/** Mill's ratio for normal distribution
* - \f$ m (x) = \frac{1 - \Phi(x)}{\phi(x)}\f$
Expand All @@ -264,29 +264,30 @@ namespace Ostap
* @see https://en.wikipedia.org/wiki/Mills_ratio
* @see Ostap::Math::erfcx
*/
double mills_normal ( const double x ) ;
double mills_normal ( const double x ) ;
// ========================================================================
/** Product of the Gaussian PDF and Millt's ratio
* \f$ f(a,b) = \phi(a) R(b) \f$
* This expression is used for
* @see Ostap::Math::ExGauss
* @see Ostap::Math::NormalLaplace
*/
double gauss_mills ( const double a , const double b ) ;
double gauss_mills ( const double a , const double b ) ;
// ========================================================================
/** Compute <code>sech</code> function
/** \overload Compute <code>sech</code> function
* \f[ f(x) = \frac{1}{\cosh x} = \frac{2}{ e^{x}+e^{-x} }\f]
* @return the value of sech function
*/
double sech ( const double x ) ;
std::complex<double> sech ( const std::complex<double>& x ) ;
// ========================================================================
/** \overload Compute <code>sech</code> function
/** Compute <code>sech</code> function
* \f[ f(x) = \frac{1}{\cosh x} = \frac{2}{ e^{x}+e^{-x} }\f]
* @return the value of sech function
*/
std::complex<double> sech ( const std::complex<double>& x ) ;
double sech ( const double x ) ;
// ========================================================================


// ========================================================================
// Gamma function and fiends
// ========================================================================
Expand Down

0 comments on commit 00b52c7

Please sign in to comment.