|
PPL
0.12.1
|
00001 /* PIP_Problem class implementation: inline functions. 00002 Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it> 00003 Copyright (C) 2010-2012 BUGSENG srl (http://bugseng.com) 00004 00005 This file is part of the Parma Polyhedra Library (PPL). 00006 00007 The PPL is free software; you can redistribute it and/or modify it 00008 under the terms of the GNU General Public License as published by the 00009 Free Software Foundation; either version 3 of the License, or (at your 00010 option) any later version. 00011 00012 The PPL is distributed in the hope that it will be useful, but WITHOUT 00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software Foundation, 00019 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. 00020 00021 For the most up-to-date information see the Parma Polyhedra Library 00022 site: http://bugseng.com/products/ppl/ . */ 00023 00024 #ifndef PPL_PIP_Problem_inlines_hh 00025 #define PPL_PIP_Problem_inlines_hh 1 00026 00027 namespace Parma_Polyhedra_Library { 00028 00029 inline dimension_type 00030 PIP_Problem::space_dimension() const { 00031 return external_space_dim; 00032 } 00033 00034 inline dimension_type 00035 PIP_Problem::max_space_dimension() { 00036 return Constraint::max_space_dimension(); 00037 } 00038 00039 inline PIP_Problem::const_iterator 00040 PIP_Problem::constraints_begin() const { 00041 return input_cs.begin(); 00042 } 00043 00044 inline PIP_Problem::const_iterator 00045 PIP_Problem::constraints_end() const { 00046 return input_cs.end(); 00047 } 00048 00049 inline const Variables_Set& 00050 PIP_Problem::parameter_space_dimensions() const { 00051 return parameters; 00052 } 00053 00054 inline void 00055 PIP_Problem::m_swap(PIP_Problem& y) { 00056 using std::swap; 00057 swap(external_space_dim, y.external_space_dim); 00058 swap(internal_space_dim, y.internal_space_dim); 00059 swap(status, y.status); 00060 swap(current_solution, y.current_solution); 00061 swap(input_cs, y.input_cs); 00062 swap(first_pending_constraint, y.first_pending_constraint); 00063 swap(parameters, y.parameters); 00064 swap(initial_context, y.initial_context); 00065 for (dimension_type i = CONTROL_PARAMETER_NAME_SIZE; i-- > 0; ) 00066 swap(control_parameters[i], y.control_parameters[i]); 00067 swap(big_parameter_dimension, y.big_parameter_dimension); 00068 } 00069 00070 inline PIP_Problem& 00071 PIP_Problem::operator=(const PIP_Problem& y) { 00072 PIP_Problem tmp(y); 00073 m_swap(tmp); 00074 return *this; 00075 } 00076 00077 inline PIP_Problem::Control_Parameter_Value 00078 PIP_Problem::get_control_parameter(Control_Parameter_Name name) const { 00079 PPL_ASSERT(name >= 0 && name < CONTROL_PARAMETER_NAME_SIZE); 00080 return control_parameters[name]; 00081 } 00082 00083 inline dimension_type 00084 PIP_Problem::get_big_parameter_dimension() const { 00085 return big_parameter_dimension; 00086 } 00087 00089 inline void 00090 swap(PIP_Problem& x, PIP_Problem& y) { 00091 x.m_swap(y); 00092 } 00093 00094 } // namespace Parma_Polyhedra_Library 00095 00096 #endif // !defined(PPL_PIP_Problem_inlines_hh)