
 Quaternion_ () 
 Default constructor produces the ZeroRotation quaternion [1 0 0 0] (not NaN  even in debug mode). More...


 Quaternion_ (const Quaternion_ &q) 
 Zerocost copy constructor just copies the source without conversion to canonical form or normalization. More...


Quaternion_ &  operator= (const Quaternion_ &q) 
 Zerocost copy assignment just copies the source without conversion to canonical form or normalization. More...


 Quaternion_ (RealP e0, RealP e1, RealP e2, RealP e3) 
 Construct a quaternion from four scalars and normalize the result, which costs about 40 flops. More...


 Quaternion_ (const Vec4P &q) 
 Construct a quaternion from a 4vector and normalize the result, which costs about 40 flops. More...


 Quaternion_ (const Rotation_< P > &) 
 Constructs a canonical quaternion from a rotation matrix (cost is about 60 flops). More...


void  setQuaternionToZeroRotation () 
 The ZeroRotation quaternion is [1 0 0 0]. More...


void  setQuaternionToNaN () 
 Set quaternion to allNaN. More...


void  setQuaternionFromAngleAxis (const Vec4P &av) 
 Set this quaternion from an angleaxis rotation packed into a 4vector as [a vx vy vz]. More...


void  setQuaternionFromAngleAxis (const RealP &a, const UnitVec< P, 1 > &v) 
 Set this quaternion from an angleaxis rotation provided as an angle a and a separate unit vector [vx vy vz]. More...


Vec4P  convertQuaternionToAngleAxis () const 
 Returns [ a vx vy vz ] with (a,v) in canonical form, i.e., 180 < a <= 180 and v=1. More...


const Vec4P &  asVec4 () const 
 Zerocost cast of a Quaternion_ to its underlying Vec4; this is not converted to axisangle form. More...


Quaternion_ &  normalizeThis () 
 Normalize an already constructed quaternion in place; but do you really need to do this? Quaternions should be kept normalized at all times. More...


Quaternion_  normalize () const 
 Return a normalized copy of this quaternion; but do you really need to do this? Quaternions should be kept normalized at all times. More...


 Quaternion_ (const Vec4P &v, bool) 
 Use this constructor only if you are sure v is normalized to 1.0. More...


ScalarNormSq  scalarNormSqr () const 
 Scalar norm square is sum( conjugate squares of all underlying scalars ), where conjugate square of scalar s is conj(s)*s. More...


TSqrt  sqrt () const 
 Elementwise square root; that is, the return value has the same length as this Vec but with each element replaced by whatever it thinks its square root is. More...


TAbs  abs () const 
 Elementwise absolute value; that is, the return value has the same dimension as this Vec but with each element replaced by whatever it thinks its absolute value is. More...


TStandard  standardize () const 
 Return a copy of this Vec but with the underlying scalar type converted (if necessary) to one of the C++ standard real or complex floating point types. More...


EStandard  sum () const 
 Sum just adds up all the elements into a single return element that is the same type as this Vec's elements except standardized to use one of the C++ builtin real or complex types as its underlying scalars. More...


 Vec () 
 Default construction initializes Vec's elements to NaN when debugging but leaves them uninitialized garbage otherwise, so declarations have zero cost in Release builds. More...


 Vec (const Vec &src) 
 Copy constructor copies the logicallyincluded elements from the source Vec; gaps due to stride are not accessed in either source or destination. More...


 Vec (const Vec< M, E, SS > &src) 
 This is an implicit conversion from a Vec of the same length and element type but with a different stride. More...


 Vec (const Vec< M, ENeg, SS > &src) 
 This is an implicit conversion from a Vec of the same length and negated element type (possibly with a different stride). More...


 Vec (const Vec< M, EE, SS > &src) 
 Construct a Vec from a Vec of the same length, with any stride. More...


 Vec (const E &e) 
 Construction from a single value of this Vec's element type assigns that value to each element. More...


 Vec (const ENeg &ne) 
 Construction from a single value of this Vec's negated element type assigns that value to each element, requiring floating point negation to be performed once to compute the typeE representation of the type negator<E> value provided. More...


 Vec (int i) 
 Given an int value, turn it into a suitable floating point number, convert that to element type E and then feed that to the above singleelement constructor. More...


 Vec (const E &e0, const E &e1) 
 Construct a Vec<2,E> from two elements of type E, etc. More...


 Vec (const E &e0, const E &e1, const E &e2) 

 Vec (const E &e0, const E &e1, const E &e2, const E &e3) 

 Vec (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4) 

 Vec (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5) 

 Vec (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5, const E &e6) 

 Vec (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5, const E &e6, const E &e7) 

 Vec (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5, const E &e6, const E &e7, const E &e8) 

 Vec (const EE *p) 
 Construction from a pointer to elements of any type EE assumes we're pointing at a C++ array of EE's of the right length, and that EE is assignment compatible with this Vec's element type E. More...


