HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType > Class Template Reference

Lightweight, variable-length vector. More...

#include <ConjGradient.h>

Classes

struct  DeterministicDotProductOp
 
struct  InfNormOp
 
struct  IsFiniteOp
 

Public Types

using ValueType = T
 
using Ptr = SharedPtr< Vector >
 

Public Member Functions

 Vector ()
 Construct an empty vector. More...
 
 Vector (SizeType n)
 Construct a vector of n elements, with uninitialized values. More...
 
 Vector (SizeType n, const ValueType &val)
 Construct a vector of n elements and initialize each element to the given value. More...
 
 ~Vector ()
 
 Vector (const Vector &)
 Deep copy the given vector. More...
 
Vectoroperator= (const Vector &)
 Deep copy the given vector. More...
 
SizeType size () const
 Return the number of elements in this vector. More...
 
bool empty () const
 Return true if this vector has no elements. More...
 
void resize (SizeType n)
 Reset this vector to have n elements, with uninitialized values. More...
 
void swap (Vector &other)
 Swap internal storage with another vector, which need not be the same size. More...
 
void fill (const ValueType &value)
 Set all elements of this vector to value. More...
 
ValueType dot (const Vector &) const
 Return the dot product of this vector with the given vector, which must be the same size. More...
 
ValueType infNorm () const
 Return the infinity norm of this vector. More...
 
ValueType l2Norm () const
 Return the L2 norm of this vector. More...
 
bool isFinite () const
 Return true if every element of this vector has a finite value. More...
 
template<typename OtherValueType >
bool eq (const Vector< OtherValueType > &other, ValueType eps=Tolerance< ValueType >::value()) const
 Return true if this vector is equivalent to the given vector to within the specified tolerance. More...
 
std::string str () const
 Return a string representation of this vector. More...
 
template<typename Scalar >
void scale (const Scalar &s)
 Multiply each element of this vector by s. More...
 
template<typename Scalar >
Vectoroperator*= (const Scalar &s)
 Multiply each element of this vector by s. More...
 
T & at (SizeType i)
 Return the value of this vector's ith element. More...
 
const T & at (SizeType i) const
 Return the value of this vector's ith element. More...
 
T & operator[] (SizeType i)
 Return the value of this vector's ith element. More...
 
const T & operator[] (SizeType i) const
 Return the value of this vector's ith element. More...
 
T * data ()
 Return a pointer to this vector's elements. More...
 
const T * data () const
 Return a pointer to this vector's elements. More...
 
const T * constData () const
 Return a pointer to this vector's elements. More...
 

Detailed Description

template<typename ValueType>
class openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >

Lightweight, variable-length vector.

Definition at line 37 of file ConjGradient.h.

Member Typedef Documentation

Definition at line 142 of file ConjGradient.h.

template<typename ValueType>
using openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::ValueType = T

Definition at line 141 of file ConjGradient.h.

Constructor & Destructor Documentation

template<typename ValueType>
openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::Vector ( )
inline

Construct an empty vector.

Definition at line 145 of file ConjGradient.h.

template<typename ValueType>
openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::Vector ( SizeType  n)
inline

Construct a vector of n elements, with uninitialized values.

Definition at line 147 of file ConjGradient.h.

template<typename ValueType>
openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::Vector ( SizeType  n,
const ValueType val 
)
inline

Construct a vector of n elements and initialize each element to the given value.

Definition at line 149 of file ConjGradient.h.

template<typename ValueType>
openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::~Vector ( )
inline

Definition at line 151 of file ConjGradient.h.

template<typename T >
openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::Vector ( const Vector< ValueType > &  other)
inline

Deep copy the given vector.

Definition at line 559 of file ConjGradient.h.

Member Function Documentation

template<typename ValueType>
T& openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::at ( SizeType  i)
inline

Return the value of this vector's ith element.

Definition at line 201 of file ConjGradient.h.

template<typename ValueType>
const T& openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::at ( SizeType  i) const
inline

Return the value of this vector's ith element.

Definition at line 202 of file ConjGradient.h.

template<typename ValueType>
const T* openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::constData ( ) const
inline

Return a pointer to this vector's elements.

Definition at line 211 of file ConjGradient.h.

template<typename ValueType>
T* openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::data ( )
inline

Return a pointer to this vector's elements.

Definition at line 209 of file ConjGradient.h.

template<typename ValueType>
const T* openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::data ( ) const
inline

Return a pointer to this vector's elements.

Definition at line 210 of file ConjGradient.h.

template<typename ValueType>
T openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::dot ( const Vector< ValueType > &  ) const
inline

Return the dot product of this vector with the given vector, which must be the same size.

Definition at line 664 of file ConjGradient.h.

template<typename ValueType>
bool openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::empty ( void  ) const
inline

Return true if this vector has no elements.

Definition at line 161 of file ConjGradient.h.

template<typename T >
template<typename OtherValueType >
bool openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::eq ( const Vector< OtherValueType > &  other,
ValueType  eps = Tolerance<ValueType>::value() 
) const
inline

Return true if this vector is equivalent to the given vector to within the specified tolerance.

Definition at line 788 of file ConjGradient.h.

template<typename T >
void openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::fill ( const ValueType value)
inline

Set all elements of this vector to value.

Definition at line 600 of file ConjGradient.h.

template<typename T >
T openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::infNorm ( ) const
inline

Return the infinity norm of this vector.

Definition at line 723 of file ConjGradient.h.

template<typename T >
bool openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::isFinite ( ) const
inline

Return true if every element of this vector has a finite value.

Definition at line 753 of file ConjGradient.h.

template<typename ValueType>
ValueType openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::l2Norm ( ) const
inline

Return the L2 norm of this vector.

Definition at line 185 of file ConjGradient.h.

template<typename ValueType>
template<typename Scalar >
Vector& openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::operator*= ( const Scalar &  s)
inline

Multiply each element of this vector by s.

Definition at line 176 of file ConjGradient.h.

template<typename ValueType>
Vector< T > & openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::operator= ( const Vector< ValueType > &  )
inline

Deep copy the given vector.

Definition at line 568 of file ConjGradient.h.

template<typename ValueType>
T& openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::operator[] ( SizeType  i)
inline

Return the value of this vector's ith element.

Definition at line 203 of file ConjGradient.h.

template<typename ValueType>
const T& openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::operator[] ( SizeType  i) const
inline

Return the value of this vector's ith element.

Definition at line 204 of file ConjGradient.h.

template<typename T >
void openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::resize ( SizeType  n)
inline

Reset this vector to have n elements, with uninitialized values.

Warning
All of this vector's existing values will be lost.

Definition at line 588 of file ConjGradient.h.

template<typename T >
template<typename Scalar >
void openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::scale ( const Scalar &  s)
inline

Multiply each element of this vector by s.

Definition at line 624 of file ConjGradient.h.

template<typename ValueType>
SizeType openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::size ( void  ) const
inline

Return the number of elements in this vector.

Definition at line 159 of file ConjGradient.h.

template<typename T >
std::string openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< T >::str ( ) const
inline

Return a string representation of this vector.

Definition at line 800 of file ConjGradient.h.

template<typename ValueType>
void openvdb::OPENVDB_VERSION_NAME::math::pcg::Vector< ValueType >::swap ( Vector< ValueType > &  other)
inline

Swap internal storage with another vector, which need not be the same size.

Definition at line 168 of file ConjGradient.h.


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