| IOLink 1.11.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
iolink::VectorX< T > Class Template Referencefinal

A dynamically sized arithmetic vector. More...

`#include <iolink/VectorX.h>`

## Public Types
using | ValueType = T
using | Iterator = ValueType *
using | ConstIterator = const ValueType *

## Public Member Functions
| VectorX ()
| Creates an empty vector.
| VectorX (size_t size)
| Creates an unitialized vector.
| VectorX (std::initializer_list< ValueType > init)
| Creates a vector from an initialization list.
template<typename U >
| VectorX (const VectorX< U > &other)
| Build a vector from a vector storing another type.
| VectorX (const VectorX &other)
VectorX & | operator= (const VectorX &other)
| VectorX (VectorX &&other) noexcept
VectorX & | operator= (VectorX &&other) noexcept
size_t | size () const
| Returns the size of the vector, which also correspond to vector number of dimension.
ValueType | at (size_t index) const
| Access vector's value at given index.
void | setAt (size_t index, ValueType value)
| Set value as given index.
ValueType & | operator[] (size_t index)
ValueType | operator[] (size_t index) const
Iterator | begin () noexcept
ConstIterator | begin () const noexcept
Iterator | end () noexcept
ConstIterator | end () const noexcept
ValueType * | data ()
| Direct access to the vector's data.
const ValueType * | data () const
| Direct const access to the vector's data.
bool | operator== (const VectorX &other) const
bool | operator!= (const VectorX &other) const
double | squaredLength () const
| Returns the vector's norm, squared.
double | length () const
| Returns the vector's norm.
void | normalize ()
| Normalize the vector.
std::string | toString () const
VectorX | operator- () const
VectorX & | operator+= (const VectorX &v)
VectorX & | operator-= (const VectorX &v)
VectorX | operator+ (const VectorX &v) const
VectorX | operator- (const VectorX &v) const
VectorX & | operator*= (ValueType value)
VectorX & | operator/= (ValueType value)
VectorX | operator* (ValueType s) const
VectorX | operator/ (ValueType s) const
ValueType | dot (const VectorX &v) const
| Dot product.
VectorX | cross (const VectorX &v) const
| Cross product of two vectors.
VectorX & | operator*= (const VectorX &v)
VectorX & | operator/= (const VectorX &v)
VectorX | operator* (const VectorX &v) const
VectorX | operator/ (const VectorX &v) const
bool | operator< (const VectorX &other) const
bool | operator<= (const VectorX &other) const
bool | operator> (const VectorX &other) const
bool | operator>= (const VectorX &other) const

## Static Public Member Functions
static VectorX | createUniform (size_t size, ValueType value)
| Creates a vector filled with one value.

## Friends
VectorX | operator* (ValueType s, VectorX v)

## Detailed Description

template<typename T>
class iolink::VectorX< T >

A dynamically sized arithmetic vector.

Examples
  CheckerBoard.cpp, CheckerBoardFast.cpp, DiskImageView.cpp, colorWheel.cpp, copyImageView.cpp, customImageView.cpp, gradientFloatImage.cpp, gradientFloatToInt.cpp, grayscaleSphere.cpp, metadataTree.cpp, serializationArray.cpp, and volumeFromStack.cpp.

## Constructor & Destructor Documentation

## ◆ VectorX() [1/2]

template<typename T >

iolink::VectorX< T >::VectorX | ( | size_t | size | ) |
| explicit

Creates an unitialized vector.

Parameters

  size | The size of the vector.

## ◆ VectorX() [2/2]

template<typename T >
template<typename U >

iolink::VectorX< T >::VectorX | ( | const VectorX< U > & | other | ) |
| inline explicit

Build a vector from a vector storing another type.

Template Parameters

  U | The type of the source vector.

Parameters

  other | The vector to convert.

## Member Function Documentation

## ◆ createUniform()

template<typename T >

static VectorX iolink::VectorX< T >::createUniform | ( | size_t | size,
|  | ValueType | value
| ) |  |
| static

Creates a vector filled with one value.

Parameters

  size | The size of the vector.
  value | The value used to fill the vector.

## ◆ cross()

template<typename T >

VectorX iolink::VectorX< T >::cross | ( | const VectorX< T > & | v | ) | const

Cross product of two vectors.

Work only for vectors of size 3.

## ◆ length()

template<typename T >

double iolink::VectorX< T >::length | ( |  | ) | const

Returns the vector's norm.

Specifically, it is the L1 norm that's computed here.

Examples
  grayscaleSphere.cpp.

## ◆ squaredLength()

template<typename T >

double iolink::VectorX< T >::squaredLength | ( |  | ) | const

Returns the vector's norm, squared.

Specifically, it is the L1 norm that's computed here.

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

- iolink/public/include/iolink/VectorX.h