Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

plFloatVector Class Reference

A {plFloatVector} is a vector of {n} elements of type {plFloat}. More...

#include <plFloatVector.h>

Inheritance diagram for plFloatVector:

Inheritance graph
[legend]
Collaboration diagram for plFloatVector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

unsigned int size () const
 Returns vector's size.
 plFloatVector ()
 Default void constructor.
 plFloatVector (unsigned int r, float val)
 Constructs a vector having {r} elements initilized to 'val'.
 plFloatVector (unsigned int r, double val)
 Constructs a vector having {r} elements initilized to 'val'.
 plFloatVector (unsigned int r, long double val)
 Constructs a vector having {r} elements initilized to 'val'.
 plFloatVector (unsigned int r, bool init_to_zero=false)
 Constructs a vector having {r} elements.
 plFloatVector (unsigned int r, const float *float_vector)
 Constructs a vector having {r} elements and fills it using the {float_vector} C array of {float} values.
 plFloatVector (unsigned int r, const double *double_vector)
 Constructs a vector having {r} elements and fills it using the {double_vector} C array of {double} values.
 plFloatVector (unsigned int r, const long double *long_double_vector)
 Constructs a vector having {r} elements and fills it using the {long_double_vector} C array of {long double} values.
 plFloatVector (const vector< float > &float_vector)
 Constructs a vector and fills it using the {float_vector} STL vector of {float} values.
 plFloatVector (const vector< double > &double_vector)
 Constructs a vector and fills it using the {double_vector} STL vector of {double} values.
 plFloatVector (const vector< long double > &long_double_vector)
 Constructs a vector and fills it using the {long_double_vector} STL vector of {long double} values.
 plFloatVector (const plFloatVector &v2)
 Copy constructor.
virtual ~plFloatVector ()
 Destructor.
void resize (unsigned int r)
 Sets the size of the vector to {r}.
plFloatVectoroperator= (const plFloatVector &)
 Assignement operator.
plFloatVector operator+ (const plFloatVector &) const
 Addition operator.
plFloatVectoroperator+= (const plFloatVector &)
 Addition operator.
plFloatVector operator- (const plFloatVector &) const
 Subtraction operator.
plFloatVectoroperator-= (const plFloatVector &)
 Subtraction operator.
plFloatVector operator * (plFloat) const
 Multiplication with a scalar operator.
plFloat operator[] (unsigned int i) const
 Returns the ith element of the vector.
plFloat & operator[] (unsigned int i)
 Returns a reference to the ith element of the vector.
plFloat operator() (unsigned int i) const
 Returns the ith element if {i} is less than vector's size.
plFloat & operator() (unsigned int i)
 Returns a reference to the ith element if {i} is less than vector's size.
bool operator== (const plFloatVector &) const
 Equality test operator.
plFloat dot_product (const plFloatVector &a) const
 Computes the dot product of two vectors.
plFloatVector cross_product (const plFloatVector &a) const
 Computes the cross product of two vectors.
plFloat normalize (plFloatVector &result) const
 Normalizes the vector, stores the result in {result} vector and returns the norm of the vector.
plFloat product () const
 Returns the product of all elements.
void reset (float val)
 Resets the vector to val.
void reset (double val)
 Resets the vector to val.
void reset (long double val)
 Resets the vector to val.
void reset ()
 Resets the vector to 0.

Protected Member Functions

void Output (ostream &out) const
 Output operator.
plFloat elem_check (unsigned int i) const
 checked access
plFloat & elem_check (unsigned int i)
 checked access

Friends

class plFloatMatrix
plFloatVector operator * (plFloat, const plFloatVector &)
 Multiplication with a scalar operator.

Detailed Description

A {plFloatVector} is a vector of {n} elements of type {plFloat}.

Definition at line 38 of file plFloatVector.h.


Member Function Documentation

plFloatVector plFloatVector::cross_product const plFloatVector a  )  const
 

Computes the cross product of two vectors.

This method is only allowed for 3-dimensional vectors

plFloat& plFloatVector::operator() unsigned int  i  )  [inline]
 

Returns a reference to the ith element if {i} is less than vector's size.

Generates an error otherwise

Definition at line 141 of file plFloatVector.h.

References elem_check().

plFloat plFloatVector::operator() unsigned int  i  )  const [inline]
 

Returns the ith element if {i} is less than vector's size.

Generates an error otherwise

Definition at line 138 of file plFloatVector.h.

References elem_check().


The documentation for this class was generated from the following file:
Generated on Fri Apr 1 10:58:53 2005 for ProBT by  doxygen 1.4.1