VF_R LsmBasisSystem::pathBasisSystem(Size order, PolynomType polyType) {
     VF_R ret(order+1);
     for (Size i=0; i<=order; ++i) {
         switch (polyType) {
           case Monomial:
             ret[i] = MonomialFct(i);
             break;
           case Laguerre:
             ret[i] = boost::bind(ptr_w, GaussLaguerrePolynomial(), i, _1);
             break;
           case Hermite:
             ret[i] = boost::bind(ptr_w, GaussHermitePolynomial(), i, _1);
             break;
           case Hyperbolic:
             ret[i] = boost::bind(ptr_w, GaussHyperbolicPolynomial(), i, _1);
             break;
           case Legendre:
             ret[i] = boost::bind(ptr_w, GaussLegendrePolynomial(), i, _1);
             break;
           case Chebyshev:
             ret[i] = boost::bind(ptr_w, GaussChebyshevPolynomial(), i, _1);
             break;
           case Chebyshev2nd:
             ret[i] = boost::bind(ptr_w,GaussChebyshev2ndPolynomial(),i, _1);
             break;
           default:
             QL_FAIL("unknown regression type");
         }
     }
     return ret;
 }
    std::vector<boost::function1<Real, Real> >
    LsmBasisSystem::pathBasisSystem(Size order, PolynomType polynomType) {

        std::vector<boost::function1<Real, Real> > ret;
        for (Size i=0; i<=order; ++i) {
            switch (polynomType) {
              case Monomial:
                  ret.push_back(MonomialFct(i));
                break;
              case Laguerre:
                ret.push_back(
                    bind(&GaussianOrthogonalPolynomial::weightedValue,
                                GaussLaguerrePolynomial(), i, _1));
                break;
              case Hermite:
                ret.push_back(
                    bind(&GaussianOrthogonalPolynomial::weightedValue,
                                GaussHermitePolynomial(), i, _1));
                break;
              case Hyperbolic:
                ret.push_back(
                    bind(&GaussianOrthogonalPolynomial::weightedValue,
                                GaussHyperbolicPolynomial(), i, _1));
                break;
              case Legendre:
                ret.push_back(
                    bind(&GaussianOrthogonalPolynomial::weightedValue,
                                GaussLegendrePolynomial(), i, _1));
                break;
              case Chebyshev:
                ret.push_back(
                    bind(&GaussianOrthogonalPolynomial::weightedValue,
                                GaussChebyshevPolynomial(), i, _1));
                break;
              case Chebyshev2nd:
                ret.push_back(
                    bind(&GaussianOrthogonalPolynomial::weightedValue,
                                GaussChebyshev2ndPolynomial(), i, _1));
                break;
              default:
                QL_FAIL("unknown regression type");
            }
        }

        return ret;
    }