Ejemplo n.º 1
0
/// Set the weight function
void CustomPolynomial::setWeightFunction(IFunction_const_sptr wgtFun, const double& tol)
{
  m_weightFunction = wgtFun;
  auto cheb = dynamic_cast<const ChebFunction*>( wgtFun.get() );
  if ( cheb && cheb->nfuns() == 1 && !cheb->cfun(0).hasScaling() )
  {
      m_fun = cheb->cfun(0).getUnscaled();
  }
  else
  {
    m_fun.bestFit( *wgtFun, tol );
  }
}