ldpk
List of all members
ldpk::vec2d Class Reference

A class for two-dimensional double-valued vectors We have added this class and ldpk::mat2d in order to deliver a self-consistent kit. You may use this one or your own vector and matrix classes, at your choice. If you prefer your own classes, it will be necessary to add a handful of functions like dot(), dotsq(), norm2() for vec2d and invert() for mat2d, which provide standard functions, but do not have standardized nomenclature. More...

#include <ldpk_vec2d.h>

Public Member Functions

Constructors
 vec2d ()
 Default: null vector.
 
 vec2d (const vec2d &a)
 Copy constructor.
 
 vec2d (double x0, double x1)
 Constructing by components.
 
Accessing components
const double & operator[] (int i) const
 
double & operator[] (int i)
 

Friends

Special vector functions
double dotsq (const vec2d &a)
 Inner product square.
 
double dot (const vec2d &a, const vec2d &b)
 Inner product.
 
double norm2 (const vec2d &a)
 Euclidian norm.
 
vec2d unit (const vec2d &v)
 Unit vector.
 
I/O functions
std::ostream & operator<< (std::ostream &cout, const vec2d &a)
 
std::istream & operator>> (std::istream &cin, vec2d &a)
 

Arithmetic operations

vec2doperator+= (const vec2d &a)
 
vec2d operator+ (const vec2d &a) const
 
vec2doperator-= (const vec2d &a)
 
vec2d operator- (const vec2d &a) const
 
vec2doperator*= (double q)
 
vec2d operator* (double q) const
 
vec2doperator/= (double q)
 
vec2d operator/ (double q) const
 
vec2d operator- ()
 
vec2d operator* (double q, const vec2d &a)
 

Detailed Description

A class for two-dimensional double-valued vectors We have added this class and ldpk::mat2d in order to deliver a self-consistent kit. You may use this one or your own vector and matrix classes, at your choice. If you prefer your own classes, it will be necessary to add a handful of functions like dot(), dotsq(), norm2() for vec2d and invert() for mat2d, which provide standard functions, but do not have standardized nomenclature.


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