Line data Source code
1 : // Author(s): Wieger Wesselink 2 : // Copyright: see the accompanying file COPYING or copy at 3 : // https://github.com/mCRL2org/mCRL2/blob/master/COPYING 4 : // 5 : // Distributed under the Boost Software License, Version 1.0. 6 : // (See accompanying file LICENSE_1_0.txt or copy at 7 : // http://www.boost.org/LICENSE_1_0.txt) 8 : // 9 : /// \file mcrl2/lps/summand.h 10 : /// \brief The class summand. 11 : 12 : #ifndef MCRL2_LPS_SUMMAND_H 13 : #define MCRL2_LPS_SUMMAND_H 14 : 15 : #include "mcrl2/data/real.h" 16 : 17 : namespace mcrl2 18 : { 19 : 20 : namespace lps 21 : { 22 : 23 : /// \brief Base class for LPS summands. 24 : class summand_base 25 : { 26 : protected: 27 : /// \brief The summation variables of the summand 28 : data::variable_list m_summation_variables; 29 : 30 : /// \brief The condition of the summand 31 : data::data_expression m_condition; 32 : 33 : public: 34 : /// \brief Constructor. 35 25 : summand_base() 36 25 : {} 37 : 38 : /// \brief Constructor. 39 66618 : summand_base(const data::variable_list& summation_variables, const data::data_expression& condition) 40 66618 : : m_summation_variables(summation_variables), 41 66618 : m_condition(condition) 42 66618 : {} 43 : 44 : /// \brief Returns the sequence of summation variables. 45 : /// \return The sequence of summation variables. 46 96464 : data::variable_list& summation_variables() 47 : { 48 96464 : return m_summation_variables; 49 : } 50 : 51 : /// \brief Returns the sequence of summation variables. 52 : /// \return The sequence of summation variables. 53 91742 : const data::variable_list& summation_variables() const 54 : { 55 91742 : return m_summation_variables; 56 : } 57 : 58 : /// \brief Returns the condition expression. 59 : /// \return The condition expression. 60 295139 : const data::data_expression& condition() const 61 : { 62 295139 : return m_condition; 63 : } 64 : 65 : /// \brief Returns the condition expression. 66 : /// \return The condition expression. 67 51822 : data::data_expression& condition() 68 : { 69 51822 : return m_condition; 70 : } 71 : 72 : /// \brief Swaps the contents 73 : void swap(summand_base& other) 74 : { 75 : using std::swap; 76 : swap(m_summation_variables, other.m_summation_variables); 77 : swap(m_condition, other.m_condition); 78 : } 79 : }; 80 : 81 : } // namespace lps 82 : 83 : } // namespace mcrl2 84 : 85 : #endif // MCRL2_LPS_SUMMAND_H