Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Vector_2< Type > Class Template Reference

#include <mapbasic.h>

Inheritance diagram for Vector_2< Type >:
Collaboration diagram for Vector_2< Type >:

Public Types

typedef R_ R
 
typedef R::RT RT
 
typedef R::FT FT
 
typedef R::Vector_2_base RVector_2
 

Public Member Functions

 Vector_2 ()
 
 Vector_2 (Type t)
 
 Vector_2 (Null_vector)
 
 Vector_2 (Type a, Type b)
 
Type & operator[] (const int i)
 
const Type & operator[] (const int &i) const
 
Type x () const
 
Type y () const
 
Vector_2operator+= (const Vector_2 &v)
 Assign operators. More...
 
Vector_2operator-= (const Vector_2 &v)
 
Vector_2operator*= (const Type t)
 
Vector_2operator/= (const Type t)
 
Vector_2 operator+ (const Vector_2 &v) const
 Arithmatic operators. More...
 
Vector_2 operator- (const Vector_2 &v) const
 
Vector_2 operator* (const Type t) const
 
Vector_2 operator/ (const Type t) const
 
Type operator* (const Vector_2 &v) const
 
Vector_2 operator- () const
 
Type squared_norm () const
 
Type norm () const
 
Vector_2normalize ()
 
Vector_2neg ()
 
bool operator== (const Vector_2 &p) const
 
bool operator!= (const Vector_2 &p) const
 
bool operator< (const Vector_2 &v) const
 
bool is_null () const
 
 Vector_2 ()
 
 Vector_2 (const CGAL::Vector_2< R > &v)
 
 Vector_2 (const RVector_2 &v)
 
 Vector_2 (const Null_vector &v)
 
 Vector_2 (const RT &x, const RT &y)
 
 Vector_2 (const RT &x, const RT &y, const RT &w)
 
bool operator== (const CGAL::Vector_2< R > &v) const
 
bool operator!= (const CGAL::Vector_2< R > &v) const
 
bool operator== (const Null_vector &v) const
 
bool operator!= (const Null_vector &v) const
 
RT hx () const
 
RT hy () const
 
RT hw () const
 
FT x () const
 
FT y () const
 
RT homogeneous (int i) const
 
FT cartesian (int i) const
 
FT operator[] (int i) const
 
int dimension () const
 
CGAL::Vector_2< Roperator+ (const CGAL::Vector_2< R > &w) const
 
CGAL::Vector_2< Roperator- (const CGAL::Vector_2< R > &w) const
 
CGAL::Vector_2< Roperator- () const
 
FT operator* (const CGAL::Vector_2< R > &w) const
 
CGAL::Vector_2< Roperator* (const RT &c) const
 
CGAL::Vector_2< Roperator* (const Quotient< RT > &q) const
 
CGAL::Vector_2< Roperator/ (const Quotient< RT > &q) const
 
CGAL::Vector_2< Roperator/ (const RT &c) const
 
CGAL::Direction_2< Rdirection () const
 
CGAL::Vector_2< Rperpendicular (const Orientation &o) const
 
CGAL::Vector_2< Rtransform (const CGAL::Aff_transformation_2< R > &t) const
 

Protected Attributes

Type _x
 
Type _y
 

Private Member Functions

 Vector_2 (const CGAL::Point_2< R > &p)
 
 Vector_2 (const CGAL::Direction_2< R > &d)
 

Friends

CGAL_FRIEND_INLINE
CGAL::Vector_2< R > CGAL_SCOPE
point_to_vector_conversion 
CGAL_NULL_TMPL_ARGS (const CGAL::Point_2< R > &p)
 

Detailed Description

template<class Type>
class Vector_2< Type >

Definition at line 199 of file mapbasic.h.

Member Typedef Documentation

typedef R::FT FT

Definition at line 84 of file Vector_2.h.

typedef R_ R

Definition at line 82 of file Vector_2.h.