Vec &  operator= (const Vec &src) 
 Copy assignment operator copies the logicallyincluded elements from the source Vec; gaps due to stride are not accessed in either source or destination. More...


Vec &  operator= (const EE *p) 
 Assignment to a pointer to elements of any type EE assumes we're pointing at a C++ array of EE's of the right length, and that EE is assignment compatible with this Vec's element type E. More...


Vec &  operator= (const Vec< M, EE, SS > &vv) 
 Assignment to a conforming Vec, of any element type and stride, provided that the element types are assignmentcompatible. More...


Vec &  operator= (const EE &e) 

Vec &  operator+= (const Vec< M, EE, SS > &r) 
 Add in a conforming Vec, of any element type and stride, provided that the element types are additioncompatible. More...


Vec &  operator+= (const Vec< M, negator< EE >, SS > &r) 
 Add in a conforming Vec, of any negated element type and stride, provided that the element types are additioncompatible. More...


Vec &  operator+= (const EE &e) 

Vec &  operator= (const Vec< M, EE, SS > &r) 
 Subtract off a conforming Vec, of any element type and stride, provided that the element types are additioncompatible. More...


Vec &  operator= (const Vec< M, negator< EE >, SS > &r) 
 Subtract off a conforming Vec, of any negated element type and stride, provided that the element types are additioncompatible. More...


Vec &  operator= (const EE &e) 

Vec< M, typename CNT< E >::template Result< EE >::Add >  conformingAdd (const Vec< M, EE, SS > &r) const 
 Vector addition – use operator+ instead. More...


Vec< M, typename CNT< E >::template Result< EE >::Sub >  conformingSubtract (const Vec< M, EE, SS > &r) const 
 Vector subtraction – use operator instead. More...


Mat< M, M, typename CNT< E >::template Result< EE >::Mul >  conformingMultiply (const Row< M, EE, SS > &r) const 
 Same as outer product (m = col*row) – use operator* or outer() instead. More...


Vec< M, typename CNT< E >::template Result< EE >::Mul >  elementwiseMultiply (const Vec< M, EE, SS > &r) const 
 Elementwise multiply (Matlab " .* " operator). More...


Vec< M, typename CNT< E >::template Result< EE >::Dvd >  elementwiseDivide (const Vec< M, EE, SS > &r) const 
 Elementwise divide (Matlab " ./ " operator). More...


const E &  operator[] (int i) const 
 Select an element of this Vec and return a const reference to it. More...


E &  operator[] (int i) 
 Select an element of this Vec and return a writable reference to it. More...


const E &  operator() (int i) const 
 Same as const operator[] above. More...


E &  operator() (int i) 
 Same as nonconst operator[] above. More...


ScalarNormSq  normSqr () const 

CNT< ScalarNormSq >::TSqrt  norm () const 

TNormalize  normalize () const 
 If the elements of this Vec are scalars, the result is what you get by dividing each element by the norm() calculated above. More...


TInvert  invert () const 
 This method is not supported for Vec objects. More...


const Vec &  operator+ () const 
 Unary plus does nothing. More...


const TNeg &  operator () const 
 Unary minus recasts this Vec to a type that has the opposite interpretation of the sign but is otherwise identical, so no computation or copying is performed here. More...


TNeg &  operator () 
 Recast to negated type and return a writable reference; writing to this will cause the negated result to be placed in the original Vec. More...


const THerm &  operator~ () const 
 The Hermitian transpose operator recasts this Vec to a type that specifies the opposite storage order (row vs. column) then returns a reference, so no computation or copying is performed here. More...


THerm &  operator~ () 
 Recast to Hermitian transposed type and return a writable reference; the effect is that writing to elements of the result affects the transposed element of the original Vec. More...


const TNeg &  negate () const 
 Nonoperator version of unary negation; just a recast. More...


TNeg &  updNegate () 
 Nonoperator version of unary negation; recasts and returns a writable reference. More...


const THerm &  transpose () const 
 Nonoperator version of Hermitian transpose; just a recast. More...


THerm &  updTranspose () 
 Nonoperator version of Hermitian transpose; recasts and returns a writable reference. More...


const TPosTrans &  positionalTranspose () const 
 Positional transpose turns this Vec into a Row but does not transpose the individual elements. More...


TPosTrans &  updPositionalTranspose () 
 Positional transpose returning a writable reference. More...


const TReal &  real () const 
 Return a reference to the real portion of this Vec if it has complex elements; otherwise the type doesn't change. More...


