744 | | //!\brief Chain rule of pdfs - abstract part common for mprod and merger. |
745 | | //!this abstract class is common to epdf and mpdf |
746 | | //!\todo Think of better design - global functions rv=get_rv(Array<mpdf*> mpdfs); ?? |
747 | | class compositepdf |
748 | | { |
749 | | protected: |
750 | | //! Elements of composition |
751 | | Array<mpdf*> mpdfs; |
752 | | bool owning_mpdfs; |
753 | | public: |
754 | | compositepdf() : mpdfs (0) {}; |
755 | | compositepdf (Array<mpdf*> A0, bool own = false) { |
756 | | set_elements (A0, own); |
757 | | }; |
758 | | void set_elements (Array<mpdf*> A0, bool own = false) { |
759 | | mpdfs = A0; |
760 | | owning_mpdfs = own; |
761 | | }; |
762 | | //! find common rv, flag \param checkoverlap modifies whether overlaps are acceptable |
763 | | RV getrv (bool checkoverlap = false); |
764 | | //! common rvc of all mpdfs is written to rvc |
765 | | void setrvc (const RV &rv, RV &rvc); |
766 | | ~compositepdf() { |
767 | | if (owning_mpdfs) for (int i = 0; i < mpdfs.length(); i++) { |
768 | | delete mpdfs (i); |
769 | | } |
770 | | }; |
771 | | }; |
| 744 | //! \brief Combines RVs from a list of mpdfs to a single one. |
| 745 | RV get_composite_rv ( const Array<shared_ptr<mpdf> > &mpdfs, bool checkoverlap = false ); |