typedef R::RT RT

Definition at line 83 of file Vector_2.h.

typedef R::Vector_2_base RVector_2

Definition at line 85 of file Vector_2.h.

Constructor & Destructor Documentation

Vector_2 ( )
inline

Definition at line 201 of file mapbasic.h.

Referenced by Vector_2< T >::operator*(), Vector_2< T >::operator+(), Vector_2< T >::operator-(), and Vector_2< T >::operator/().

201 {}

Here is the caller graph for this function:

Vector_2 ( Type  t)
inlineexplicit

Definition at line 202 of file mapbasic.h.

202 : _x(t), _y(t) {}
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Vector_2 ( Null_vector  )
inline

Definition at line 203 of file mapbasic.h.

203 : _x(0), _y(0) {}
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Vector_2 ( Type  a,
Type  b 
)
inline

Definition at line 204 of file mapbasic.h.

204 : _x(a), _y(b) {}
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Vector_2 ( )
inline

Definition at line 92 of file Vector_2.h.

92 {}
Vector_2 ( const CGAL::Vector_2< R > &  v)
inline

Definition at line 94 of file Vector_2.h.

94 : RVector_2((const RVector_2&)v) {}
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
Vector_2 ( const RVector_2< Type > &  v)
inline

Definition at line 96 of file Vector_2.h.

96 : RVector_2(v) {}
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
Vector_2 ( const Null_vector v)
inline

Definition at line 98 of file Vector_2.h.

98 : RVector_2(v) {}
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
Vector_2 ( const RT x,
const RT y 
)
inline

Definition at line 100 of file Vector_2.h.

100 : RVector_2(x,y) {}
Type x() const
Definition: mapbasic.h:208
Type y() const
Definition: mapbasic.h:209
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
Vector_2 ( const RT x,
const RT y,
const RT w 
)
inline

Definition at line 102 of file Vector_2.h.

102 : RVector_2(x,y,w) {}
Type x() const
Definition: mapbasic.h:208
Type y() const
Definition: mapbasic.h:209
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
Vector_2 ( const CGAL::Point_2< R > &  p)
inlineprivate

Definition at line 201 of file Vector_2.h.

201 : RVector_2(p) {}
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
Vector_2 ( const CGAL::Direction_2< R > &  d)
inlineprivate

Definition at line 203 of file Vector_2.h.

203 : RVector_2(d) {}
const NT & d
R::Vector_2_base RVector_2
Definition: Vector_2.h:85

Member Function Documentation

FT cartesian ( int  i) const
inline

Definition at line 143 of file Vector_2.h.

Referenced by Vector_2< T >::operator[]().

144  { return RVector_2::cartesian(i); }
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

int dimension ( ) const
inline

Definition at line 151 of file Vector_2.h.

152  { return 2; }
CGAL::Direction_2<R> direction ( ) const
inline

Definition at line 189 of file Vector_2.h.

190  { return RVector_2::direction(); }
RT homogeneous ( int  i) const
inline

Definition at line 139 of file Vector_2.h.

140  { return RVector_2::homogeneous(i); }
blockLoc i
Definition: read.cpp:79
RT hw ( ) const
inline

Definition at line 130 of file Vector_2.h.

131  { return RVector_2::hw(); }
RT hx ( ) const
inline

Definition at line 122 of file Vector_2.h.

123  { return RVector_2::hx(); }
RT hy ( ) const
inline

Definition at line 126 of file Vector_2.h.

127  { return RVector_2::hy(); }
bool is_null ( ) const
inline

Definition at line 259 of file mapbasic.h.

259 { return _x==0&&_y==0; }
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Vector_2& neg ( )
inline

Definition at line 246 of file mapbasic.h.

246  {
247  _x = -_x; _y = -_y; return *this;
248  }
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Type norm ( ) const
inline

Definition at line 238 of file mapbasic.h.