TReal &  real () 
 Recast to show only the real portion of this Vec and return a writable reference. More...


const TImag &  imag () const 
 Return a reference to the imaginary portion of this Vec if it has complex elements; otherwise the type doesn't change. More...


TImag &  imag () 
 Recast to show only the imaginary portion of this Vec and return a writable reference. More...


const TWithoutNegator &  castAwayNegatorIfAny () const 
 Recast to remove negators from this Vec's type if present; this is handy for simplifying operations where we know the sign can be ignored such as squaring. More...


TWithoutNegator &  updCastAwayNegatorIfAny () 
 Recast to remove negators from this Vec's type if present and return a writable reference. More...


Vec< M, typename CNT< E >::template Result< EE >::Mul >  scalarMultiply (const EE &e) const 

Vec< M, typename CNT< EE >::template Result< E >::Mul >  scalarMultiplyFromLeft (const EE &e) const 

Vec< M, typename CNT< E >::template Result< EE >::Dvd >  scalarDivide (const EE &e) const 

Vec< M, typename CNT< EE >::template Result< E >::Dvd >  scalarDivideFromLeft (const EE &e) const 

Vec< M, typename CNT< E >::template Result< EE >::Add >  scalarAdd (const EE &e) const 

Vec< M, typename CNT< E >::template Result< EE >::Sub >  scalarSubtract (const EE &e) const 

Vec< M, typename CNT< EE >::template Result< E >::Sub >  scalarSubtractFromLeft (const EE &e) const 

Vec &  operator*= (const EE &e) 

Vec &  operator/= (const EE &e) 

Vec &  scalarEq (const EE &ee) 

Vec &  scalarEq (int ee) 

Vec &  scalarPlusEq (const EE &ee) 

Vec &  scalarPlusEq (int ee) 

Vec &  scalarMinusEq (const EE &ee) 

Vec &  scalarMinusEq (int ee) 

Vec &  scalarMinusEqFromLeft (const EE &ee) 

Vec &  scalarMinusEqFromLeft (int ee) 

Vec &  scalarTimesEq (const EE &ee) 

Vec &  scalarTimesEq (int ee) 

Vec &  scalarTimesEqFromLeft (const EE &ee) 

Vec &  scalarTimesEqFromLeft (int ee) 

Vec &  scalarDivideEq (const EE &ee) 

Vec &  scalarDivideEq (int ee) 

Vec &  scalarDivideEqFromLeft (const EE &ee) 

Vec &  scalarDivideEqFromLeft (int ee) 

void  setToNaN () 
 Set every scalar in this Vec to NaN; this is the default initial value in Debug builds, but not in Release. More...


void  setToZero () 
 Set every scalar in this Vec to zero. More...


const Vec< MM, P, STRIDE > &  getSubVec (int i) const 
 Extract a const reference to a subVec with size known at compile time. More...


Vec< MM, P, STRIDE > &  updSubVec (int i) 
 Extract a writable reference to a subVec with size known at compile time. More...


Vec< M1, P, 1 >  drop1 (int p) const 
 Return a vector one smaller than this one by dropping the element at the indicated position p. More...


Vec< M+1, P, 1 >  append1 (const EE &v) const 
 Return a vector one larger than this one by adding an element to the end. More...


Vec< M+1, P, 1 >  insert1 (int p, const EE &v) const 
 Return a vector one larger than this one by inserting an element before the indicated one. More...


bool  isNaN () const 
 Return true if any element of this Vec contains a NaN anywhere. More...


bool  isInf () const 
 Return true if any element of this Vec contains a +Infinity or Infinity somewhere but no element contains a NaN anywhere. More...


bool  isFinite () const 
 Return true if no element of this Vec contains an Infinity or a NaN anywhere. More...


bool  isNumericallyEqual (const Vec< M, E2, RS2 > &v, double tol) const 
 Test whether this vector is numerically equal to some other vector with the same shape, using a specified tolerance. More...


bool  isNumericallyEqual (const Vec< M, E2, RS2 > &v) const 
 Test whether this vector is numerically equal to some other vector with the same shape, using a default tolerance which is the looser of the default tolerances of the two objects being compared. More...


bool  isNumericallyEqual (const P &e, double tol=getDefaultTolerance()) const 
 Test whether every element of this vector is numerically equal to the given element, using either a specified tolerance or the vector's default tolerance (which is always the same or looser than the default tolerance for one of its elements). More...


std::string  toString () const 
 Print Vec into a string and return it. More...


void  set (int i, const E &value) 
 Variant of operator[] that's scripting friendly to set ith entry. More...


const E &  get (int i) const 
 Variant of operator[] that's scripting friendly to get const reference to ith entry. More...

