# HG changeset patch # User alpar # Date 1104876882 0 # Node ID e27446e1deda76ddfe709177da3ce197515ca2bb # Parent 38a49245a701046085d781fb459c72de45055de0 Conversion constructor added diff -r 38a49245a701 -r e27446e1deda src/lemon/xy.h --- a/src/lemon/xy.h Tue Jan 04 17:54:41 2005 +0000 +++ b/src/lemon/xy.h Tue Jan 04 22:14:42 2005 +0000 @@ -61,6 +61,9 @@ xy(T a, T b) : x(a), y(b) { } + ///Conversion constructor + template xy(const xy &p) : x(p.x), y(p.y) {} + ///Gives back the square of the norm of the vector T normSquare(){ return x*x+y*y; @@ -105,6 +108,13 @@ return b+=u; }; + ///Returns the neg of the vectors + xy operator-() const { + xy b=*this; + b.x=-b.x; b.y=-b.y; + return b; + }; + ///Returns the difference of two vectors xy operator-(const xy &u) const { xy b=*this;