Parameterizable one-dimensional vector data structure. More...
#include <mitsuba/mitsuba.h>
Public Types | |
typedef T | Scalar |
typedef TPoint1< T > | PointType |
Public Member Functions | |
TVector1 () | |
Construct a new vector without initializing it. More... | |
TVector1 (T x) | |
Initialize the vector with the specified value. More... | |
template<typename T1 > | |
TVector1 (const TVector1< T1 > &v) | |
Initialize the vector with the components of another vector data structure. More... | |
template<typename T1 > | |
TVector1 (const TPoint1< T1 > &p) | |
Initialize the vector with the components of a point data structure. More... | |
TVector1 (Stream *stream) | |
Unserialize a vector from a binary data stream. More... | |
TVector1 | operator+ (const TVector1 &v) const |
Add two vectors and return the result. More... | |
TVector1 | operator- (const TVector1 &v) const |
Subtract two vectors and return the result. More... | |
TVector1 & | operator+= (const TVector1 &v) |
Add another vector to the current one. More... | |
TVector1 & | operator-= (const TVector1 &v) |
Subtract another vector from the current one. More... | |
TVector1 | operator* (T f) const |
Multiply the vector by the given scalar and return the result. More... | |
TVector1 & | operator*= (T f) |
Multiply the vector by the given scalar. More... | |
TVector1 | operator- () const |
Return a negated version of the vector. More... | |
TVector1 | operator/ (T f) const |
Divide the vector by the given scalar and return the result. More... | |
TVector1 & | operator/= (T f) |
Divide the vector by the given scalar. More... | |
T & | operator[] (int i) |
Index into the vector's components. More... | |
T | operator[] (int i) const |
Index into the vector's components (const version) More... | |
T | lengthSquared () const |
Return the squared 1-norm of this vector. More... | |
T | length () const |
Return the 1-norm of this vector. More... | |
bool | isZero () const |
Return whether or not this vector is identically zero. More... | |
bool | operator== (const TVector1 &v) const |
Equality test. More... | |
bool | operator!= (const TVector1 &v) const |
Inequality test. More... | |
void | serialize (Stream *stream) const |
Serialize this vector to a binary data stream. More... | |
operator Scalar () const | |
Implicit conversion to Scalar. More... | |
std::string | toString () const |
Return a readable string representation of this vector. More... | |
Public Attributes | |
T | x |
Static Public Attributes | |
static const int | dim = 1 |
Number of dimensions. More... | |
Parameterizable one-dimensional vector data structure.
typedef TPoint1<T> mitsuba::TVector1< T >::PointType |
typedef T mitsuba::TVector1< T >::Scalar |
|
inline |
Construct a new vector without initializing it.
This construtor is useful when the vector will either not be used at all (it might be part of a larger data structure) or initialized at a later point in time. Always make sure that one of the two is the case! Otherwise your program will do computations involving uninitialized memory, which will probably lead to a difficult-to-find bug.
|
inline |
Initialize the vector with the specified value.
|
inlineexplicit |
Initialize the vector with the components of another vector data structure.
|
inlineexplicit |
Initialize the vector with the components of a point data structure.
|
inlineexplicit |
Unserialize a vector from a binary data stream.
|
inline |
Return whether or not this vector is identically zero.
|
inline |
Return the 1-norm of this vector.
|
inline |
Return the squared 1-norm of this vector.
|
inline |
Implicit conversion to Scalar.
|
inline |
Inequality test.
|
inline |
Multiply the vector by the given scalar and return the result.
|
inline |
Multiply the vector by the given scalar.
|
inline |
Add two vectors and return the result.
|
inline |
Add another vector to the current one.
|
inline |
Subtract two vectors and return the result.
|
inline |
Return a negated version of the vector.
|
inline |
Subtract another vector from the current one.
|
inline |
Divide the vector by the given scalar and return the result.
|
inline |
Divide the vector by the given scalar.
|
inline |
Equality test.
|
inline |
Index into the vector's components.
|
inline |
Index into the vector's components (const version)
|
inline |
Serialize this vector to a binary data stream.
|
inline |
Return a readable string representation of this vector.
|
static |
Number of dimensions.
T mitsuba::TVector1< T >::x |