238 { return std::sqrt(*this * *this); }
double sqrt(double d)
Definition: double.h:73
Vector_2& normalize ( )
inline

Definition at line 240 of file mapbasic.h.

240  {
241  Type s=squared_norm();
242  if ( s != Type(0)) { s=std::sqrt(s); _x/=s; _y/=s; }
243  return *this;
244  }
double s
Definition: blastest.C:80
double sqrt(double d)
Definition: double.h:73
Type squared_norm() const
Definition: mapbasic.h:236
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
bool operator!= ( const CGAL::Vector_2< R > &  v) const
inline

Definition at line 110 of file Vector_2.h.

111  { return !(*this == v); }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
bool operator!= ( const Null_vector v) const
inline

Definition at line 118 of file Vector_2.h.

119  { return !(*this == v); }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
bool operator!= ( const Vector_2< Type > &  p) const
inline

Definition at line 253 of file mapbasic.h.

254  { return x()!=p.x() || y()!=p.y(); }
Type x() const
Definition: mapbasic.h:208
Type y() const
Definition: mapbasic.h:209
FT operator* ( const CGAL::Vector_2< R > &  w) const
inline

Definition at line 167 of file Vector_2.h.

168  { return (const RVector_2&)(*this) * (const RVector_2&)(w); }
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
CGAL::Vector_2<R> operator* ( const RT c) const
inline

Definition at line 172 of file Vector_2.h.

173  { return c * (const RVector_2&)(*this); }
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
CGAL::Vector_2<R> operator* ( const Quotient< RT > &  q) const
inline

Definition at line 176 of file Vector_2.h.

177  { return (q.numerator() * (const RVector_2&)(*this)) / q.denominator(); }
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
Vector_2 operator* ( const Type  t) const
inline

Definition at line 226 of file mapbasic.h.

227  { return Vector_2(_x*t, _y*t); }
Vector_2()
Definition: mapbasic.h:201
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Type operator* ( const Vector_2< Type > &  v) const
inline

Definition at line 230 of file mapbasic.h.

231  { return _x*v._x + _y*v._y; }
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Vector_2& operator*= ( const Type  t)
inline

Definition at line 216 of file mapbasic.h.

217  { _x*=t; _y*=t; return *this; }
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
CGAL::Vector_2<R> operator+ ( const CGAL::Vector_2< R > &  w) const
inline

Definition at line 155 of file Vector_2.h.

156  { return (const RVector_2&)(*this) + (const RVector_2&)(w); }
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
Vector_2 operator+ ( const Vector_2< Type > &  v) const
inline

Arithmatic operators.

Definition at line 222 of file mapbasic.h.

223  { return Vector_2(_x+v._x, _y+v._y); }
Vector_2()
Definition: mapbasic.h:201
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Vector_2& operator+= ( const Vector_2< Type > &  v)
inline

Assign operators.

Definition at line 212 of file mapbasic.h.

213  { _x+=v._x; _y+=v._y; return *this; }
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
CGAL::Vector_2<R> operator- ( const CGAL::Vector_2< R > &  w) const
inline

Definition at line 159 of file Vector_2.h.

160  { return (const RVector_2&)(*this) - (const RVector_2&)(w); }
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
CGAL::Vector_2<R> operator- ( ) const
inline

Definition at line 163 of file Vector_2.h.

164  { return RVector_2::operator-(); }
Point_2< R > operator-(const Origin &o, const Vector_2< R > &v)
Vector_2 operator- ( const Vector_2< Type > &  v) const
inline

Definition at line 224 of file mapbasic.h.

225  { return Vector_2(_x-v._x, _y-v._y); }
Vector_2()
Definition: mapbasic.h:201
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Vector_2 operator- ( ) const
inline

Definition at line 233 of file mapbasic.h.

234  { return Vector_2(-_x, -_y); }
Vector_2()
Definition: mapbasic.h:201
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Vector_2& operator-= ( const Vector_2< Type > &  v)
inline

