Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Types | Related Functions | List of all members
vnl_quaternion< T > Class Template Reference

4-element vector that represents rotation in 3D. More...

#include <vnl_fwd.h>

Inheritance diagram for vnl_quaternion< T >:
Inheritance graph
[legend]

Public Types

enum  
 
typedef vnl_vector_fixed< T, n > self
 
typedef size_t size_type
 
typedef T element_type
 Type defs for iterators. More...
 
typedef T * iterator
 Type defs for iterators. More...
 
typedef T const * const_iterator
 Const iterator type. More...
 
typedef vnl_c_vector< T >::abs_t abs_t
 

Public Member Functions

 vnl_quaternion ()=default
 Constructor for null quaternion. More...
 
 vnl_quaternion (T x, T y, T z, T r)
 Construct quaternion from components x,y,z,r. More...
 
 vnl_quaternion (T theta_X, T theta_Y, T theta_Z)
 Construct quaternion from Euler Angles,. More...
 
 vnl_quaternion (vnl_vector_fixed< T, 3 > const &axis, double angle)
 Construct quaternion from axis and angle of rotation. More...
 
 vnl_quaternion (vnl_matrix_fixed< T, 3, 3 > const &transform)
 Construct quaternion from 3x3 row-major matrix. More...
 
 vnl_quaternion (vnl_vector_fixed< T, 3 > const &vec)
 Construct quaternion from a 3D vector. More...
 
 vnl_quaternion (vnl_vector_fixed< T, 4 > const &vec)
 Construct quaternion from a 4D vector. More...
 
 vnl_quaternion (vnl_quaternion< T > const &from)
 Copy constructor – Creates a copy of from quaternion. More...
 
 ~vnl_quaternion ()=default
 Free internal array. More...
 
vnl_quaternionoperator= (vnl_quaternion< T > const &rhs)
 Overloads assignment operator to copy rhs quaternion into lhs quaternion. More...
 
T & x ()
 Imaginary component, parallel to axis of rotation. More...
 
T & y ()
 Imaginary component, parallel to axis of rotation. More...
 
T & z ()
 Imaginary component, parallel to axis of rotation. More...
 
T & r ()
 Real component. More...
 
x () const
 Imaginary component, parallel to axis of rotation. More...
 
y () const
 Imaginary component, parallel to axis of rotation. More...
 
z () const
 Imaginary component, parallel to axis of rotation. More...
 
r () const
 Real component. More...
 
real () const
 Copies and returns the real part. More...
 
vnl_vector_fixed< T, 3 > imaginary () const
 Copies and returns the imaginary part. More...
 
vnl_vector_fixed< T, 3 > axis () const
 Axis of rotation. More...
 
double angle () const
 Angle of rotation. More...
 
vnl_matrix_fixed< T, 3, 3 > rotation_matrix_transpose () const
 3x3 rotation matrix. More...
 
vnl_matrix_fixed< T, 4, 4 > rotation_matrix_transpose_4 () const
 4x4 rotation matrix. More...
 
vnl_quaternion< T > conjugate () const
 Same real, opposite img part. More...
 
vnl_quaternion< T > inverse () const
 Inverse for nonzero quat. More...
 
vnl_quaternion< T > operator * (vnl_quaternion< T > const &) const
 Returns the product of two quaternions. More...
 
vnl_vector_fixed< T, 3 > rotate (vnl_vector_fixed< T, 3 > const &) const
 Rotate 3D v. More...
 
vnl_vector_fixed< T, 3 > rotation_euler_angles () const
 Rotation representation in Euler angles. More...
 
unsigned int size () const
 Length of the vector. More...
 
void put (unsigned int i, T const &v)
 Put value at given position in vector. More...
 
get (unsigned int i) const
 Get value at element i. More...
 
vnl_vector_fixedfill (T const &v)
 Set all values to v. More...
 
vnl_vector_fixedcopy_in (T const *ptr)
 Sets elements to ptr[i]. More...
 
void copy_out (T *ptr) const
 Copy elements to ptr[i]. More...
 
vnl_vector_fixedset (T const *ptr)
 Sets elements to ptr[i]. More...
 
T & operator() (unsigned int i)
 Return reference to the element at specified index. More...
 
T const & operator() (unsigned int i) const
 Return reference to the element at specified index. More...
 
T & operator[] (const size_t i)
 Return the i-th element. More...
 
const T & operator[] (const size_t i) const
 Return the i-th element. More...
 
T const * data_block () const
 Access the contiguous block storing the elements in the vector. More...
 
T * data_block ()
 Access the contiguous block storing the elements in the vector. More...
 
vnl_vector_ref< T > as_ref ()
 Explicit conversion to a vnl_vector_ref. More...
 
const vnl_vector_ref< T > as_ref () const
 Explicit conversion to a vnl_vector_ref. More...
 
 operator const vnl_vector_ref< T > () const
 Cheap conversion to vnl_vector_ref. More...
 
iterator begin ()
 Iterator pointing to start of data. More...
 
const_iterator begin () const
 Iterator pointing to start of data. More...
 
iterator end ()
 Iterator pointing to element beyond end of data. More...
 
const_iterator end () const
 Iterator pointing to element beyond end of data. More...
 
vnl_vector_fixed< T, n > apply (T(*f)(T))
 Apply f to each element. More...
 
vnl_vector_fixed< T, n > apply (T(*f)(const T &))
 Apply f to each element. More...
 
vnl_vector_fixed< T, n > & operator+= (T s)
 
vnl_vector_fixed< T, n > & operator+= (const vnl_vector_fixed< T, n > &v)
 
vnl_vector_fixed< T, n > & operator+= (const vnl_vector< T > &v)
 
vnl_vector_fixed< T, n > & operator-= (T s)
 
vnl_vector_fixed< T, n > & operator-= (const vnl_vector_fixed< T, n > &v)
 
vnl_vector_fixed< T, n > & operator-= (const vnl_vector< T > &v)
 
vnl_vector_fixed< T, n > & operator *= (T s)
 
vnl_vector_fixed< T, n > & operator/= (T s)
 
vnl_vector_fixed< T, n > operator- () const
 
vnl_vector< T > extract (unsigned int len, unsigned int start=0) const
 Returns a subvector specified by the start index and length. O(n). More...
 
vnl_vector< T > as_vector () const
 Convert to a vnl_vector. More...
 
vnl_vector_fixedupdate (vnl_vector< T > const &, unsigned int start=0)
 Replaces elements with index beginning at start, by values of v. O(n). More...
 
abs_t squared_magnitude () const
 Return sum of squares of elements. More...
 
abs_t magnitude () const
 Return magnitude (length) of vector. More...
 
abs_t one_norm () const
 Return sum of absolute values of the elements. More...
 
abs_t two_norm () const
 Return sqrt of sum of squares of values of elements. More...
 
abs_t inf_norm () const
 Return largest absolute element value. More...
 
vnl_vector_fixed< T, n > & normalize ()
 Normalise by dividing through by the magnitude. More...
 
abs_t rms () const
 Root Mean Squares of values. More...
 
min_value () const
 Smallest value. More...
 
max_value () const
 Largest value. More...
 
unsigned arg_min () const
 Location of smallest value. More...
 
unsigned arg_max () const
 Location of largest value. More...
 
mean () const
 Mean of values in vector. More...
 
sum () const
 Sum of values in a vector. More...
 
vnl_vector_fixedflip ()
 Reverse the order of the elements. More...
 
void assert_size (unsigned sz) const
 Check that size()==sz if not, abort();. More...
 
void assert_finite () const
 Check that this is finite if not, abort();. More...
 
bool is_finite () const
 Return true if it's finite. More...
 
bool is_zero () const
 Return true iff all the entries are zero. More...
 
bool empty () const
 Return true iff the size is zero. More...
 
bool operator_eq (vnl_vector_fixed< T, n > const &v) const
 Return true if *this == v. More...
 
bool operator_eq (vnl_vector< T > const &v) const
 Return true if *this == v. More...
 
bool read_ascii (std::istream &s)
 Read from text stream. More...
 
