Hi group,
I am experiencing some problems when compiling my code. More precisely there is a problem in the constructor of my inherited template class.
template <class USG, class IC>
class InverseCumulativeChiSquareRsg
ublic QuantLib::InverseCumulativeRsg< USG, IC> {
public :
explicit InverseCumulativeChiSquareRsg(const USG& uniformSequenceGenerator) ;
InverseCumulativeChiSquareRsg(const USG& uniformSequenceGenerator,const IC& inverseCumulative); //<----the problem is here!!!
const sample_type& nextSequence() const;
private :
mutable sample_type xChiSquare_ ;
};
Now, the constructor for QuantLib::InverseCumulativeRsg< USG, IC> is defined as
template <class USG, class IC>
InverseCumulativeRsg<USG, IC>::InverseCumulativeRsg(const USG& usg,
const IC& inverseCum)
: uniformSequenceGenerator_(usg),
dimension_(uniformSequenceGenerator_.dimension()),
x_(Array(dimension_), 1.0),
ICD_(inverseCum) {}
and of course it works perfectly.
x_ is defined as private member of InverseCumulativeRsg<USG, IC> in such a way:
typedef Sample<Array> sample_type;
mutable sample_type x_;
So, the error I get is
'QuantLib::Sample<T>' : no appropriate default constructor available
with
[
T=QuantLib::Array
]
which for some reasons that I can't understand happens only when I try to instantiate the inherited class!
Any help or idea will be much appreciated!
Thanks,
Andrea
I am experiencing some problems when compiling my code. More precisely there is a problem in the constructor of my inherited template class.
template <class USG, class IC>
class InverseCumulativeChiSquareRsg
public :
explicit InverseCumulativeChiSquareRsg(const USG& uniformSequenceGenerator) ;
InverseCumulativeChiSquareRsg(const USG& uniformSequenceGenerator,const IC& inverseCumulative); //<----the problem is here!!!
const sample_type& nextSequence() const;
private :
mutable sample_type xChiSquare_ ;
};
Now, the constructor for QuantLib::InverseCumulativeRsg< USG, IC> is defined as
template <class USG, class IC>
InverseCumulativeRsg<USG, IC>::InverseCumulativeRsg(const USG& usg,
const IC& inverseCum)
: uniformSequenceGenerator_(usg),
dimension_(uniformSequenceGenerator_.dimension()),
x_(Array(dimension_), 1.0),
ICD_(inverseCum) {}
and of course it works perfectly.
x_ is defined as private member of InverseCumulativeRsg<USG, IC> in such a way:
typedef Sample<Array> sample_type;
mutable sample_type x_;
So, the error I get is
'QuantLib::Sample<T>' : no appropriate default constructor available
with
[
T=QuantLib::Array
]
which for some reasons that I can't understand happens only when I try to instantiate the inherited class!
Any help or idea will be much appreciated!
Thanks,
Andrea