Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::TVector1< T > Struct Template Reference

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...
 
TVector1operator+= (const TVector1 &v)
 Add another vector to the current one. More...
 
TVector1operator-= (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...
 
TVector1operator*= (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...
 
TVector1operator/= (T f)
 Divide the vector by the given scalar. More...
 
T & operator[] (int i)
 Index into the vector's components. More...
 
operator[] (int i) const
 Index into the vector's components (const version) More...
 
lengthSquared () const
 Return the squared 1-norm of this vector. More...
 
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

x
 

Static Public Attributes

static const int dim = 1
 Number of dimensions. More...
 

Detailed Description

template<typename T>
struct mitsuba::TVector1< T >

Parameterizable one-dimensional vector data structure.

Member Typedef Documentation

template<typename T>
typedef TPoint1<T> mitsuba::TVector1< T >::PointType
template<typename T>
typedef T mitsuba::TVector1< T >::Scalar

Constructor & Destructor Documentation

template<typename T>
mitsuba::TVector1< T >::TVector1 ( )
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.

template<typename T>
mitsuba::TVector1< T >::TVector1 ( x)
inline

Initialize the vector with the specified value.

template<typename T>
template<typename T1 >
mitsuba::TVector1< T >::TVector1 ( const TVector1< T1 > &  v)
inlineexplicit

Initialize the vector with the components of another vector data structure.

template<typename T>
template<typename T1 >
mitsuba::TVector1< T >::TVector1 ( const TPoint1< T1 > &  p)
inlineexplicit

Initialize the vector with the components of a point data structure.

template<typename T>
mitsuba::TVector1< T >::TVector1 ( Stream stream)
inlineexplicit

Unserialize a vector from a binary data stream.

Member Function Documentation

template<typename T>
bool mitsuba::TVector1< T >::isZero ( ) const
inline

Return whether or not this vector is identically zero.

template<typename T>
T mitsuba::TVector1< T >::length ( ) const
inline

Return the 1-norm of this vector.

template<typename T>
T mitsuba::TVector1< T >::lengthSquared ( ) const
inline

Return the squared 1-norm of this vector.

template<typename T>
mitsuba::TVector1< T >::operator Scalar ( ) const
inline

Implicit conversion to Scalar.

template<typename T>
bool mitsuba::TVector1< T >::operator!= ( const TVector1< T > &  v) const
inline

Inequality test.

template<typename T>
TVector1 mitsuba::TVector1< T >::operator* ( f) const
inline

Multiply the vector by the given scalar and return the result.

template<typename T>
TVector1& mitsuba::TVector1< T >::operator*= ( f)
inline

Multiply the vector by the given scalar.

template<typename T>
TVector1 mitsuba::TVector1< T >::operator+ ( const TVector1< T > &  v) const
inline

Add two vectors and return the result.

template<typename T>
TVector1& mitsuba::TVector1< T >::operator+= ( const TVector1< T > &  v)
inline

Add another vector to the current one.

template<typename T>
TVector1 mitsuba::TVector1< T >::operator- ( const TVector1< T > &  v) const
inline

Subtract two vectors and return the result.

template<typename T>
TVector1 mitsuba::TVector1< T >::operator- ( ) const
inline

Return a negated version of the vector.

template<typename T>
TVector1& mitsuba::TVector1< T >::operator-= ( const TVector1< T > &  v)
inline

Subtract another vector from the current one.

template<typename T>
TVector1 mitsuba::TVector1< T >::operator/ ( f) const
inline

Divide the vector by the given scalar and return the result.

template<typename T>
TVector1& mitsuba::TVector1< T >::operator/= ( f)
inline

Divide the vector by the given scalar.

template<typename T>
bool mitsuba::TVector1< T >::operator== ( const TVector1< T > &  v) const
inline

Equality test.

template<typename T>
T& mitsuba::TVector1< T >::operator[] ( int  i)
inline

Index into the vector's components.

template<typename T>
T mitsuba::TVector1< T >::operator[] ( int  i) const
inline

Index into the vector's components (const version)

template<typename T>
void mitsuba::TVector1< T >::serialize ( Stream stream) const
inline

Serialize this vector to a binary data stream.

template<typename T>
std::string mitsuba::TVector1< T >::toString ( ) const
inline

Return a readable string representation of this vector.

Member Data Documentation

template<typename T>
const int mitsuba::TVector1< T >::dim = 1
static

Number of dimensions.

template<typename T>
T mitsuba::TVector1< T >::x

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