void print (std::ostream &s) const
 Display the vector. More...
 

Static Public Member Functions

static void add (const T *a, const T *b, T *r)
 
static void add (const T *a, T b, T *r)
 
static void sub (const T *a, const T *b, T *r)
 
static void sub (const T *a, T b, T *r)
 
static void sub (T a, const T *b, T *r)
 
static void mul (const T *a, const T *b, T *r)
 
static void mul (const T *a, T b, T *r)
 
static void div (const T *a, const T *b, T *r)
 
static void div (const T *a, T b, T *r)
 

Protected Attributes

data_ [n]
 

Private Types

typedef vnl_vector_fixed< T, 4 > Base
 

Related Functions

(Note that these are not member functions.)

template<class T >
std::istream & operator>> (std::istream &is, vnl_quaternion< T > &q)
 operator<<. More...
 
template<class T >
std::ostream & operator<< (std::ostream &os, vnl_quaternion< T > const &q)
 operator<<. More...
 
template<class T >
void x_write (std::ostream &os, vnl_quaternion< T > const &v, std::string name="vnl_quaternion")
 XML save vnl_quaternion to stream. More...
 
template<class T >
void x_write_tree (std::ostream &os, vnl_quaternion< T > const &v, std::string name="vnl_quaternion")
 XML save vnl_quaternion as a 2-level tree to stream. More...
 
vnl_vector_fixed< T, n > operator- (const vnl_vector_fixed< T, n > &v, T s)
 
vnl_vector_fixed< T, n > operator- (const T &s, const vnl_vector_fixed< T, n > &v)
 
