1.1 --- a/doc/coding_style.dox Wed Jul 19 15:13:24 2006 +0000
1.2 +++ b/doc/coding_style.dox Thu Jul 20 06:20:27 2006 +0000
1.3 @@ -11,6 +11,14 @@
1.4 it. Please comply with these conventions if you want to contribute
1.5 developing LEMON library.
1.6
1.7 +\note When the coding style requires the capitalization of an abbreviation,
1.8 +only the first letter should be upper case.
1.9 +
1.10 +\code
1.11 +XmlReader
1.12 +\endcode
1.13 +
1.14 +
1.15 \warning In some cases we diverge from these rules.
1.16 This primary done because STL uses different naming convention and
1.17 in certain cases
2.1 --- a/doc/dirs.dox Wed Jul 19 15:13:24 2006 +0000
2.2 +++ b/doc/dirs.dox Thu Jul 20 06:20:27 2006 +0000
2.3 @@ -9,7 +9,8 @@
2.4 /**
2.5 \dir doc
2.6 \brief Auxiliary (and the whole generated) documentation.
2.7 - Auxiliary (and the whole generated) documentation.
2.8 +
2.9 +Auxiliary (and the whole generated) documentation.
2.10 */
2.11
2.12 /**
3.1 --- a/doc/namespaces.dox Wed Jul 19 15:13:24 2006 +0000
3.2 +++ b/doc/namespaces.dox Thu Jul 20 06:20:27 2006 +0000
3.3 @@ -1,12 +1,12 @@
3.4 /// The namespace of LEMON
3.5
3.6 -/// \todo Some more detailed description would be nice here.
3.7 +/// The namespace of LEMON
3.8 ///
3.9 namespace lemon {
3.10
3.11 /// The namespace of LEMON concepts and concept checking classes
3.12
3.13 - /// \todo Some more detailed description would be nice here.
3.14 + /// The namespace of LEMON concepts and concept checking classes
3.15 ///
3.16 namespace concept {}
3.17 }
4.1 --- a/doc/template.h Wed Jul 19 15:13:24 2006 +0000
4.2 +++ b/doc/template.h Thu Jul 20 06:20:27 2006 +0000
4.3 @@ -1,7 +1,9 @@
4.4 /* -*- C++ -*-
4.5 - * lemon/template.h - Part of LEMON, a generic C++ optimization library
4.6 *
4.7 - * Copyright (C) 2006 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
4.8 + * This file is a part of LEMON, a generic C++ optimization library
4.9 + *
4.10 + * Copyright (C) 2003-2006
4.11 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
4.12 * (Egervary Research Group on Combinatorial Optimization, EGRES).
4.13 *
4.14 * Permission to use, modify and distribute this software is granted
5.1 --- a/lemon/xy.h Wed Jul 19 15:13:24 2006 +0000
5.2 +++ b/lemon/xy.h Thu Jul 20 06:20:27 2006 +0000
5.3 @@ -47,6 +47,13 @@
5.4 ///with the usual vector
5.5 /// operators.
5.6 ///
5.7 + ///\note As you might have noticed, this class does not follow the
5.8 + ///\ref naming_conv "LEMON Coding Style" (it should be called \c Xy
5.9 + ///according to it). There is a stupid Hungarian proverb, "A kivétel
5.10 + ///erõsíti a szabályt" ("An exception
5.11 + ///reinforces a rule", which is
5.12 + ///actually a mistranslation of the Latin proverb "Exceptio probat regulam").
5.13 + ///This class is an example for that.
5.14 ///\author Attila Bernath
5.15 template<typename T>
5.16 class xy {
5.17 @@ -63,106 +70,106 @@
5.18 ///Default constructor
5.19 xy() {}
5.20
5.21 - ///Constructing the instance from coordinates
5.22 + ///Construct an instance from coordinates
5.23 xy(T a, T b) : x(a), y(b) { }
5.24
5.25
5.26 ///Conversion constructor
5.27 template<class TT> xy(const xy<TT> &p) : x(p.x), y(p.y) {}
5.28
5.29 - ///Gives back the square of the norm of the vector
5.30 + ///Give back the square of the norm of the vector
5.31 T normSquare() const {
5.32 return x*x+y*y;
5.33 }
5.34
5.35 - ///Increments the left hand side by u
5.36 + ///Increment the left hand side by u
5.37 xy<T>& operator +=(const xy<T>& u) {
5.38 x += u.x;
5.39 y += u.y;
5.40 return *this;
5.41 }
5.42
5.43 - ///Decrements the left hand side by u
5.44 + ///Decrement the left hand side by u
5.45 xy<T>& operator -=(const xy<T>& u) {
5.46 x -= u.x;
5.47 y -= u.y;
5.48 return *this;
5.49 }
5.50
5.51 - ///Multiplying the left hand side with a scalar
5.52 + ///Multiply the left hand side with a scalar
5.53 xy<T>& operator *=(const T &u) {
5.54 x *= u;
5.55 y *= u;
5.56 return *this;
5.57 }
5.58
5.59 - ///Dividing the left hand side by a scalar
5.60 + ///Divide the left hand side by a scalar
5.61 xy<T>& operator /=(const T &u) {
5.62 x /= u;
5.63 y /= u;
5.64 return *this;
5.65 }
5.66
5.67 - ///Returns the scalar product of two vectors
5.68 + ///Return the scalar product of two vectors
5.69 T operator *(const xy<T>& u) const {
5.70 return x*u.x+y*u.y;
5.71 }
5.72
5.73 - ///Returns the sum of two vectors
5.74 + ///Return the sum of two vectors
5.75 xy<T> operator+(const xy<T> &u) const {
5.76 xy<T> b=*this;
5.77 return b+=u;
5.78 }
5.79
5.80 - ///Returns the neg of the vectors
5.81 + ///Return the neg of the vectors
5.82 xy<T> operator-() const {
5.83 xy<T> b=*this;
5.84 b.x=-b.x; b.y=-b.y;
5.85 return b;
5.86 }
5.87
5.88 - ///Returns the difference of two vectors
5.89 + ///Return the difference of two vectors
5.90 xy<T> operator-(const xy<T> &u) const {
5.91 xy<T> b=*this;
5.92 return b-=u;
5.93 }
5.94
5.95 - ///Returns a vector multiplied by a scalar
5.96 + ///Return a vector multiplied by a scalar
5.97 xy<T> operator*(const T &u) const {
5.98 xy<T> b=*this;
5.99 return b*=u;
5.100 }
5.101
5.102 - ///Returns a vector divided by a scalar
5.103 + ///Return a vector divided by a scalar
5.104 xy<T> operator/(const T &u) const {
5.105 xy<T> b=*this;
5.106 return b/=u;
5.107 }
5.108
5.109 - ///Testing equality
5.110 + ///Test equality
5.111 bool operator==(const xy<T> &u) const {
5.112 return (x==u.x) && (y==u.y);
5.113 }
5.114
5.115 - ///Testing inequality
5.116 + ///Test inequality
5.117 bool operator!=(xy u) const {
5.118 return (x!=u.x) || (y!=u.y);
5.119 }
5.120
5.121 };
5.122
5.123 - ///Returns an xy
5.124 + ///Return an xy
5.125
5.126 - ///Returns an xy
5.127 + ///Return an xy
5.128 ///\relates xy
5.129 template <typename T>
5.130 inline xy<T> make_xy(const T& x, const T& y) {
5.131 return xy<T>(x, y);
5.132 }
5.133
5.134 - ///Returns a vector multiplied by a scalar
5.135 + ///Return a vector multiplied by a scalar
5.136
5.137 - ///Returns a vector multiplied by a scalar
5.138 + ///Return a vector multiplied by a scalar
5.139 ///\relates xy
5.140 template<typename T> xy<T> operator*(const T &u,const xy<T> &x) {
5.141 return x*u;
5.142 @@ -219,6 +226,17 @@
5.143 return xy<T>(-z.y,z.x);
5.144 }
5.145
5.146 + ///Rotate by 180 degrees
5.147 +
5.148 + ///Returns its parameter rotated by 180 degrees.
5.149 + ///\relates xy
5.150 + ///
5.151 + template<typename T>
5.152 + inline xy<T> rot180(const xy<T> &z)
5.153 + {
5.154 + return xy<T>(-z.x,-z.y);
5.155 + }
5.156 +
5.157 ///Rotate by 270 degrees
5.158
5.159 ///Returns its parameter rotated by 90 degrees in negative direction.
5.160 @@ -246,7 +264,7 @@
5.161 ///Default constructor: creates an empty bounding box
5.162 BoundingBox() { _empty = true; }
5.163
5.164 - ///Constructing the instance from one point
5.165 + ///Construct an instance from one point
5.166 BoundingBox(xy<T> a) { bottom_left=top_right=a; _empty = false; }
5.167
5.168 ///Were any points added?
5.169 @@ -254,117 +272,153 @@
5.170 return _empty;
5.171 }
5.172
5.173 - ///Makes the BoundingBox empty
5.174 + ///Make the BoundingBox empty
5.175 void clear() {
5.176 _empty=1;
5.177 }
5.178
5.179 - ///\brief Gives back the bottom left corner
5.180 - ///(if the bounding box is empty, then the return value is not defined)
5.181 + ///Give back the bottom left corner
5.182 +
5.183 + ///Give back the bottom left corner.
5.184 + ///If the bounding box is empty, then the return value is not defined.
5.185 xy<T> bottomLeft() const {
5.186 return bottom_left;
5.187 }
5.188
5.189 - ///\brief Sets the bottom left corner
5.190 - ///(should only bee used for non-empty box)
5.191 + ///Set the bottom left corner
5.192 +
5.193 + ///Set the bottom left corner.
5.194 + ///It should only bee used for non-empty box.
5.195 void bottomLeft(xy<T> p) {
5.196 bottom_left = p;
5.197 }
5.198
5.199 - ///\brief Gives back the top right corner
5.200 - ///(if the bounding box is empty, then the return value is not defined)
5.201 + ///Give back the top right corner
5.202 +
5.203 + ///Give back the top right corner.
5.204 + ///If the bounding box is empty, then the return value is not defined.
5.205 xy<T> topRight() const {
5.206 return top_right;
5.207 }
5.208
5.209 - ///\brief Sets the top right corner
5.210 - ///(should only bee used for non-empty box)
5.211 + ///Set the top right corner
5.212 +
5.213 + ///Set the top right corner.
5.214 + ///It should only bee used for non-empty box.
5.215 void topRight(xy<T> p) {
5.216 top_right = p;
5.217 }
5.218
5.219 - ///\brief Gives back the bottom right corner
5.220 - ///(if the bounding box is empty, then the return value is not defined)
5.221 + ///Give back the bottom right corner
5.222 +
5.223 + ///Give back the bottom right corner.
5.224 + ///If the bounding box is empty, then the return value is not defined.
5.225 xy<T> bottomRight() const {
5.226 return xy<T>(top_right.x,bottom_left.y);
5.227 }
5.228
5.229 - ///\brief Sets the bottom right corner
5.230 - ///(should only bee used for non-empty box)
5.231 + ///Set the bottom right corner
5.232 +
5.233 + ///Set the bottom right corner.
5.234 + ///It should only bee used for non-empty box.
5.235 void bottomRight(xy<T> p) {
5.236 top_right.x = p.x;
5.237 bottom_left.y = p.y;
5.238 }
5.239 +
5.240 + ///Give back the top left corner
5.241
5.242 - ///\brief Gives back the top left corner
5.243 - ///(if the bounding box is empty, then the return value is not defined)
5.244 + ///Give back the top left corner.
5.245 + ///If the bounding box is empty, then the return value is not defined.
5.246 xy<T> topLeft() const {
5.247 return xy<T>(bottom_left.x,top_right.y);
5.248 }
5.249
5.250 - ///\brief Sets the top left corner
5.251 - ///(should only bee used for non-empty box)
5.252 + ///Set the top left corner
5.253 +
5.254 + ///Set the top left corner.
5.255 + ///It should only bee used for non-empty box.
5.256 void topLeft(xy<T> p) {
5.257 top_right.y = p.y;
5.258 bottom_left.x = p.x;
5.259 }
5.260
5.261 - ///\brief Gives back the bottom of the box
5.262 - ///(if the bounding box is empty, then the return value is not defined)
5.263 + ///Give back the bottom of the box
5.264 +
5.265 + ///Give back the bottom of the box.
5.266 + ///If the bounding box is empty, then the return value is not defined.
5.267 T bottom() const {
5.268 return bottom_left.y;
5.269 }
5.270
5.271 - ///\brief Sets the bottom of the box
5.272 - ///(should only bee used for non-empty box)
5.273 + ///Set the bottom of the box
5.274 +
5.275 + ///Set the bottom of the box.
5.276 + ///It should only bee used for non-empty box.
5.277 void bottom(T t) {
5.278 bottom_left.y = t;
5.279 }
5.280
5.281 - ///\brief Gives back the top of the box
5.282 - ///(if the bounding box is empty, then the return value is not defined)
5.283 + ///Give back the top of the box
5.284 +
5.285 + ///Give back the top of the box.
5.286 + ///If the bounding box is empty, then the return value is not defined.
5.287 T top() const {
5.288 return top_right.y;
5.289 }
5.290
5.291 - ///\brief Sets the top of the box
5.292 - ///(should only bee used for non-empty box)
5.293 + ///Set the top of the box
5.294 +
5.295 + ///Set the top of the box.
5.296 + ///It should only bee used for non-empty box.
5.297 void top(T t) {
5.298 top_right.y = t;
5.299 }
5.300
5.301 - ///\brief Gives back the left side of the box
5.302 - ///(if the bounding box is empty, then the return value is not defined)
5.303 + ///Give back the left side of the box
5.304 +
5.305 + ///Give back the left side of the box.
5.306 + ///If the bounding box is empty, then the return value is not defined.
5.307 T left() const {
5.308 return bottom_left.x;
5.309 }
5.310 +
5.311 + ///Set the left side of the box
5.312
5.313 - ///\brief Sets the left side of the box
5.314 - ///(should only bee used for non-empty box)
5.315 + ///Set the left side of the box.
5.316 + ///It should only bee used for non-empty box
5.317 void left(T t) {
5.318 bottom_left.x = t;
5.319 }
5.320
5.321 - ///\brief Gives back the right side of the box
5.322 - ///(if the bounding box is empty, then the return value is not defined)
5.323 + /// Give back the right side of the box
5.324 +
5.325 + /// Give back the right side of the box.
5.326 + ///If the bounding box is empty, then the return value is not defined.
5.327 T right() const {
5.328 return top_right.x;
5.329 }
5.330
5.331 - ///\brief Sets the right side of the box
5.332 - ///(should only bee used for non-empty box)
5.333 + ///Set the right side of the box
5.334 +
5.335 + ///Set the right side of the box.
5.336 + ///It should only bee used for non-empty box
5.337 void right(T t) {
5.338 top_right.x = t;
5.339 }
5.340
5.341 - ///\brief Gives back the height of the box
5.342 - ///(if the bounding box is empty, then the return value is not defined)
5.343 + ///Give back the height of the box
5.344 +
5.345 + ///Give back the height of the box.
5.346 + ///If the bounding box is empty, then the return value is not defined.
5.347 T height() const {
5.348 return top_right.y-bottom_left.y;
5.349 }
5.350
5.351 - ///\brief Gives back the width of the box
5.352 - ///(if the bounding box is empty, then the return value is not defined)
5.353 + ///Give back the width of the box
5.354 +
5.355 + ///Give back the width of the box.
5.356 + ///If the bounding box is empty, then the return value is not defined.
5.357 T width() const {
5.358 return top_right.x-bottom_left.x;
5.359 }