00001 /* 00002 * Copyright (C) 2007 A.N. Yzelman 00003 * Released under LGPL, see license.txt 00004 * 00005 * Last modified at 8th of March, 2007, by A.N. Yzelman 00006 * 00007 * Polytope.cpp: Implementation of the functions described in Polytope.h 00008 * 00009 */ 00010 00011 #include "Polytope.h" 00012 00013 double Polytope::getMaxCoordinateOnDimension( const int dimension ) const { 00014 //straightforwardly implemented 00015 double max = _points[0].getCoordinate(dimension); 00016 for ( unsigned int i=1; i<_points.size(); i++ ) { 00017 double const cur = _points[i].getCoordinate(dimension); 00018 if (max < cur) 00019 max = cur; 00020 } 00021 return max; 00022 } 00023 00024 double Polytope::getMinCoordinateOnDimension( const int dimension ) const { 00025 //straightforward... 00026 double min = _points[0].getCoordinate(dimension); 00027 for ( unsigned int i=1; i<_points.size(); i++ ) { 00028 double const cur = _points[i].getCoordinate(dimension); 00029 if (min > cur) 00030 min = cur; 00031 } 00032 return min; 00033 } 00034 00035 int Polytope::getNumberOfAngles() const { 00036 return _points.size(); 00037 } 00038 00039 Point Polytope::getCoordinate( const int i ) const { 00040 return _points.at( i ); 00041 } 00042 00043 int Polytope::getDimension() const { 00044 return getCoordinate( 0 ).getDimension(); 00045 } 00046 00047 int Polytope::getIdentification() const { 00048 return identification; 00049 }