Vector.h
Go to the documentation of this file.
292 std::ostream& operator<<(std::ostream& os, const Vector<D>& v) {
WONTON_INLINE Vector(const double &xm_comp, const double &ym_comp)
Specialized constructor for 2d Vectors.
Definition: Vector.h:68
WONTON_INLINE bool is_zero(double dst_tol) const
Check if this Vector is a zero Vector.
Definition: Vector.h:197
WONTON_INLINE Vector & operator*=(const double &s)
Scalar multiplication of this Vector by s.
Definition: Vector.h:130
WONTON_INLINE Vector()
Default constructor - zero Vector in D-space.
Definition: Vector.h:48
WONTON_INLINE double MaxComponent(const Vector< D > &v, int &icomp)
Obtain the value and index of the maximum component of a Vector.
Definition: Vector.h:326
WONTON_INLINE Vector(const double &xm_comp, const double &ym_comp, const double &zm_comp)
Specialized constructor for 3d Vectors.
Definition: Vector.h:79
WONTON_INLINE double cross(const Vector< 2 > &a, const Vector< 2 > &b)
Cross product operator for two 2d vectors, .
Definition: Vector.h:304
WONTON_INLINE double norm(bool doSqrt=true) const
Calculate the norm of a Vector.
Definition: Vector.h:148
WONTON_INLINE void fill(double val)
Convenience method for constructing a Vector with all components equal to a given value...
Definition: Vector.h:207
Factorize a number N into D equal (or nearly equal) factors.
Definition: adaptive_refinement_mesh.h:31
WONTON_INLINE Point< D > operator*(const Point< D > &p, double s)
Definition: Point.h:247
WONTON_INLINE Vector & operator/=(const double &s)
Scalar division of this Vector by s.
Definition: Vector.h:137
WONTON_INLINE double & operator[](const int &i)
Return component i of the Vector.
Definition: Vector.h:102
WONTON_INLINE Vector & operator-=(const Vector< D > &rhs)
Subtract the Vector rhs from this vector.
Definition: Vector.h:123
std::ostream & writeToStream(std::ostream &os) const
Pretty printing of a Vector to an output stream.
Definition: Vector.h:230
std::istream & readFromStream(std::istream &is)
Read in a Vector from an input stream.
Definition: Vector.h:223
WONTON_INLINE Point< D > operator/(const Point< D > &p, double s)
Definition: Point.h:259
WONTON_INLINE void normalize()
Convert this Vector into a unit Vector.
Definition: Vector.h:180
WONTON_INLINE Vector operator-() const
Negative of this vector.
Definition: Vector.h:108
Vector(std::vector< double > const &invec)
Constructor from a std:vector.
Definition: Vector.h:89
WONTON_INLINE void zero()
Convert this Vector into a zero Vector.
Definition: Vector.h:187
WONTON_INLINE double max_norm() const
Calculate the max norm of a Vector.
Definition: Vector.h:168
WONTON_INLINE Vector(const double &xm_comp)
Initialize all components to same value (also constructor for 1d vectors)
Definition: Vector.h:58
WONTON_INLINE const double & operator[](const int &i) const
Return component i of the Vector.
Definition: Vector.h:96
std::istream & operator>>(std::istream &is, Vector< D > &v)
Read in a Vector from an input stream.
Definition: Vector.h:298
WONTON_INLINE void axis(int nonZero)
Convenience method for constructing a unit Vector along a particular axis.
Definition: Vector.h:217
WONTON_INLINE double one_norm() const
Calculate the 1-norm of a Vector.
Definition: Vector.h:158
WONTON_INLINE Point< D > operator+(const Point< D > &p, const Vector< D > &v)
Definition: Point.h:227
WONTON_INLINE double dot(const Vector< D > &a, const Vector< D > &b)
Dot product of two vectors, .
Definition: Vector.h:248
WONTON_INLINE Vector & operator+=(const Vector< D > &rhs)
Add the Vector rhs to this Vector.
Definition: Vector.h:116