Show
Ignore:
Timestamp:
06/11/10 14:18:09 (14 years ago)
Author:
smidl
Message:

Mergers + fixes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/stat/merger.h

    r1079 r1083  
    3838                //!  
    3939                //! check if all epdfs are on the same support 
    40                 void validate_sources() { 
    41                         int n=sources.length(); 
     40                virtual void set_sources(const Array<shared_ptr<pdf> > &A) { 
     41                        int n=A.length(); 
    4242                         
    4343                        bdm_assert(n>0,"merger has no sources to merge"); 
     
    4848                         
    4949                        // check compatibility of sources -- no types are needed 
    50                         int dim0 = sources(0)->dimension(); 
     50                        int dim0 = A(0)->dimension(); 
    5151                        for (int i=0; i<n; i++){ 
     52                                const epdf *si=dynamic_cast<const epdf*>(A(i).get()); 
     53                                if (si){ 
     54                                        sources(i) = dynamic_cast<epdf*>(A(i)->_copy()); 
     55                                } 
    5256                                bdm_assert(sources(i)->dimension()==dim0, "Merger: Incompatible dimensions of sources"); 
    5357                                if (sources(i)->isnamed()){