SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
apf::DynamicVector Class Reference

A runtime-sized linear algebra vector of doubles. More...

Inherits DynamicArray< double >.

Public Member Functions

 DynamicVector ()
 default constructor - no allocation
 
 DynamicVector (std::size_t n)
 construct with (n) allocated elements
 
double operator() (std::size_t i) const
 immutable index operator More...
 
double & operator() (std::size_t i)
 mutable index operator
 
DynamicVectoroperator+= (DynamicVector const &b)
 Add a vector to this vector.
 
DynamicVectoroperator-= (DynamicVector const &b)
 Subtract a vector from this vector.
 
DynamicVectoroperator*= (double s)
 Multiply this vector by a scalar.
 
DynamicVectoroperator/= (double s)
 Divide this vector by a scalar.
 
double operator* (DynamicVector const &b) const
 Get the vector dot product.
 
double getLength ()
 Get the vector magnitude.
 
void zero ()
 Initialize all elements to zero.
 

Detailed Description

A runtime-sized linear algebra vector of doubles.

This class is the runtime-sized equivalent of apf::Vector. It keeps all values in a single dynamically allocated array. Due to the use of dynamic allocation, users should avoid copying this class as much as possible. To help with this, we provide things like operator+= instead of operator+ to discourage users from creating temporary copies. The code for these methods is still inlined in an effort to keep your linear algebra running as fast as possible.

Definition at line 33 of file apfDynamicVector.h.

Member Function Documentation

double apf::DynamicVector::operator() ( std::size_t  i) const
inline

immutable index operator

note that we do inherit the square-bracket index operator from DynamicArray, but we use parentheses here to be consistent with apf::DynamicMatrix

Definition at line 44 of file apfDynamicVector.h.

45  {
46  return (*this)[i];
47  }

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