vnl_vector_fixed< T, n > operator- (const vnl_vector_fixed< T, n > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_vector< T > operator- (const vnl_vector_fixed< T, n > &a, const vnl_vector< T > &b)
 
vnl_vector< T > operator- (const vnl_vector< T > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_vector_fixed< T, n > operator- (const vnl_vector_fixed_ref_const< T, n > &v, T s)
 
vnl_vector_fixed< T, n > operator- (T s, const vnl_vector_fixed_ref_const< T, n > &v)
 
vnl_vector_fixed< T, n > operator- (const vnl_vector_fixed_ref_const< T, n > &a, const vnl_vector_fixed_ref_const< T, n > &b)
 
void vsl_b_write (vsl_b_ostream &os, const vnl_vector_fixed< T, n > &v)
 Binary save vnl_vector_fixed to stream. More...
 
void vsl_b_read (vsl_b_istream &is, vnl_vector_fixed< T, n > &v)
 Binary load vnl_vector_fixed from stream. More...
 
void vsl_print_summary (std::ostream &os, const vnl_vector_fixed< T, n > &b)
 Print human readable summary of object to a stream. More...
 
vnl_vector_fixed< std::complex< T >, n > vnl_complexify (vnl_vector_fixed< T, n > const &R)
 Return complexified version of real fixed vector R. More...
 
vnl_vector_fixed< std::complex< T >, n > vnl_complexify (vnl_vector_fixed< T, n > const &R, vnl_vector_fixed< T, n > const &I)
 Return complex fixed vector R+j*I from two real fixed vectors R and I. More...
 
vnl_cross_2d (const vnl_vector_fixed< T, 2 > &v1, const vnl_vector_fixed< T, 2 > &v2)
 Compute the 2-D cross product. More...
 
vnl_cross_2d (vnl_vector_fixed< T, 2 > const &v1, vnl_vector< T > const &v2)
 Compute the 2-D cross product. More...
 
vnl_cross_2d (vnl_vector< T > const &v1, vnl_vector_fixed< T, 2 > const &v2)
 Compute the 2-D cross product. More...
 
double vnl_cross_2d (vnl_double_2 const &v1, vnl_double_2 const &v2)
 Cross product of two 2-vectors. More...
 
float vnl_cross_2d (vnl_float_2 const &v1, vnl_float_2 const &v2)
 Cross product of two 2-vectors. More...
 
vnl_vector_fixed< T, 3 > vnl_cross_3d (const vnl_vector_fixed< T, 3 > &v1, const vnl_vector_fixed< T, 3 > &v2)
 Compute the 3-D cross product. More...
 
vnl_vector_fixed< T, n > vnl_cross_3d (const vnl_vector_fixed< T, n > &a, const vnl_vector< T > &b)
 Compute the 3-D cross product. More...
 
vnl_vector_fixed< T, n > vnl_cross_3d (const vnl_vector< T > &a, const vnl_vector_fixed< T, n > &b)
 Compute the 3-D cross product. More...
 
vnl_double_3 vnl_cross_3d (vnl_double_3 const &v1, vnl_double_3 const &v2)
 Cross product of two 3-vectors. More...
 
vnl_float_3 vnl_cross_3d (vnl_float_3 const &v1, vnl_float_3 const &v2)
 Cross product of two 3-vectors. More...
 
vnl_vector_fixed< T, N > operator * (vnl_diag_matrix_fixed< T, N > const &D, vnl_vector_fixed< T, N > const &A)
 Multiply a vnl_diag_matrix_fixed by a vnl_vector_fixed. n flops. More...
 
vnl_vector_fixed< T, N > operator * (vnl_vector_fixed< T, N > const &A, vnl_diag_matrix_fixed< T, N > const &D)
 Multiply a vnl_vector_fixed by a vnl_diag_matrix_fixed. n flops. More...
 
vnl_vector_fixed< T, n > operator * (const vnl_vector_fixed< T, n > &v, T s)
 
vnl_vector_fixed< T, n > operator * (const T &s, const vnl_vector_fixed< T, n > &v)
 
vnl_vector_fixed< T, n > operator * (const vnl_vector_fixed_ref_const< T, n > &v, T s)
 
vnl_vector_fixed< T, n > operator * (T s, const vnl_vector_fixed_ref_const< T, n > &v)
 
vnl_vector_fixed< T, N > vnl_imag (vnl_vector_fixed< std::complex< T >, N > const &C)
 Vector of imaginary parts of vnl_vector_fixed<std::complex<T>, N >. More...
 
vnl_double_3 operator+ (const vnl_double_3 &a, const vnl_double_3 &b)
 The binary addition operator. More...
 
vnl_vector_fixed< T, n > operator+ (const vnl_vector_fixed< T, n > &v, T s)
 
vnl_vector_fixed< T, n > operator+ (const T &s, const vnl_vector_fixed< T, n > &v)
 
vnl_vector_fixed< T, n > operator+ (const vnl_vector_fixed< T, n > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_vector< T > operator+ (const vnl_vector_fixed< T, n > &a, const vnl_vector< T > &b)
 
vnl_vector< T > operator+ (const vnl_vector< T > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_vector_fixed< T, n > operator+ (const vnl_vector_fixed_ref_const< T, n > &v, T s)
 
vnl_vector_fixed< T, n > operator+ (T s, const vnl_vector_fixed_ref_const< T, n > &v)
 
vnl_vector_fixed< T, n > operator+ (const vnl_vector_fixed_ref_const< T, n > &a, const vnl_vector_fixed_ref_const< T, n > &b)
 
VNL_EXPORT std::ostream & vnl_matlab_print (std::ostream &, vnl_vector_fixed< T, n > const &, char const *variable_name=nullptr, vnl_matlab_print_format=vnl_matlab_print_format_default)
 print a vnl_vector_fixed<T>. More...
 
VNL_EXPORT vnl_matrix_fixed< T, m, n > outer_product (vnl_vector_fixed< T, m > const &a, vnl_vector_fixed< T, n > const &b)
 
vnl_matrix< T > outer_product (const vnl_vector< T > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_matrix< T > outer_product (const vnl_vector_fixed< T, n > &a, const vnl_vector< T > &b)
 
VNL_EXPORT bool operator< (vnl_vector_fixed< T, n > const &lhs, vnl_vector_fixed< T, n > const &rhs)
 Define a complete ordering on vnl_vector_fixed. More...
 
vnl_vector_fixed< T, N > vnl_real (vnl_vector_fixed< std::complex< T >, N > const &C)
 Vector of real parts of vnl_vector_fixed<std::complex<T>, N >. More...
 
vnl_vector_fixed< T, n > operator/ (const vnl_vector_fixed< T, n > &v, T s)
 
vnl_vector_fixed< T, n > operator/ (const vnl_vector_fixed_ref_const< T, n > &v, T s)
 
vnl_vector_fixed< T, n > element_product (const vnl_vector_fixed< T, n > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_vector< T > element_product (const vnl_vector_fixed< T, n > &a, const vnl_vector< T > &b)
 
vnl_vector< T > element_product (const vnl_vector< T > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_vector_fixed< T, n > element_quotient (const vnl_vector_fixed< T, n > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_vector< T > element_quotient (const vnl_vector_fixed< T, n > &a, const vnl_vector< T > &b)
 
vnl_vector< T > element_quotient (const vnl_vector< T > &a, const vnl_vector_fixed< T, n > &b)
 
dot_product (const vnl_vector_fixed< T, n > &a, const vnl_vector_fixed< T, n > &b)
 
dot_product (const vnl_vector_fixed< T, n > &a, const vnl_vector< T > &b)
 
dot_product (const vnl_vector< T > &a, const vnl_vector_fixed< T, n > &b)
 
angle (const vnl_vector_fixed< T, n > &a, const vnl_vector_fixed< T, n > &b)
 
angle (const vnl_vector_fixed< T, n > &a, const vnl_vector< T > &b)
 
angle (const vnl_vector< T > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_vector_ssd (const vnl_vector_fixed< T, n > &a, const vnl_vector_fixed< T, n > &b)
 
vnl_vector_ssd (const vnl_vector_fixed< T, n > &a, const vnl_vector< T > &b)
 
vnl_vector_ssd (const vnl_vector< T > &a, const vnl_vector_fixed< T, n > &b)
 
bool operator== (const vnl_vector_fixed< T, n > &a, const vnl_vector_fixed< T, n > &b)
 
bool operator== (vnl_vector_fixed< T, n > const &a, vnl_vector< T > const &b)
 
bool operator== (vnl_vector< T > const &a, vnl_vector_fixed< T, n > const &b)
 
bool operator!= (const vnl_vector_fixed< T, n > &a, const vnl_vector_fixed< T, n > &b)
 
bool operator!= (vnl_vector_fixed< T, n > const &a, vnl_vector< T > const &b)
 
bool operator!= (vnl_vector< T > const &a, vnl_vector_fixed< T, n > const &b)
 
std::ostream & operator<< (std::ostream &ostr, const vnl_vector_fixed< T, n > &v)
 
std::ostream & operator<< (std::ostream &o, const vnl_vector_fixed_ref_const< T, n > &v)
 
std::istream & operator>> (std::istream &ostr, vnl_vector_fixed< T, n > &v)
 
std::istream & operator>> (std::istream &i, const vnl_vector_fixed_ref< T, n > &v)
 
void x_write (std::ostream &os, vnl_vector_fixed< T, n > const &v, std::string name="vnl_vector_fixed")
 XML save vnl_vector_fixed to stream. More...
 
void x_write_tree (std::ostream &os, vnl_vector_fixed< T, n > const &v, std::string name="vnl_vector_fixed")
 XML save vnl_vector_fixed as a 2-level tree to stream. More...
 

Detailed Description

template<class T>
class vnl_quaternion< T >

4-element vector that represents rotation in 3D.

vnl_quaternion is a 4-element vector with 1 real and 3 imaginary components:

q = r + (i*x + j*y + k*z)
r = cos(theta/2)
(x, y, z) = sin(theta/2) (kx, ky, kz)

where theta and k are respectively the angle and axis of rotation.

3D vectors can be thought of as pure imaginary quaternions, and so a quaternion is represented as a vnl_vector_fixed<T,4> with the imaginary part before the real part for 1-1 alignment.

Unit quaternions (i.e., for which $x^2 + y^2 + z^2 + r^2 = 1$) provide a more efficient representation for rotation than the usual orthonormal matrix that has nine parameters and six orthonormal constraints. The unit quaternion has only one unit magnitude constraint. Composing rotations with quaternions results in fewer multiplications and less error. To insure valid rotation results, the nearest unit quaternion is computed, and this is much easier than finding the nearest orthonormal matrix. Transforming vectors with a quaternion requires more operations compared to multiplication with the equivalent orthonormal matrix.

See also
vnl_vector_fixed and vnl_matrix_fixed for basic operations on vectors and matrices.
Envelope for envelope-letter scheme that avoids deep copy on return by value in arithmetic expressions like: q1 * q2 * q3 *...

Definition at line 29 of file vnl_fwd.h.

Member Typedef Documentation

◆ abs_t

typedef vnl_c_vector<T>::abs_t vnl_vector_fixed< T, n >::abs_t
inherited

Definition at line 365 of file vnl_vector_fixed.h.

◆ Base

template<class T>
typedef vnl_vector_fixed<T,4> vnl_quaternion< T >::Base
private

Definition at line 66 of file vnl_quaternion.h.

◆ const_iterator

typedef T const* vnl_vector_fixed< T, n >::const_iterator
inherited

Const iterator type.

Definition at line 296 of file vnl_vector_fixed.h.

◆ element_type

typedef T vnl_vector_fixed< T, n >::element_type
inherited

Type defs for iterators.

Definition at line 286 of file vnl_vector_fixed.h.

◆ iterator

typedef T* vnl_vector_fixed< T, n >::iterator
inherited

Type defs for iterators.

Definition at line 288 of file vnl_vector_fixed.h.

◆ self

typedef vnl_vector_fixed<T,n> vnl_vector_fixed< T, n >::self
inherited

Definition at line 93 of file vnl_vector_fixed.h.

◆ size_type

typedef size_t vnl_vector_fixed< T, n >::size_type
inherited

Definition at line 94 of file vnl_vector_fixed.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Definition at line 96 of file vnl_vector_fixed.h.

Constructor & Destructor Documentation

◆ vnl_quaternion() [1/8]

template<class T>
vnl_quaternion< T >::vnl_quaternion ( )
default

Constructor for null quaternion.

◆ vnl_quaternion() [2/8]

template<class T >
vnl_quaternion< T >::vnl_quaternion ( tx,
ty,
tz,
rea 
)

Construct quaternion from components x,y,z,r.

Creates a quaternion from its ordered components.

x, y, z denote the imaginary part, which are the coordinates of the rotation axis multiplied by the sine of half the angle of rotation. r denotes the real part, or the cosine of half the angle of rotation. Default is to create a null quaternion, corresponding to a null rotation or an identity transform, which has undefined rotation axis.

Definition at line 55 of file vnl_quaternion.hxx.

◆ vnl_quaternion() [3/8]

template<class T >
vnl_quaternion< T >::vnl_quaternion ( theta_X,
theta_Y,
theta_Z 
)

Construct quaternion from Euler Angles,.

Construct quaternion from Euler Angles.

That is a rotation about the X axis, followed by Y, followed by the Z axis, using a fixed reference frame.

Definition at line 157 of file vnl_quaternion.hxx.

◆ vnl_quaternion() [4/8]

template<class T >
vnl_quaternion< T >::vnl_quaternion ( vnl_vector_fixed< T, 3 > const &  axis,
double  angle 
)

Construct quaternion from axis and angle of rotation.

Creates a quaternion from the normalized axis direction and the angle of rotation in radians.

Note
If you specify an angle in [0, 2pi], then methods angle() and axis() will return the same values. However, if you specify an angle in [-2pi, 0], then methods angle() and axis() will return values with opposite signs.
See also
vnl_quaternion::angle()
vnl_quaternion::axis()

Definition at line 66 of file vnl_quaternion.hxx.

◆ vnl_quaternion() [5/8]

template<class T >
vnl_quaternion< T >::vnl_quaternion ( vnl_matrix_fixed< T, 3, 3 > const &  rot)
explicit

Construct quaternion from 3x3 row-major matrix.

Creates a quaternion from a rotation matrix.

Its orthonormal basis vectors are the matrix rows.

Note
this matrix must have determinant +1; this is not verified!
Warning
Takes the transpose of the rotation matrix, i.e., the orthonormal vectors must be the rows of the matrix, not the columns.

Definition at line 105 of file vnl_quaternion.hxx.

◆ vnl_quaternion() [6/8]

template<class T >
vnl_quaternion< T >::vnl_quaternion ( vnl_vector_fixed< T, 3 > const &  vec)

Construct quaternion from a 3D vector.

Creates a quaternion from a vector.

3D vector is converted into an imaginary quaternion with same (x, y, z) components.

Definition at line 80 of file vnl_quaternion.hxx.

◆ vnl_quaternion() [7/8]

template<class T >
vnl_quaternion< T >::vnl_quaternion ( vnl_vector_fixed< T, 4 > const &  vec)

Construct quaternion from a 4D vector.

Creates a quaternion from a vector.

4D vector is assumed to be a 4-element quaternion, to provide casting between vector and quaternion

Definition at line 92 of file vnl_quaternion.hxx.

◆ vnl_quaternion() [8/8]

template<class T>
vnl_quaternion< T >::vnl_quaternion ( vnl_quaternion< T > const &  from)
inline

Copy constructor – Creates a copy of from quaternion.

Definition at line 97 of file vnl_quaternion.h.

◆ ~vnl_quaternion()

template<class T>
vnl_quaternion< T >::~vnl_quaternion ( )
inlinedefault

Free internal array.

Member Function Documentation

◆ add() [1/2]

static void vnl_vector_fixed< T, n >::add ( const T *  a,
const T *  b,
T *  r 
)
inlinestaticinherited

Definition at line 466 of file vnl_vector_fixed.h.

◆ add() [2/2]

static void vnl_vector_fixed< T, n >::add ( const T *  a,
b,
T *  r 
)
inlinestaticinherited

Definition at line 472 of file vnl_vector_fixed.h.

◆ angle()

template<class T >
double vnl_quaternion< T >::angle ( ) const

Angle of rotation.

Queries the rotation angle of the quaternion.

Note
Returned angle lies in [0, 2*pi]

Returned angle lies in [0, 2*pi]

Definition at line 196 of file vnl_quaternion.hxx.

◆ apply() [1/2]

vnl_vector_fixed< T, n > vnl_vector_fixed< T, n >::apply ( T(*)(T)  f)
inherited

Apply f to each element.

Returns a new vector with the result.

Definition at line 60 of file vnl_vector_fixed.hxx.

◆ apply() [2/2]

vnl_vector_fixed< T, n > vnl_vector_fixed< T, n >::apply ( T(*)(const T &)  f)
inherited

Apply f to each element.

Returns a new vector with the result.

Definition at line 70 of file vnl_vector_fixed.hxx.

◆ arg_max()

unsigned vnl_vector_fixed< T, n >::arg_max ( ) const
inlineinherited

Location of largest value.

Definition at line 401 of file vnl_vector_fixed.h.

◆ arg_min()

unsigned vnl_vector_fixed< T, n >::arg_min ( ) const
inlineinherited

Location of smallest value.

Definition at line 398 of file vnl_vector_fixed.h.

◆ as_ref() [1/2]

vnl_vector_ref<T> vnl_vector_fixed< T, n >::as_ref ( )
inlineinherited

Explicit conversion to a vnl_vector_ref.

This is a cheap conversion for those functions that have an interface for vnl_vector but not for vnl_vector_fixed. There is also a conversion operator that should work most of the time.

See also
vnl_vector_ref::non_const

Definition at line 268 of file vnl_vector_fixed.h.

◆ as_ref() [2/2]

const vnl_vector_ref<T> vnl_vector_fixed< T, n >::as_ref ( ) const
inlineinherited

Explicit conversion to a vnl_vector_ref.

This is a cheap conversion for those functions that have an interface for vnl_vector but not for vnl_vector_fixed. There is also a conversion operator that should work most of the time.

See also
vnl_vector_ref::non_const

Definition at line 275 of file vnl_vector_fixed.h.

◆ as_vector()

vnl_vector<T> vnl_vector_fixed< T, n >::as_vector ( ) const
inlineinherited

Convert to a vnl_vector.

Definition at line 359 of file vnl_vector_fixed.h.

◆ assert_finite()

void vnl_vector_fixed< T, n >::assert_finite ( ) const
inlineinherited

Check that this is finite if not, abort();.

This function does or tests nothing if NDEBUG is defined

Definition at line 419 of file vnl_vector_fixed.h.

◆ assert_size()

void vnl_vector_fixed< T, n >::assert_size ( unsigned  sz) const
inlineinherited

Check that size()==sz if not, abort();.

This function does or tests nothing if NDEBUG is defined

Definition at line 415 of file vnl_vector_fixed.h.

◆ axis()

template<class T >
vnl_vector_fixed< T, 3 > vnl_quaternion< T >::axis ( ) const

Axis of rotation.

Queries the direction of the rotation axis of the quaternion.

Note
Axis not well defined for theta==0. In such a case (or if provided axis==(0,0,0)), this function returns (0,0,1).

A null quaternion will return zero for angle and k direction for axis.

Definition at line 205 of file vnl_quaternion.hxx.

◆ begin() [1/2]

iterator vnl_vector_fixed< T, n >::begin ( )
inlineinherited

Iterator pointing to start of data.

Definition at line 290 of file vnl_vector_fixed.h.

◆ begin() [2/2]

const_iterator vnl_vector_fixed< T, n >::begin ( ) const
inlineinherited

Iterator pointing to start of data.

Definition at line 298 of file vnl_vector_fixed.h.

◆ conjugate()

template<class T >
vnl_quaternion< T > vnl_quaternion< T >::conjugate ( ) const

Same real, opposite img part.

Returns the conjugate of given quaternion, having same real and opposite imaginary parts.

Definition at line 255 of file vnl_quaternion.hxx.

◆ copy_in()

vnl_vector_fixed& vnl_vector_fixed< T, n >::copy_in ( T const *  ptr)
inlineinherited

Sets elements to ptr[i].

Note: ptr[i] must be valid for i=0..size()-1

Definition at line 211 of file vnl_vector_fixed.h.

◆ copy_out()

void vnl_vector_fixed< T, n >::copy_out ( T *  ptr) const
inlineinherited

Copy elements to ptr[i].

Note: ptr[i] must be valid for i=0..size()-1

Definition at line 220 of file vnl_vector_fixed.h.

◆ data_block() [1/2]

T const * vnl_vector_fixed< T, n >::data_block ( ) const
inherited

Access the contiguous block storing the elements in the vector.

O(1). data_block()[0] is the first element of the vector

Definition at line 50 of file vnl_vector_fixed.hxx.

◆ data_block() [2/2]

T * vnl_vector_fixed< T, n >::data_block ( )
inherited

Access the contiguous block storing the elements in the vector.

O(1). data_block()[0] is the first element of the vector

Definition at line 55 of file vnl_vector_fixed.hxx.

◆ div() [1/2]

static void vnl_vector_fixed< T, n >::div ( const T *  a,
const T *  b,
T *  r 
)
inlinestaticinherited

Definition at line 508 of file vnl_vector_fixed.h.

◆ div() [2/2]

static void vnl_vector_fixed< T, n >::div ( const T *  a,
b,
T *  r 
)
inlinestaticinherited

Definition at line 514 of file vnl_vector_fixed.h.

◆ empty()

bool vnl_vector_fixed< T, n >::empty ( ) const
inlineinherited

Return true iff the size is zero.

Definition at line 433 of file vnl_vector_fixed.h.

◆ end() [1/2]

iterator vnl_vector_fixed< T, n >::end ( )
inlineinherited

Iterator pointing to element beyond end of data.

Definition at line 293 of file vnl_vector_fixed.h.

◆ end() [2/2]

const_iterator vnl_vector_fixed< T, n >::end ( ) const
inlineinherited

Iterator pointing to element beyond end of data.

Definition at line 300 of file vnl_vector_fixed.h.

◆ extract()

vnl_vector<T> vnl_vector_fixed< T, n >::extract ( unsigned int  len,
unsigned int  start = 0 
) const
inlineinherited

Returns a subvector specified by the start index and length. O(n).

Definition at line 352 of file vnl_vector_fixed.h.

◆ fill()

vnl_vector_fixed& vnl_vector_fixed< T, n >::fill ( T const &  v)
inlineinherited

Set all values to v.

Definition at line 202 of file vnl_vector_fixed.h.

◆ flip()

vnl_vector_fixed< T, n > & vnl_vector_fixed< T, n >::flip ( )
inherited

Reverse the order of the elements.

Element i swaps with element size()-1-i

Definition at line 91 of file vnl_vector_fixed.hxx.

◆ get()

T vnl_vector_fixed< T, n >::get ( unsigned int  i) const
inherited

Get value at element i.

Definition at line 156 of file vnl_vector_fixed.hxx.

◆ imaginary()

template<class T>
vnl_vector_fixed<T,3> vnl_quaternion< T >::imaginary ( ) const
inline

Copies and returns the imaginary part.

Definition at line 135 of file vnl_quaternion.h.

◆ inf_norm()

abs_t vnl_vector_fixed< T, n >::inf_norm ( ) const
inlineinherited

Return largest absolute element value.

Definition at line 380 of file vnl_vector_fixed.h.

◆ inverse()

template<class T >
vnl_quaternion< T > vnl_quaternion< T >::inverse ( ) const

Inverse for nonzero quat.

Returns the inverse of given quaternion.

For unit quaternion representing rotation, the inverse is the same as the conjugate.

Definition at line 265 of file vnl_quaternion.hxx.

◆ is_finite()

bool vnl_vector_fixed< T, n >::is_finite ( ) const
inherited

Return true if it's finite.

Definition at line 100 of file vnl_vector_fixed.hxx.

◆ is_zero()

bool vnl_vector_fixed< T, n >::is_zero ( ) const
inherited

Return true iff all the entries are zero.

Definition at line 112 of file vnl_vector_fixed.hxx.

◆ magnitude()

abs_t vnl_vector_fixed< T, n >::magnitude ( ) const
inlineinherited

Return magnitude (length) of vector.

Definition at line 371 of file vnl_vector_fixed.h.

◆ max_value()

T vnl_vector_fixed< T, n >::max_value ( ) const
inlineinherited

Largest value.

Definition at line 395 of file vnl_vector_fixed.h.

◆ mean()

T vnl_vector_fixed< T, n >::mean ( ) const
inlineinherited

Mean of values in vector.

Definition at line 404 of file vnl_vector_fixed.h.

◆ min_value()

T vnl_vector_fixed< T, n >::min_value ( ) const
inlineinherited

Smallest value.

Definition at line 392 of file vnl_vector_fixed.h.

◆ mul() [1/2]

static void vnl_vector_fixed< T, n >::mul ( const T *  a,
const T *  b,
T *  r 
)
inlinestaticinherited

Definition at line 496 of file vnl_vector_fixed.h.

◆ mul() [2/2]

static void vnl_vector_fixed< T, n >::mul ( const T *  a,
b,
T *  r 
)
inlinestaticinherited

Definition at line 502 of file vnl_vector_fixed.h.

◆ normalize()

vnl_vector_fixed<T,n>& vnl_vector_fixed< T, n >::normalize ( )
inlineinherited

Normalise by dividing through by the magnitude.

Definition at line 383 of file vnl_vector_fixed.h.

◆ one_norm()

abs_t vnl_vector_fixed< T, n >::one_norm ( ) const
inlineinherited

Return sum of absolute values of the elements.

Definition at line 374 of file vnl_vector_fixed.h.

◆ operator *()

template<class T >
vnl_quaternion< T > vnl_quaternion< T >::operator * ( vnl_quaternion< T > const &  rhs) const

Returns the product of two quaternions.

Multiplication of two quaternions is not symmetric and has fewer operations than multiplication of orthonormal matrices. If object is rotated by r1, then by r2, then the composed rotation (r2 o r1) is represented by the quaternion (q2 * q1), or by the matrix (m1 * m2). Note that matrix composition is reversed because matrices and vectors are represented row-wise.

Definition at line 282 of file vnl_quaternion.hxx.

◆ operator *=()

vnl_vector_fixed<T,n>& vnl_vector_fixed< T, n >::operator *= ( s)
inlineinherited

Definition at line 318 of file vnl_vector_fixed.h.

◆ operator const vnl_vector_ref< T >()

vnl_vector_fixed< T, n >::operator const vnl_vector_ref< T > ( ) const
inlineinherited

Cheap conversion to vnl_vector_ref.

Sometimes, such as with templated functions, the compiler cannot use this user-defined conversion. For those cases, use the explicit as_ref() method instead.

Definition at line 281 of file vnl_vector_fixed.h.

◆ operator()() [1/2]

T & vnl_vector_fixed< T, n >::operator() ( unsigned int  i)
inherited

Return reference to the element at specified index.

There are assert style boundary checks - #define NDEBUG to turn them off.

Definition at line 20 of file vnl_vector_fixed.hxx.

◆ operator()() [2/2]

T const & vnl_vector_fixed< T, n >::operator() ( unsigned int  i) const
inherited

Return reference to the element at specified index.

There are assert style boundary checks - #define NDEBUG to turn them off.

Definition at line 30 of file vnl_vector_fixed.hxx.

◆ operator+=() [1/3]

vnl_vector_fixed<T,n>& vnl_vector_fixed< T, n >::operator+= ( s)
inlineinherited

Definition at line 312 of file vnl_vector_fixed.h.

◆ operator+=() [2/3]

vnl_vector_fixed<T,n>& vnl_vector_fixed< T, n >::operator+= ( const vnl_vector_fixed< T, n > &  v)
inlineinherited

Definition at line 324 of file vnl_vector_fixed.h.

◆ operator+=() [3/3]

vnl_vector_fixed<T,n>& vnl_vector_fixed< T, n >::operator+= ( const vnl_vector< T > &  v)
inlineinherited

Definition at line 330 of file vnl_vector_fixed.h.

◆ operator-()

vnl_vector_fixed<T,n> vnl_vector_fixed< T, n >::operator- ( ) const
inlineinherited

Definition at line 344 of file vnl_vector_fixed.h.

◆ operator-=() [1/3]

vnl_vector_fixed<T,n>& vnl_vector_fixed< T, n >::operator-= ( s)
inlineinherited

Definition at line 315 of file vnl_vector_fixed.h.

◆ operator-=() [2/3]

vnl_vector_fixed<T,n>& vnl_vector_fixed< T, n >::operator-= ( const vnl_vector_fixed< T, n > &  v)
inlineinherited

Definition at line 327 of file vnl_vector_fixed.h.

◆ operator-=() [3/3]

vnl_vector_fixed<T,n>& vnl_vector_fixed< T, n >::operator-= ( const vnl_vector< T > &  v)
inlineinherited

Definition at line 337 of file vnl_vector_fixed.h.

◆ operator/=()

vnl_vector_fixed<T,n>& vnl_vector_fixed< T, n >::operator/= ( s)
inlineinherited

Definition at line 321 of file vnl_vector_fixed.h.

◆ operator=()

template<class T>
vnl_quaternion& vnl_quaternion< T >::operator= ( vnl_quaternion< T > const &  rhs)
inline

Overloads assignment operator to copy rhs quaternion into lhs quaternion.

Definition at line 103 of file vnl_quaternion.h.

◆ operator[]() [1/2]

T & vnl_vector_fixed< T, n >::operator[] ( const size_t  i)
inherited

Return the i-th element.

Definition at line 40 of file vnl_vector_fixed.hxx.

◆ operator[]() [2/2]

const T & vnl_vector_fixed< T, n >::operator[] ( const size_t  i) const
inherited

Return the i-th element.

Definition at line 45 of file vnl_vector_fixed.hxx.

◆ operator_eq() [1/2]

bool vnl_vector_fixed< T, n >::operator_eq ( vnl_vector_fixed< T, n > const &  v) const
inlineinherited

Return true if *this == v.

Definition at line 436 of file vnl_vector_fixed.h.

◆ operator_eq() [2/2]

bool vnl_vector_fixed< T, n >::operator_eq ( vnl_vector< T > const &  v) const
inlineinherited

Return true if *this == v.

Definition at line 445 of file vnl_vector_fixed.h.

◆ print()

void vnl_vector_fixed< T, n >::print ( std::ostream &  s) const
inherited

Display the vector.

Output each element separated by a single space.

Definition at line 146 of file vnl_vector_fixed.hxx.

◆ put()

void vnl_vector_fixed< T, n >::put ( unsigned int  i,
T const &  v 
)
inlineinherited

Put value at given position in vector.

Definition at line 189 of file vnl_vector_fixed.h.

◆ r() [1/2]

template<class T>
T& vnl_quaternion< T >::r ( )
inline

Real component.

Use this accessor to both get and set the component.

Definition at line 116 of file vnl_quaternion.h.

◆ r() [2/2]

template<class T>
T vnl_quaternion< T >::r ( ) const
inline

Real component.

Use this accessor to get the component.

Definition at line 129 of file vnl_quaternion.h.

◆ read_ascii()

bool vnl_vector_fixed< T, n >::read_ascii ( std::istream &  s)
inherited

Read from text stream.

Definition at line 125 of file vnl_vector_fixed.hxx.

◆ real()

template<class T>
T vnl_quaternion< T >::real ( ) const
inline

Copies and returns the real part.

Definition at line 132 of file vnl_quaternion.h.

◆ rms()

abs_t vnl_vector_fixed< T, n >::rms ( ) const
inlineinherited

Root Mean Squares of values.

Definition at line 389 of file vnl_vector_fixed.h.

◆ rotate()

template<class T >
vnl_vector_fixed< T, 3 > vnl_quaternion< T >::rotate ( vnl_vector_fixed< T, 3 > const &  v) const

Rotate 3D v.

Rotates 3D vector v with source quaternion and stores the rotated vector back into v.

The quaternion must be normalised first.

For speed and greater accuracy, first convert quaternion into an orthonormal matrix, then use matrix multiplication to rotate many vectors.

Definition at line 299 of file vnl_quaternion.hxx.

◆ rotation_euler_angles()

template<class T >
vnl_vector_fixed< T, 3 > vnl_quaternion< T >::rotation_euler_angles ( ) const

Rotation representation in Euler angles.

The angles returned will be [theta_X,theta_Y,theta_Z] where the final rotation is found be first applying theta_X radians about the X axis, then theta_Y about the Y-axis, etc. The axes stay in a fixed reference frame. The quaternion mut be normalised first.

The angles returned will be [theta_X,theta_Y,theta_Z] where the final rotation is found be first applying theta_X radians about the X axis, then theta_Y about the Y-axis, etc. The axes stay in a fixed reference frame.

Definition at line 171 of file vnl_quaternion.hxx.

◆ rotation_matrix_transpose()

template<class T >
vnl_matrix_fixed< T, 3, 3 > vnl_quaternion< T >::rotation_matrix_transpose ( ) const

3x3 rotation matrix.

Converts a normalized quaternion into a square rotation matrix with dimension dim.

The orthonormal vectors are the rows of the matrix, not its columns

This is the reverse counterpart of constructing a quaternion from a transformation matrix. WARNING this is inconsistent with the quaternion docs and q.rotate()

Definition at line 224 of file vnl_quaternion.hxx.

◆ rotation_matrix_transpose_4()

template<class T >
vnl_matrix_fixed< T, 4, 4 > vnl_quaternion< T >::rotation_matrix_transpose_4 ( ) const

4x4 rotation matrix.

Definition at line 246 of file vnl_quaternion.hxx.

◆ set()

vnl_vector_fixed& vnl_vector_fixed< T, n >::set ( T const *  ptr)
inlineinherited

Sets elements to ptr[i].

Note: ptr[i] must be valid for i=0..size()-1

Definition at line 228 of file vnl_vector_fixed.h.

◆ size()

unsigned int vnl_vector_fixed< T, n >::size ( ) const
inlineinherited

Length of the vector.

This is always n.

Definition at line 186 of file vnl_vector_fixed.h.

◆ squared_magnitude()

abs_t vnl_vector_fixed< T, n >::squared_magnitude ( ) const
inlineinherited

Return sum of squares of elements.

Definition at line 368 of file vnl_vector_fixed.h.

◆ sub() [1/3]

static void vnl_vector_fixed< T, n >::sub ( const T *  a,
const T *  b,
T *  r 
)
inlinestaticinherited

Definition at line 478 of file vnl_vector_fixed.h.

◆ sub() [2/3]

static void vnl_vector_fixed< T, n >::sub ( const T *  a,
b,
T *  r 
)
inlinestaticinherited

Definition at line 484 of file vnl_vector_fixed.h.

◆ sub() [3/3]

static void vnl_vector_fixed< T, n >::sub ( a,
const T *  b,
T *  r 
)
inlinestaticinherited

Definition at line 490 of file vnl_vector_fixed.h.

◆ sum()

T vnl_vector_fixed< T, n >::sum ( ) const
inlineinherited

Sum of values in a vector.

Definition at line 407 of file vnl_vector_fixed.h.

◆ two_norm()

abs_t vnl_vector_fixed< T, n >::two_norm ( ) const
inlineinherited

Return sqrt of sum of squares of values of elements.

Definition at line 377 of file vnl_vector_fixed.h.

◆ update()

vnl_vector_fixed< T, n > & vnl_vector_fixed< T, n >::update ( vnl_vector< T > const &  v,
unsigned int  start = 0 
)
inherited

Replaces elements with index beginning at start, by values of v. O(n).

Definition at line 80 of file vnl_vector_fixed.hxx.

◆ x() [1/2]

template<class T>
T& vnl_quaternion< T >::x ( )
inline

Imaginary component, parallel to axis of rotation.

Use this accessor to both get and set the component.

Definition at line 107 of file vnl_quaternion.h.

◆ x() [2/2]

template<class T>
T vnl_quaternion< T >::x ( ) const
inline

Imaginary component, parallel to axis of rotation.

Use this accessor to get the component.

Definition at line 120 of file vnl_quaternion.h.

◆ y() [1/2]

template<class T>
T& vnl_quaternion< T >::y ( )
inline

Imaginary component, parallel to axis of rotation.

Use this accessor to both get and set the component.

Definition at line 110 of file vnl_quaternion.h.

◆ y() [2/2]

template<class T>
T vnl_quaternion< T >::y ( ) const
inline

Imaginary component, parallel to axis of rotation.

Use this accessor to get the component.

Definition at line 123 of file vnl_quaternion.h.

◆ z() [1/2]

template<class T>
T& vnl_quaternion< T >::z ( )
inline

Imaginary component, parallel to axis of rotation.

Use this accessor to both get and set the component.

Definition at line 113 of file vnl_quaternion.h.

◆ z() [2/2]

template<class T>
T vnl_quaternion< T >::z ( ) const
inline

Imaginary component, parallel to axis of rotation.

Use this accessor to get the component.

Definition at line 126 of file vnl_quaternion.h.

Friends And Related Function Documentation

◆ angle() [1/3]

T angle ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 779 of file vnl_vector_fixed.h.

◆ angle() [2/3]

T angle ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector< T > &  b 
)
related

Definition at line 788 of file vnl_vector_fixed.h.

◆ angle() [3/3]

T angle ( const vnl_vector< T > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 797 of file vnl_vector_fixed.h.

◆ dot_product() [1/3]

T dot_product ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 735 of file vnl_vector_fixed.h.

◆ dot_product() [2/3]

T dot_product ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector< T > &  b 
)
related

Definition at line 744 of file vnl_vector_fixed.h.

◆ dot_product() [3/3]

T dot_product ( const vnl_vector< T > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 753 of file vnl_vector_fixed.h.

◆ element_product() [1/3]

vnl_vector_fixed< T, n > element_product ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 667 of file vnl_vector_fixed.h.

◆ element_product() [2/3]

vnl_vector< T > element_product ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector< T > &  b 
)
related

Definition at line 678 of file vnl_vector_fixed.h.

◆ element_product() [3/3]

vnl_vector< T > element_product ( const vnl_vector< T > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 690 of file vnl_vector_fixed.h.

◆ element_quotient() [1/3]

vnl_vector_fixed< T, n > element_quotient ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 701 of file vnl_vector_fixed.h.

◆ element_quotient() [2/3]

vnl_vector< T > element_quotient ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector< T > &  b 
)
related

Definition at line 712 of file vnl_vector_fixed.h.

◆ element_quotient() [3/3]

vnl_vector< T > element_quotient ( const vnl_vector< T > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 724 of file vnl_vector_fixed.h.

◆ operator *() [1/6]

vnl_vector_fixed< T, N > operator * ( vnl_diag_matrix_fixed< T, N > const &  D,
vnl_vector_fixed< T, N > const &  A 
)
related

Multiply a vnl_diag_matrix_fixed by a vnl_vector_fixed. n flops.

Definition at line 337 of file vnl_diag_matrix_fixed.h.

◆ operator *() [2/6]

vnl_vector_fixed< T, N > operator * ( vnl_vector_fixed< T, N > const &  A,
vnl_diag_matrix_fixed< T, N > const &  D 
)
related

Multiply a vnl_vector_fixed by a vnl_diag_matrix_fixed. n flops.

Definition at line 346 of file vnl_diag_matrix_fixed.h.

◆ operator *() [3/6]

vnl_vector_fixed< T, n > operator * ( const vnl_vector_fixed_ref_const< T, n > &  v,
s 
)
related

Definition at line 479 of file vnl_vector_fixed_ref.h.

◆ operator *() [4/6]

vnl_vector_fixed< T, n > operator * ( s,
const vnl_vector_fixed_ref_const< T, n > &  v 
)
related

Definition at line 488 of file vnl_vector_fixed_ref.h.

◆ operator *() [5/6]

vnl_vector_fixed< T, n > operator * ( const vnl_vector_fixed< T, n > &  v,
s 
)
related

Definition at line 573 of file vnl_vector_fixed.h.

◆ operator *() [6/6]

vnl_vector_fixed< T, n > operator * ( const T &  s,
const vnl_vector_fixed< T, n > &  v 
)
related

Definition at line 583 of file vnl_vector_fixed.h.

◆ operator!=() [1/3]

bool operator!= ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 859 of file vnl_vector_fixed.h.

◆ operator!=() [2/3]

bool operator!= ( vnl_vector_fixed< T, n > const &  a,
vnl_vector< T > const &  b 
)
related

Definition at line 868 of file vnl_vector_fixed.h.

◆ operator!=() [3/3]

bool operator!= ( vnl_vector< T > const &  a,
vnl_vector_fixed< T, n > const &  b 
)
related

Definition at line 877 of file vnl_vector_fixed.h.

◆ operator+() [1/9]

vnl_double_3 operator+ ( const vnl_double_3 &  a,
const vnl_double_3 &  b 
)
related

The binary addition operator.

Definition at line 37 of file vnl_linear_operators_3.h.

◆ operator+() [2/9]

vnl_vector_fixed< T, n > operator+ ( const vnl_vector_fixed_ref_const< T, n > &  v,
s 
)
related

Definition at line 443 of file vnl_vector_fixed_ref.h.

◆ operator+() [3/9]

vnl_vector_fixed< T, n > operator+ ( s,
const vnl_vector_fixed_ref_const< T, n > &  v 
)
related

Definition at line 452 of file vnl_vector_fixed_ref.h.

◆ operator+() [4/9]

vnl_vector_fixed< T, n > operator+ ( const vnl_vector_fixed_ref_const< T, n > &  a,
const vnl_vector_fixed_ref_const< T, n > &  b 
)
related

Definition at line 510 of file vnl_vector_fixed_ref.h.

◆ operator+() [5/9]

vnl_vector_fixed< T, n > operator+ ( const vnl_vector_fixed< T, n > &  v,
s 
)
related

Definition at line 531 of file vnl_vector_fixed.h.

◆ operator+() [6/9]

vnl_vector_fixed< T, n > operator+ ( const T &  s,
const vnl_vector_fixed< T, n > &  v 
)
related

Definition at line 541 of file vnl_vector_fixed.h.

◆ operator+() [7/9]

vnl_vector_fixed< T, n > operator+ ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 611 of file vnl_vector_fixed.h.

◆ operator+() [8/9]

vnl_vector< T > operator+ ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector< T > &  b 
)
related

Definition at line 622 of file vnl_vector_fixed.h.

◆ operator+() [9/9]

vnl_vector< T > operator+ ( const vnl_vector< T > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 631 of file vnl_vector_fixed.h.

◆ operator-() [1/8]

vnl_vector_fixed< T, n > operator- ( const vnl_vector_fixed_ref_const< T, n > &  v,
s 
)
related

Definition at line 461 of file vnl_vector_fixed_ref.h.

◆ operator-() [2/8]

vnl_vector_fixed< T, n > operator- ( s,
const vnl_vector_fixed_ref_const< T, n > &  v 
)
related

Definition at line 470 of file vnl_vector_fixed_ref.h.

◆ operator-() [3/8]

vnl_vector_fixed< T, n > operator- ( const vnl_vector_fixed_ref_const< T, n > &  a,
const vnl_vector_fixed_ref_const< T, n > &  b 
)
related

Definition at line 519 of file vnl_vector_fixed_ref.h.

◆ operator-() [4/8]

vnl_vector_fixed< T, n > operator- ( const vnl_vector_fixed< T, n > &  v,
s 
)
related

Definition at line 552 of file vnl_vector_fixed.h.

◆ operator-() [5/8]

vnl_vector_fixed< T, n > operator- ( const T &  s,
const vnl_vector_fixed< T, n > &  v 
)
related

Definition at line 562 of file vnl_vector_fixed.h.

◆ operator-() [6/8]

vnl_vector_fixed< T, n > operator- ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 639 of file vnl_vector_fixed.h.

◆ operator-() [7/8]

vnl_vector< T > operator- ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector< T > &  b 
)
related

Definition at line 650 of file vnl_vector_fixed.h.

◆ operator-() [8/8]

vnl_vector< T > operator- ( const vnl_vector< T > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 659 of file vnl_vector_fixed.h.

◆ operator/() [1/2]

vnl_vector_fixed< T, n > operator/ ( const vnl_vector_fixed_ref_const< T, n > &  v,
s 
)
related

Definition at line 497 of file vnl_vector_fixed_ref.h.

◆ operator/() [2/2]

vnl_vector_fixed< T, n > operator/ ( const vnl_vector_fixed< T, n > &  v,
s 
)
related

Definition at line 594 of file vnl_vector_fixed.h.

◆ operator<()

VNL_EXPORT bool operator< ( vnl_vector_fixed< T, n > const &  lhs,
vnl_vector_fixed< T, n > const &  rhs 
)
related

Define a complete ordering on vnl_vector_fixed.

This is useful to create a set, or map of vectors.

Definition at line 71 of file vnl_operators.h.

◆ operator<<() [1/3]

template<class T >
std::ostream & operator<< ( std::ostream &  os,
vnl_quaternion< T > const &  q 
)
related

operator<<.

Definition at line 188 of file vnl_quaternion.h.

◆ operator<<() [2/3]

std::ostream & operator<< ( std::ostream &  o,
const vnl_vector_fixed_ref_const< T, n > &  v 
)
related

Definition at line 676 of file vnl_vector_fixed_ref.h.

◆ operator<<() [3/3]

std::ostream & operator<< ( std::ostream &  ostr,
const vnl_vector_fixed< T, n > &  v 
)
related

Definition at line 890 of file vnl_vector_fixed.h.

◆ operator==() [1/3]

bool operator== ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 833 of file vnl_vector_fixed.h.

◆ operator==() [2/3]

bool operator== ( vnl_vector_fixed< T, n > const &  a,
vnl_vector< T > const &  b 
)
related

Definition at line 842 of file vnl_vector_fixed.h.

◆ operator==() [3/3]

bool operator== ( vnl_vector< T > const &  a,
vnl_vector_fixed< T, n > const &  b 
)
related

Definition at line 851 of file vnl_vector_fixed.h.

◆ operator>>() [1/3]

template<class T >
std::istream & operator>> ( std::istream &  is,
vnl_quaternion< T > &  q 
)
related

operator<<.

Definition at line 176 of file vnl_quaternion.h.

◆ operator>>() [2/3]

std::istream & operator>> ( std::istream &  i,
const vnl_vector_fixed_ref< T, n > &  v 
)
related

Definition at line 685 of file vnl_vector_fixed_ref.h.

◆ operator>>() [3/3]

std::istream & operator>> ( std::istream &  ostr,
vnl_vector_fixed< T, n > &  v 
)
related

Definition at line 900 of file vnl_vector_fixed.h.

◆ outer_product() [1/3]

vnl_matrix< T > outer_product ( const vnl_vector< T > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 762 of file vnl_vector_fixed.h.

◆ outer_product() [2/3]

vnl_matrix< T > outer_product ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector< T > &  b 
)
related

Definition at line 771 of file vnl_vector_fixed.h.

◆ outer_product() [3/3]

VNL_EXPORT vnl_matrix_fixed< T, m, n > outer_product ( vnl_vector_fixed< T, m > const &  a,
vnl_vector_fixed< T, n > const &  b 
)
related

◆ vnl_complexify() [1/2]

vnl_vector_fixed< std::complex< T >, n > vnl_complexify ( vnl_vector_fixed< T, n > const &  R)
related

Return complexified version of real fixed vector R.

Definition at line 60 of file vnl_complexify.h.

◆ vnl_complexify() [2/2]

vnl_vector_fixed< std::complex< T >, n > vnl_complexify ( vnl_vector_fixed< T, n > const &  R,
vnl_vector_fixed< T, n > const &  I 
)
related

Return complex fixed vector R+j*I from two real fixed vectors R and I.

Definition at line 132 of file vnl_complexify.h.

◆ vnl_cross_2d() [1/5]

double vnl_cross_2d ( vnl_double_2 const &  v1,
vnl_double_2 const &  v2 
)
related

Cross product of two 2-vectors.

Definition at line 25 of file vnl_double_2.h.

◆ vnl_cross_2d() [2/5]

float vnl_cross_2d ( vnl_float_2 const &  v1,
vnl_float_2 const &  v2 
)
related

Cross product of two 2-vectors.

Definition at line 25 of file vnl_float_2.h.

◆ vnl_cross_2d() [3/5]

T vnl_cross_2d ( const vnl_vector_fixed< T, 2 > &  v1,
const vnl_vector_fixed< T, 2 > &  v2 
)
related

Compute the 2-D cross product.

Definition at line 34 of file vnl_cross.h.

◆ vnl_cross_2d() [4/5]

T vnl_cross_2d ( vnl_vector_fixed< T, 2 > const &  v1,
vnl_vector< T > const &  v2 
)
related

Compute the 2-D cross product.

Definition at line 44 of file vnl_cross.h.

◆ vnl_cross_2d() [5/5]

T vnl_cross_2d ( vnl_vector< T > const &  v1,
vnl_vector_fixed< T, 2 > const &  v2 
)
related

Compute the 2-D cross product.

Definition at line 55 of file vnl_cross.h.

◆ vnl_cross_3d() [1/5]

vnl_double_3 vnl_cross_3d ( vnl_double_3 const &  v1,
vnl_double_3 const &  v2 
)
related

Cross product of two 3-vectors.

Definition at line 25 of file vnl_double_3.h.

◆ vnl_cross_3d() [2/5]

vnl_float_3 vnl_cross_3d ( vnl_float_3 const &  v1,
vnl_float_3 const &  v2 
)
related

Cross product of two 3-vectors.

Definition at line 25 of file vnl_float_3.h.

◆ vnl_cross_3d() [3/5]

vnl_vector_fixed< T, 3 > vnl_cross_3d ( const vnl_vector_fixed< T, 3 > &  v1,
const vnl_vector_fixed< T, 3 > &  v2 
)
related

Compute the 3-D cross product.

Definition at line 79 of file vnl_cross.h.

◆ vnl_cross_3d() [4/5]

vnl_vector_fixed< T, n > vnl_cross_3d ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector< T > &  b 
)
related

Compute the 3-D cross product.

Definition at line 93 of file vnl_cross.h.

◆ vnl_cross_3d() [5/5]

vnl_vector_fixed< T, n > vnl_cross_3d ( const vnl_vector< T > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Compute the 3-D cross product.

Definition at line 103 of file vnl_cross.h.

◆ vnl_imag()

vnl_vector_fixed< T, N > vnl_imag ( vnl_vector_fixed< std::complex< T >, N > const &  C)
related

Vector of imaginary parts of vnl_vector_fixed<std::complex<T>, N >.

Definition at line 49 of file vnl_imag.h.

◆ vnl_matlab_print()

VNL_EXPORT std::ostream & vnl_matlab_print ( std::ostream &  ,
vnl_vector_fixed< T, n > const &  ,
char const *  variable_name = nullptr,
vnl_matlab_print_format  = vnl_matlab_print_format_default 
)
related

print a vnl_vector_fixed<T>.

◆ vnl_real()

vnl_vector_fixed< T, N > vnl_real ( vnl_vector_fixed< std::complex< T >, N > const &  C)
related

Vector of real parts of vnl_vector_fixed<std::complex<T>, N >.

Definition at line 49 of file vnl_real.h.

◆ vnl_vector_ssd() [1/3]

T vnl_vector_ssd ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 806 of file vnl_vector_fixed.h.

◆ vnl_vector_ssd() [2/3]

T vnl_vector_ssd ( const vnl_vector_fixed< T, n > &  a,
const vnl_vector< T > &  b 
)
related

Definition at line 815 of file vnl_vector_fixed.h.

◆ vnl_vector_ssd() [3/3]

T vnl_vector_ssd ( const vnl_vector< T > &  a,
const vnl_vector_fixed< T, n > &  b 
)
related

Definition at line 824 of file vnl_vector_fixed.h.

◆ vsl_b_read()

void vsl_b_read ( vsl_b_istream &  is,
vnl_vector_fixed< T, n > &  v 
)
related

Binary load vnl_vector_fixed from stream.

◆ vsl_b_write()

void vsl_b_write ( vsl_b_ostream &  os,
const vnl_vector_fixed< T, n > &  v 
)
related

Binary save vnl_vector_fixed to stream.

◆ vsl_print_summary()

void vsl_print_summary ( std::ostream &  os,
const vnl_vector_fixed< T, n > &  b 
)
related

Print human readable summary of object to a stream.

◆ x_write() [1/2]

template<class T >
void x_write ( std::ostream &  os,
vnl_quaternion< T > const &  v,
std::string  name = "vnl_quaternion< T >" 
)
related

XML save vnl_quaternion to stream.

◆ x_write() [2/2]

void x_write ( std::ostream &  os,
vnl_vector_fixed< T, n > const &  v,
std::string  name = "vnl_vector_fixed< T, 4 >" 
)
related

XML save vnl_vector_fixed to stream.

◆ x_write_tree() [1/2]

template<class T >
void x_write_tree ( std::ostream &  os,
vnl_quaternion< T > const &  v,
std::string  name = "vnl_quaternion< T >" 
)
related

XML save vnl_quaternion as a 2-level tree to stream.

◆ x_write_tree() [2/2]

void x_write_tree ( std::ostream &  os,
vnl_vector_fixed< T, n > const &  v,
std::string  name = "vnl_vector_fixed< T, 4 >" 
)
related

XML save vnl_vector_fixed as a 2-level tree to stream.

Member Data Documentation

◆ data_

T vnl_vector_fixed< T, n >::data_[n]
protectedinherited

Definition at line 90 of file vnl_vector_fixed.h.


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