Definition at line 214 of file mapbasic.h.

215  { _x-=v._x; _y-=v._y; return *this; }
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
CGAL::Vector_2<R> operator/ ( const Quotient< RT > &  q) const
inline

Definition at line 180 of file Vector_2.h.

181  { return (q.denominator() * (const RVector_2&)(*this)) / q.numerator(); }
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
CGAL::Vector_2<R> operator/ ( const RT c) const
inline

Definition at line 185 of file Vector_2.h.

186  { return (const RVector_2&)(*this) / c; }
R::Vector_2_base RVector_2
Definition: Vector_2.h:85
Vector_2 operator/ ( const Type  t) const
inline

Definition at line 228 of file mapbasic.h.

229  { return Vector_2(_x/t, _y/t); }
Vector_2()
Definition: mapbasic.h:201
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
Vector_2& operator/= ( const Type  t)
inline

Definition at line 218 of file mapbasic.h.

219  { _x/=t; _y/=t; return *this; }
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
bool operator< ( const Vector_2< Type > &  v) const
inline

Definition at line 256 of file mapbasic.h.

Referenced by Point_2< R >::operator<().

257  { return _x<v._x || _x==v._x && _y<v._y; }
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262

Here is the caller graph for this function:

bool operator== ( const CGAL::Vector_2< R > &  v) const
inline

Definition at line 106 of file Vector_2.h.

107  { return RVector_2::operator==(v); }
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE bool operator==(const Origin &o, const Point_2< R > &p)
Definition: Point_2.h:239
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
bool operator== ( const Null_vector v) const
inline

Definition at line 114 of file Vector_2.h.

115  { return RVector_2::operator==(v); }
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE bool operator==(const Origin &o, const Point_2< R > &p)
Definition: Point_2.h:239
bool operator== ( const Vector_2< Type > &  p) const
inline

Definition at line 250 of file mapbasic.h.

251  { return x()==p.x() && y()==p.y(); }
Type x() const
Definition: mapbasic.h:208
Type y() const
Definition: mapbasic.h:209
FT operator[] ( int  i) const
inline

Definition at line 147 of file Vector_2.h.

148  { return cartesian(i); }
blockLoc i
Definition: read.cpp:79
FT cartesian(int i) const
Definition: Vector_2.h:143
Type& operator[] ( const int  i)
inline

Definition at line 205 of file mapbasic.h.

205 { return i==0?_x:_y; }
blockLoc i
Definition: read.cpp:79
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
const Type& operator[] ( const int &  i) const
inline

Definition at line 206 of file mapbasic.h.

206 { return i==0?_x:_y; }
blockLoc i
Definition: read.cpp:79
Type _x
Definition: mapbasic.h:262
Type _y
Definition: mapbasic.h:262
CGAL::Vector_2<R> perpendicular ( const Orientation o) const
inline

Definition at line 193 of file Vector_2.h.

194  { return RVector_2::perpendicular(o); }
Type squared_norm ( ) const
inline

Definition at line 236 of file mapbasic.h.

Referenced by FaceOffset_3::eval_angle(), and Vector_2< T >::normalize().

236 { return *this * *this; }

Here is the caller graph for this function:

CGAL::Vector_2<R> transform ( const CGAL::Aff_transformation_2< R > &  t) const
inline

Definition at line 197 of file Vector_2.h.

198  { return RVector_2::transform(t); }
FT x ( ) const
inline

Definition at line 133 of file Vector_2.h.

134  { return RVector_2::x(); }
void int int REAL * x
Definition: read.cpp:74
FT y ( ) const
inline

Definition at line 136 of file Vector_2.h.

137  { return RVector_2::y(); }
void int int REAL REAL * y
Definition: read.cpp:74
Type y ( ) const
inline

Friends And Related Function Documentation

Member Data Documentation


The documentation for this class was generated from the following files: