FixedNdVector Class Template Reference

Inheritance diagram for FixedNdVector:

LocalArray FixedNdWeightedVector FixedNdWeightedVector< double, double, 2 > CVector PVector List of all members.

Detailed Description

template<class T, int Size>
class FixedNdVector< T, Size >

This class provides vectors with fixed-sized dimension (known at compile time).

All storage is local to the class.

Author:
Bill Smart
Version:
1.0
Date:
June 2005

Definition at line 405 of file Geometry.H.

Public Member Functions

 FixedNdVector ()
 FixedNdVector (const T &value)
 Allocate a vector and set all of its elements to the given value.
 FixedNdVector (const FixedNdPoint< T, Size > &p1, const FixedNdPoint< T, Size > &p2)
 Allocate a vector from point p1 to point p2.
 FixedNdVector (const FixedNdVector< T, Size > &vector)
 ~FixedNdVector ()
Dimension
int n () const
 
Returns:
The dimension of the vector. */

Operators
FixedNdVector< T, Size > operator * (const double scalar) const
 Multiply the length of the vector by a scalar.
FixedNdVector< T, Size > operator/ (const double scalar) const
 Divide the length of the vector by a scalar.
FixedNdVector< T, Size > & operator *= (const double scalar)
 Multiply the length of the vector by a scalar.
FixedNdVector< T, Size > & operator/= (const double scalar)
 Divide the length of the vector by a scalar.
FixedNdVector< T, Size > operator+ (const FixedNdVector< T, Size > &vector) const
 Add a vector to the current instance.
FixedNdVector< T, Size > operator- (const FixedNdVector< T, Size > &vector) const
 Subtract one vector from another.
FixedNdVector< T, Size > & operator+= (const FixedNdVector< T, Size > &vector)
 Add a vector to the current instance.
FixedNdVector< T, Size > & operator-= (const FixedNdVector< T, Size > &vector)
 Subtract a vector from the current instance.
FixedNdVector< T, Size > operator- () const
 Reverse the direction of a vector.
double operator * (const FixedNdVector< T, Size > &vector)
 Calculate the inner (dot) product of two vectors.
double length () const
 
Returns:
The length of the vector.

void normalize (const double new_length=1.0)
 Set the length of the vector to the specified value.


Constructor & Destructor Documentation

FixedNdVector (  )  [inline]

Definition at line 407 of file Geometry.H.

FixedNdVector ( const T &  value  )  [inline]

Allocate a vector and set all of its elements to the given value.

Parameters:
[in] value The value to set the elements to.

Definition at line 410 of file Geometry.H.

FixedNdVector ( const FixedNdPoint< T, Size > &  p1,
const FixedNdPoint< T, Size > &  p2 
) [inline]

Allocate a vector from point p1 to point p2.

Parameters:
[in] p1 The starting point.
[in] p2 The ending point.

Definition at line 414 of file Geometry.H.

FixedNdVector ( const FixedNdVector< T, Size > &  vector  )  [inline]

Definition at line 416 of file Geometry.H.

~FixedNdVector (  )  [inline]

Definition at line 417 of file Geometry.H.


Member Function Documentation

int n (  )  const [inline]

Returns:
The dimension of the vector. */

Definition at line 424 of file Geometry.H.

FixedNdVector<T, Size> operator * ( const double  scalar  )  const [inline]

Multiply the length of the vector by a scalar.

Parameters:
[in] scalar The number to multiply the vector by.
Returns:
A scaled vector.

Definition at line 433 of file Geometry.H.

FixedNdVector<T, Size> operator/ ( const double  scalar  )  const [inline]

Divide the length of the vector by a scalar.

Parameters:
[in] scalar The number to divide the vector by.
Returns:
A scaled vector.

Definition at line 439 of file Geometry.H.

FixedNdVector<T, Size>& operator *= ( const double  scalar  )  [inline]

Multiply the length of the vector by a scalar.

Parameters:
[in] scalar The number to multiply the vector by.
Returns:
The modified vector.

Definition at line 446 of file Geometry.H.

FixedNdVector<T, Size>& operator/= ( const double  scalar  )  [inline]

Divide the length of the vector by a scalar.

Parameters:
[in] scalar The number to divide the vector by.
Returns:
The modified vector.

Definition at line 452 of file Geometry.H.

Referenced by FixedNdVector< T, 4 >::normalize().

FixedNdVector<T, Size> operator+ ( const FixedNdVector< T, Size > &  vector  )  const [inline]

Add a vector to the current instance.

Parameters:
[in] vector The vector to add.
Returns:
The modified vector.

Definition at line 459 of file Geometry.H.

FixedNdVector<T, Size> operator- ( const FixedNdVector< T, Size > &  vector  )  const [inline]

Subtract one vector from another.

Parameters:
[in] vector The vector to subtract.
Returns:
The difference of the vectors.

Definition at line 465 of file Geometry.H.

FixedNdVector<T, Size>& operator+= ( const FixedNdVector< T, Size > &  vector  )  [inline]

Add a vector to the current instance.

Parameters:
[in] vector The vector to add.
Returns:
The modified vector.

Definition at line 472 of file Geometry.H.

FixedNdVector<T, Size>& operator-= ( const FixedNdVector< T, Size > &  vector  )  [inline]

Subtract a vector from the current instance.

Parameters:
[in] vector The vector to subtract.
Returns:
The modified vector.

Definition at line 479 of file Geometry.H.

FixedNdVector<T, Size> operator- (  )  const [inline]

Reverse the direction of a vector.

Returns:
A vector pointing in the opposite direction.

Definition at line 486 of file Geometry.H.

double operator * ( const FixedNdVector< T, Size > &  vector  )  [inline]

Calculate the inner (dot) product of two vectors.

Parameters:
[in] vector The second vector.
Returns:
The inner product.

Definition at line 494 of file Geometry.H.

double length (  )  const [inline]

Returns:
The length of the vector.

Definition at line 500 of file Geometry.H.

Referenced by FixedNdVector< T, 4 >::normalize().

void normalize ( const double  new_length = 1.0  )  [inline]

Set the length of the vector to the specified value.

Parameters:
[in] new_length The new length of the vector.

Definition at line 510 of file Geometry.H.


The documentation for this class was generated from the following file:
Generated on Thu Feb 1 15:31:55 2007 for WURDE by  doxygen 1.5.1