template<typename T>
Vector<T, 0> class
| Template parameters | |
|---|---|
| T | the number type |
Contents
Dynamic vector class
Public static functions
Constructors, destructors, conversion operators
Public functions
- auto Dim() const -> fsize noexcept
- auto operator()(const fsize l) -> T&
- auto operator()(const fsize l) const -> const T&
- auto operator=(const Vector& other) -> Vector&
- auto operator=(Vector&& other) -> Vector& noexcept
- auto operator+(const Vector& other) const -> Vector
- auto operator-(const Vector& other) const -> Vector
- auto operator*(const Vector& other) const -> Vector
- auto operator/(const Vector& other) const -> Vector
- auto operator*(T other) const -> Vector
- auto operator/(T other) const -> Vector
- void operator+=(const Vector& other)
- void operator-=(const Vector& other)
- void operator*=(const Vector& other)
- void operator/=(const Vector& other)
- void operator*=(T other)
- void operator/=(T other)
- auto operator-() const -> Vector
- auto operator==(const Vector& other) const -> bool
- auto operator!=(const Vector& other) const -> bool
- auto operator<(const Vector& other) const -> bool
- auto operator>(const Vector& other) const -> bool
- auto operator<=(const Vector& other) const -> bool
- auto operator>=(const Vector& other) const -> bool
- auto Dot(const Vector& other) const -> T
- auto Distance(const Vector& other) const -> T
- auto DistanceSquared(const Vector& other) const -> T
- auto Norm() const -> T
- auto NormSquared() const -> T
- auto Normalize() const -> Vector
- auto operator*() const -> const T* noexcept
- auto operator*() -> T* noexcept
Function documentation
template<typename T>
bpf:: math:: Vector<T, 0><T>:: Vector(const std::initializer_list<T>& lst)
| Parameters | |
|---|---|
| lst | the list to copy values from |
Constructs a vector from an initializer list
template<typename T>
T& bpf:: math:: Vector<T, 0><T>:: operator()(const fsize l)
| Parameters | |
|---|---|
| l | the row number |
| Returns | mutable cell value |
| Exceptions | |
| IndexException | if out of bounds |
Obtains the value of a cell for modification
template<typename T>
const T& bpf:: math:: Vector<T, 0><T>:: operator()(const fsize l) const
| Parameters | |
|---|---|
| l | the row number |
| Returns | immutable cell value |
| Exceptions | |
| IndexException | if out of bounds |
Obtains the value of a cell for reading
template<typename T>
Vector bpf:: math:: Vector<T, 0><T>:: operator+(const Vector& other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | new vector |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Performs element-wise addition
template<typename T>
Vector bpf:: math:: Vector<T, 0><T>:: operator-(const Vector& other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | new vector |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Performs element-wise subtraction
template<typename T>
Vector bpf:: math:: Vector<T, 0><T>:: operator*(const Vector& other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | new vector |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Performs element-wise multiplication
template<typename T>
Vector bpf:: math:: Vector<T, 0><T>:: operator/(const Vector& other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | new vector |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Performs element-wise division
template<typename T>
void bpf:: math:: Vector<T, 0><T>:: operator+=(const Vector& other)
| Parameters | |
|---|---|
| other | operand |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Performs element-wise addition
template<typename T>
void bpf:: math:: Vector<T, 0><T>:: operator-=(const Vector& other)
| Parameters | |
|---|---|
| other | operand |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Performs element-wise subtraction
template<typename T>
void bpf:: math:: Vector<T, 0><T>:: operator*=(const Vector& other)
| Parameters | |
|---|---|
| other | operand |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Performs element-wise multiplication
template<typename T>
void bpf:: math:: Vector<T, 0><T>:: operator/=(const Vector& other)
| Parameters | |
|---|---|
| other | operand |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Performs element-wise division
template<typename T>
void bpf:: math:: Vector<T, 0><T>:: operator*=(T other)
| Parameters | |
|---|---|
| other | operand |
Performs vector-scalar multiplication
template<typename T>
void bpf:: math:: Vector<T, 0><T>:: operator/=(T other)
| Parameters | |
|---|---|
| other | operand |
Performs vector-scalar division
template<typename T>
bool bpf:: math:: Vector<T, 0><T>:: operator==(const Vector& other) const
| Parameters | |
|---|---|
| other | vector to compare with |
| Returns | true if the two vectors are equal, false otherwise |
Compare two vectors
template<typename T>
bool bpf:: math:: Vector<T, 0><T>:: operator!=(const Vector& other) const
| Parameters | |
|---|---|
| other | vector to compare with |
| Returns | false if the two vectors are equal, true otherwise |
Compare two vectors
template<typename T>
bool bpf:: math:: Vector<T, 0><T>:: operator<(const Vector& other) const
| Parameters | |
|---|---|
| other | vector to compare with |
| Returns | true if this is less than other, false otherwise |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Compare two vectors
template<typename T>
bool bpf:: math:: Vector<T, 0><T>:: operator>(const Vector& other) const
| Parameters | |
|---|---|
| other | vector to compare with |
| Returns | true if this is greater than other, false otherwise |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Compare two vectors
template<typename T>
bool bpf:: math:: Vector<T, 0><T>:: operator<=(const Vector& other) const
| Parameters | |
|---|---|
| other | vector to compare with |
| Returns | true if this is less than or equal to, false otherwise |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Compare two vectors
template<typename T>
bool bpf:: math:: Vector<T, 0><T>:: operator>=(const Vector& other) const
| Parameters | |
|---|---|
| other | vector to compare with |
| Returns | true if this is greater than or equal to other, false otherwise |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Compare two vectors
template<typename T>
T bpf:: math:: Vector<T, 0><T>:: Dot(const Vector& other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | number |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Computes the dot product
template<typename T>
T bpf:: math:: Vector<T, 0><T>:: Distance(const Vector& other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | number |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Computes the distance between two vectors
template<typename T>
T bpf:: math:: Vector<T, 0><T>:: DistanceSquared(const Vector& other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | number |
| Exceptions | |
| IncompatibleMatrixSizeException | if the two vector dimensions do not match |
Computes the squared distance between two vectors
template<typename T>
T bpf:: math:: Vector<T, 0><T>:: Norm() const
| Returns | number |
|---|
Computes the norm of this vector
template<typename T>
T bpf:: math:: Vector<T, 0><T>:: NormSquared() const
| Returns | number |
|---|
Computes the squared norm of this vector
template<typename T>
const T* bpf:: math:: Vector<T, 0><T>:: operator*() const noexcept
| Returns | immutable low-level C array |
|---|
Returns a low-level C array, used to transfer to lower-level APIs
template<typename T>
T* bpf:: math:: Vector<T, 0><T>:: operator*() noexcept
| Returns | mutable low-level C array |
|---|
Returns a low-level C array, used to transfer to lower-level APIs