Vector.h File Reference
#include <cmath>
#include <cassert>
#include <iostream>
#include <vector>
#include <limits>
#include "wonton/support/wonton.h"

Go to the source code of this file.

Classes

class  Wonton::Vector< D >
 Represents a vector in N-dimensional space. More...
 

Namespaces

 Wonton
 Factorize a number N into D equal (or nearly equal) factors.
 

Typedefs

typedef Vector< 3 > Wonton::Vector3
 Alias for creating a 3D vector. More...
 
typedef Vector< 2 > Wonton::Vector2
 Alias for creating a 3D vector. More...
 

Functions

template<int D>
WONTON_INLINE double Wonton::dot (const Vector< D > &a, const Vector< D > &b)
 Dot product of two vectors, \(\vec{a} \cdot \vec{b}\). More...
 
template<int D>
WONTON_INLINE Vector< D > Wonton::operator+ (const Vector< D > &a, const Vector< D > &b)
 Add two vectors. More...
 
template<int D>
WONTON_INLINE Vector< D > Wonton::operator- (const Vector< D > &a, const Vector< D > &b)
 Subtract two vectors. More...
 
template<int D>
WONTON_INLINE Vector< D > Wonton::operator* (const Vector< D > &a, const double &s)
 Multiply a vector by a scalar, \( s \vec{a}\). More...
 
template<int D>
WONTON_INLINE Vector< D > Wonton::operator* (const double &s, const Vector< D > &a)
 Multiply a vector by a scalar, \( s \vec{a}\). More...
 
template<int D>
WONTON_INLINE Vector< D > Wonton::operator/ (const Vector< D > &a, const double &s)
 Divide a vector by a scalar, \( \frac{1}{s} \vec{a}\). More...
 
template<int D>
std::ostream & Wonton::operator<< (std::ostream &os, const Vector< D > &v)
 Pretty printing of a Vector to an output stream. More...
 
template<int D>
std::istream & Wonton::operator>> (std::istream &is, Vector< D > &v)
 Read in a Vector from an input stream. More...
 
WONTON_INLINE double Wonton::cross (const Vector< 2 > &a, const Vector< 2 > &b)
 Cross product operator for two 2d vectors, \(\vec{a} \times \vec{b}\). More...
 
WONTON_INLINE Vector< 3 > Wonton::cross (const Vector< 3 > &a, const Vector< 3 > &b)
 Cross product operator for two 3d vectors, \(\vec{a} \times \vec{b}\). More...
 
template<int D>
WONTON_INLINE double Wonton::MaxComponent (const Vector< D > &v, int &icomp)
 Obtain the value and index of the maximum component of a Vector. More...