00001 /* Variable class implementation (non-inline functions). 00002 Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it> 00003 Copyright (C) 2010-2011 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://www.cs.unipr.it/ppl/ . */ 00023 00024 #include <ppl-config.h> 00025 #include "Variable.defs.hh" 00026 #include <iostream> 00027 00028 namespace PPL = Parma_Polyhedra_Library; 00029 00030 PPL::Variable::output_function_type* 00031 PPL::Variable::current_output_function = 0; 00032 00033 bool 00034 PPL::Variable::OK() const { 00035 return id() < max_space_dimension(); 00036 } 00037 00038 void 00039 PPL::Variable::default_output_function(std::ostream& s, const Variable& v) { 00040 dimension_type varid = v.id(); 00041 s << static_cast<char>('A' + varid % 26); 00042 if (dimension_type i = varid / 26) 00043 s << i; 00044 } 00045 00047 std::ostream& 00048 PPL::IO_Operators::operator<<(std::ostream& s, const Variable& v) { 00049 (*Variable::current_output_function)(s, v); 00050 return s; 00051 }
1.6.3