Chris@16: // (C) Copyright John Maddock 2006. Chris@16: // (C) Copyright Paul A. Bristow 2006. Chris@16: // Use, modification and distribution are subject to the Chris@16: // Boost Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_STATS_COMPLEMENT_HPP Chris@16: #define BOOST_STATS_COMPLEMENT_HPP Chris@16: Chris@16: // Chris@16: // This code really defines our own tuple type. Chris@16: // It would be nice to reuse boost::math::tuple Chris@16: // while retaining our own type safety, but it's Chris@16: // not clear if that's possible. In any case this Chris@16: // code is *very* lightweight. Chris@16: // Chris@16: namespace boost{ namespace math{ Chris@16: Chris@16: template Chris@16: struct complemented2_type Chris@16: { Chris@16: complemented2_type( Chris@16: const Dist& d, Chris@16: const RealType& p1) Chris@16: : dist(d), Chris@16: param(p1) {} Chris@16: Chris@16: const Dist& dist; Chris@16: const RealType& param; Chris@16: Chris@16: private: Chris@16: complemented2_type& operator=(const complemented2_type&); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct complemented3_type Chris@16: { Chris@16: complemented3_type( Chris@16: const Dist& d, Chris@16: const RealType1& p1, Chris@16: const RealType2& p2) Chris@16: : dist(d), Chris@16: param1(p1), Chris@16: param2(p2) {} Chris@16: Chris@16: const Dist& dist; Chris@16: const RealType1& param1; Chris@16: const RealType2& param2; Chris@16: private: Chris@16: complemented3_type& operator=(const complemented3_type&); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct complemented4_type Chris@16: { Chris@16: complemented4_type( Chris@16: const Dist& d, Chris@16: const RealType1& p1, Chris@16: const RealType2& p2, Chris@16: const RealType3& p3) Chris@16: : dist(d), Chris@16: param1(p1), Chris@16: param2(p2), Chris@16: param3(p3) {} Chris@16: Chris@16: const Dist& dist; Chris@16: const RealType1& param1; Chris@16: const RealType2& param2; Chris@16: const RealType3& param3; Chris@16: private: Chris@16: complemented4_type& operator=(const complemented4_type&); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct complemented5_type Chris@16: { Chris@16: complemented5_type( Chris@16: const Dist& d, Chris@16: const RealType1& p1, Chris@16: const RealType2& p2, Chris@16: const RealType3& p3, Chris@16: const RealType4& p4) Chris@16: : dist(d), Chris@16: param1(p1), Chris@16: param2(p2), Chris@16: param3(p3), Chris@16: param4(p4) {} Chris@16: Chris@16: const Dist& dist; Chris@16: const RealType1& param1; Chris@16: const RealType2& param2; Chris@16: const RealType3& param3; Chris@16: const RealType4& param4; Chris@16: private: Chris@16: complemented5_type& operator=(const complemented5_type&); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct complemented6_type Chris@16: { Chris@16: complemented6_type( Chris@16: const Dist& d, Chris@16: const RealType1& p1, Chris@16: const RealType2& p2, Chris@16: const RealType3& p3, Chris@16: const RealType4& p4, Chris@16: const RealType5& p5) Chris@16: : dist(d), Chris@16: param1(p1), Chris@16: param2(p2), Chris@16: param3(p3), Chris@16: param4(p4), Chris@16: param5(p5) {} Chris@16: Chris@16: const Dist& dist; Chris@16: const RealType1& param1; Chris@16: const RealType2& param2; Chris@16: const RealType3& param3; Chris@16: const RealType4& param4; Chris@16: const RealType5& param5; Chris@16: private: Chris@16: complemented6_type& operator=(const complemented6_type&); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct complemented7_type Chris@16: { Chris@16: complemented7_type( Chris@16: const Dist& d, Chris@16: const RealType1& p1, Chris@16: const RealType2& p2, Chris@16: const RealType3& p3, Chris@16: const RealType4& p4, Chris@16: const RealType5& p5, Chris@16: const RealType6& p6) Chris@16: : dist(d), Chris@16: param1(p1), Chris@16: param2(p2), Chris@16: param3(p3), Chris@16: param4(p4), Chris@16: param5(p5), Chris@16: param6(p6) {} Chris@16: Chris@16: const Dist& dist; Chris@16: const RealType1& param1; Chris@16: const RealType2& param2; Chris@16: const RealType3& param3; Chris@16: const RealType4& param4; Chris@16: const RealType5& param5; Chris@16: const RealType6& param6; Chris@16: private: Chris@16: complemented7_type& operator=(const complemented7_type&); Chris@16: }; Chris@16: Chris@16: template Chris@16: inline complemented2_type complement(const Dist& d, const RealType& r) Chris@16: { Chris@16: return complemented2_type(d, r); Chris@16: } Chris@16: Chris@16: template Chris@16: inline complemented3_type complement(const Dist& d, const RealType1& r1, const RealType2& r2) Chris@16: { Chris@16: return complemented3_type(d, r1, r2); Chris@16: } Chris@16: Chris@16: template Chris@16: inline complemented4_type complement(const Dist& d, const RealType1& r1, const RealType2& r2, const RealType3& r3) Chris@16: { Chris@16: return complemented4_type(d, r1, r2, r3); Chris@16: } Chris@16: Chris@16: template Chris@16: inline complemented5_type complement(const Dist& d, const RealType1& r1, const RealType2& r2, const RealType3& r3, const RealType4& r4) Chris@16: { Chris@16: return complemented5_type(d, r1, r2, r3, r4); Chris@16: } Chris@16: Chris@16: template Chris@16: inline complemented6_type complement(const Dist& d, const RealType1& r1, const RealType2& r2, const RealType3& r3, const RealType4& r4, const RealType5& r5) Chris@16: { Chris@16: return complemented6_type(d, r1, r2, r3, r4, r5); Chris@16: } Chris@16: Chris@16: template Chris@16: inline complemented7_type complement(const Dist& d, const RealType1& r1, const RealType2& r2, const RealType3& r3, const RealType4& r4, const RealType5& r5, const RealType6& r6) Chris@16: { Chris@16: return complemented7_type(d, r1, r2, r3, r4, r5, r6); Chris@16: } Chris@16: Chris@16: } // namespace math Chris@16: } // namespace boost Chris@16: Chris@16: #endif // BOOST_STATS_COMPLEMENT_HPP Chris@16: