OpenVDB 5.1.0

Classes | Public Types | Public Member Functions | List of all members
Vector< T > 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...
Vector & | operator= (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 >
Vector & | operator*= (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 T>
class openvdb::v5_1::math::pcg::Vector< T >

Lightweight, variable-length vector.

## Member Typedef Documentation

## ◆ Ptr

using Ptr = SharedPtr<Vector>

## ◆ ValueType

using ValueType = T

## Constructor & Destructor Documentation

## ◆ Vector() [1/4]

Vector | ( |  | ) |
| inline

Construct an empty vector.

## ◆ Vector() [2/4]

Vector | ( | SizeType | n | ) |
| inline

Construct a vector of n elements, with uninitialized values.

## ◆ Vector() [3/4]

Vector | ( | SizeType | n,
|  | const ValueType & | val
| ) |  |
| inline

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

## ◆ ~Vector()

~Vector | ( |  | ) |
| inline

## ◆ Vector() [4/4]

Vector | ( | const Vector< T > & | other | ) |
| inline

Deep copy the given vector.

## Member Function Documentation

## ◆ at() [1/2]

T& at | ( | SizeType | i | ) |
| inline

Return the value of this vector's ith element.

## ◆ at() [2/2]

const T& at | ( | SizeType | i | ) | const
| inline

Return the value of this vector's ith element.

## ◆ constData()

const T* constData | ( |  | ) | const
| inline

Return a pointer to this vector's elements.

## ◆ data() [1/2]

T* data | ( |  | ) |
| inline

Return a pointer to this vector's elements.

## ◆ data() [2/2]

const T* data | ( |  | ) | const
| inline

Return a pointer to this vector's elements.

## ◆ dot()

T dot | ( | const Vector< T > & |  | ) | const
| inline

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

## ◆ empty()

bool empty | ( |  | ) | const
| inline

Return `true` if this vector has no elements.

## ◆ eq()

bool 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.

## ◆ fill()

void fill | ( | const ValueType & | value | ) |
| inline

Set all elements of this vector to value.

## ◆ infNorm()

T infNorm | ( |  | ) | const
| inline

Return the infinity norm of this vector.

## ◆ isFinite()

bool isFinite | ( |  | ) | const
| inline

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

## ◆ l2Norm()

ValueType l2Norm | ( |  | ) | const
| inline

Return the L2 norm of this vector.

## ◆ operator*=()

Vector& operator*= | ( | const Scalar & | s | ) |
| inline

Multiply each element of this vector by s.

## ◆ operator=()

Vector< T > & operator= | ( | const Vector< T > & |  | ) |
| inline

Deep copy the given vector.

## ◆ operator[]() [1/2]

T& operator[] | ( | SizeType | i | ) |
| inline

Return the value of this vector's ith element.

## ◆ operator[]() [2/2]

const T& operator[] | ( | SizeType | i | ) | const
| inline

Return the value of this vector's ith element.

## ◆ resize()

void 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.

## ◆ scale()

void scale | ( | const Scalar & | s | ) |
| inline

Multiply each element of this vector by s.

## ◆ size()

SizeType size | ( |  | ) | const
| inline

Return the number of elements in this vector.

## ◆ str()

std::string str | ( |  | ) | const
| inline

Return a string representation of this vector.

## ◆ swap()

void swap | ( | Vector< T > & | other | ) |
| inline

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

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

- ConjGradient.h