From d6bebbcd56fce019bb66948d3b26b4296f167f2d Mon Sep 17 00:00:00 2001 From: TatianaOvsiannikova <43534935+TatianaOvsiannikova@users.noreply.github.com> Date: Sat, 21 Mar 2020 18:18:06 +0300 Subject: [PATCH] Update Bernstein1D.cpp --- source/src/Bernstein1D.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/source/src/Bernstein1D.cpp b/source/src/Bernstein1D.cpp index aeb85314..f532366b 100644 --- a/source/src/Bernstein1D.cpp +++ b/source/src/Bernstein1D.cpp @@ -154,15 +154,24 @@ Ostap::Math::Positive::Positive // // ============================================================================ // // constructor from the list of phases // // ============================================================================ -// Ostap::Math::Positive::Positive -// ( const std::vector& pars , -// const double xmin , -// const double xmax ) -// : m_bernstein ( pars.size() , xmin , xmax ) -// , m_sphere ( pars , 3 ) -// { -// updateBernstein () ; -// } + Ostap::Math::Positive::Positive + ( const std::vector& pars , + const double xmin , + const double xmax ) + : m_bernstein ( pars.size() , xmin , xmax ) + , m_sphereA ( 1 ) + , m_sphereR (std::max ( 1 , int(pars.size())- 1 )) + , m_rs ( std::max ( 1 , int(pars.size())- 1 ) , 0.0 ) + , m_v1 ( pars.size() + 1 , 0.0 ) + , m_v2 ( pars.size() + 1 , 0.0 ) + , m_aux ( pars.size() + 1 , 0.0 ) + { + for ( unsigned short i = 0 ; i < pars.size() ; ++i ){ + setPar(i,pars[i]); + } + + updateBernstein () ; + } // // ============================================================================ // // constructor from the sphere with coefficients // // ============================================================================