32 #ifndef WEIGHTEDSAMPLE_H
33 #define WEIGHTEDSAMPLE_H
48 template <
typename T>
class WeightedSample:
virtual public Sample<T>
82 template <
typename S>
friend ostream &
operator<< (ostream & stream,
83 WeightedSample<S> & mws);
86 WeightedSample<T> &
operator= (
const WeightedSample<T> & my_sample);
89 WeightedSample<T> &
operator= (
const Sample<T> & my_sample);
94 : Sample<T>(dimension){}
96 template <
typename T> WeightedSample<T>::~WeightedSample(){}
98 template <
typename T> WeightedSample<T>::WeightedSample (
const WeightedSample<T> & mws)
116 template <
typename S> ostream & operator<< (ostream & stream,
117 WeightedSample<S> & mws)
119 stream <<
"WeightedSample Value = " << (
Sample<S> &) mws
120 <<
"Weight = " << mws.Weight << endl;
129 op1 =
this; op2 = & my_sample;
131 this->Weight = my_sample.WeightGet();
140 op1 =
this; op2 = & my_sample;