SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
TaoDeVector6.h
1 /* Copyright (c) 2005 Arachi, Inc. and Stanford University. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining
4  * a copy of this software and associated documentation files (the
5  * "Software"), to deal in the Software without restriction, including
6  * without limitation the rights to use, copy, modify, merge, publish,
7  * distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject
9  * to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef _deVector6_h
24 #define _deVector6_h
25 
33 class deVector6
34 {
35 public:
37  DE_MATH_API deVector3& operator[](deInt row);
39  DE_MATH_API const deVector3& operator[](deInt row) const;
41  DE_MATH_API deFloat& elementAt(deInt i);
43  DE_MATH_API const deFloat& elementAt(deInt i) const;
45  DE_MATH_API void operator=(const deVector6& v);
47  DE_MATH_API void zero();
49  DE_MATH_API void negate(const deVector6& v);
51  DE_MATH_API void add(const deVector6& v1, const deVector6& v2);
53  DE_MATH_API void subtract(const deVector6& v1, const deVector6& v2);
55  DE_MATH_API void multiply(const deVector6& v, const deFloat s);
57  DE_MATH_API void multiply(const deMatrix6& m, const deVector6& v);
59  DE_MATH_API void transposedMultiply(const deMatrix6& m, const deVector6& v);
61  DE_MATH_API void error(const deTransform& T, const deTransform& Td);
63  DE_MATH_API void error(const deFrame &F, const deFrame &Fd);
65  DE_MATH_API void operator+=(const deVector6& v);
67  DE_MATH_API void operator-=(const deVector6& v);
69  DE_MATH_API void operator*=(const deFloat s);
71  DE_MATH_API deFloat dot(const deVector6& v) const;
73  DE_MATH_API void solve(const deMatrix6& m, const deVector6& y);
75  DE_MATH_API void solveSPD(const deMatrix6& m, const deVector6& y);
76 
80  // @{
82  // X = [ R 0; dxR R ]
83  // Fh = X Fi
84  // = [ R fi ; dxR fi + R ni ]
85  DE_MATH_API void xform(const deTransform& t, const deVector6& v);
87  // Xt = [ Rt -Rtdx; 0 Rt ]
88  // Vi = Xt Vh
89  // = [ Rtvh - Rtdxwh; Rtwh ]
90  // = [ Rt(vh - dxwh); Rtwh ]
91  DE_MATH_API void xformT(const deTransform& t, const deVector6& v);
93  // Xtinv = [ R dxR; 0 R ]
94  // Vi = Xtinv Vh
95  // = [ R vh + dxR wh; R wh ]
96  DE_MATH_API void xformInvT(const deTransform& t, const deVector6& v);
98  // Xinv = [ Rt 0; -Rtdx Rt ]
99  // Vh = Xinv Vi
100  // = [ Rtvi ; -Rtdxvi + Rtwi ]
101  // = [ Rtvi ; Rt(wi - dxvi) ]
102  DE_MATH_API void xformInv(const deTransform& t, const deVector6& v);
104  // = [ v1 x tmp0 + v0 x tmp1; v1 x tmp1 ]
105  DE_MATH_API void crossMultiply(const deVector6& v1, const deVector6& v2);
106  // @}
107 
109  void backSub(const deMatrix6& lu, const deVector6& y);
111  void backSubSPD(const deMatrix6& lu, const deVector6& y);
112 
113 private:
114  deVector3 _vec3[2];
115 };
116 
117 #endif // _deVector6_h
DE_MATH_API void multiply(const deVector6 &v, const deFloat s)
this[i] = v[i] * s
Definition: TaoDeVector6Inl.h:40
DE_MATH_API void subtract(const deVector6 &v1, const deVector6 &v2)
this = v1 - v2
Definition: TaoDeVector6Inl.h:39
DE_MATH_API void operator-=(const deVector6 &v)
this -= v
Definition: TaoDeVector6Inl.h:54
3x1 vector classThis is a C++ wrapper class of deVector3f.
Definition: TaoDeVector3.h:32
DE_MATH_API void xformInvT(const deTransform &t, const deVector6 &v)
this = X^-T v
Definition: TaoDeVector6Inl.h:71
6x1 vector classThis class consists of two 3x1 vectors.
Definition: TaoDeVector6.h:33
DE_MATH_API void solveSPD(const deMatrix6 &m, const deVector6 &y)
this = x where y = m x and m is SPD
Definition: TaoDeVector6Inl.h:57
DE_MATH_API void operator+=(const deVector6 &v)
this += v
Definition: TaoDeVector6Inl.h:53
Transformation class using rotational matrixThis class consists of a matrix for rotation and a vector...
Definition: TaoDeTransform.h:32
DE_MATH_API void error(const deTransform &T, const deTransform &Td)
this = T - Td
Definition: TaoDeVector6Inl.h:51
DE_MATH_API deVector3 & operator[](deInt row)
Definition: TaoDeVector6Inl.h:26
void backSub(const deMatrix6 &lu, const deVector6 &y)
this = x where y = LU x
Definition: TaoDeVector6.cpp:30
DE_MATH_API void zero()
this = zero vector
Definition: TaoDeVector6Inl.h:36
DE_MATH_API void transposedMultiply(const deMatrix6 &m, const deVector6 &v)
this = m^T * v
Definition: TaoDeVector6Inl.h:46
DE_MATH_API void solve(const deMatrix6 &m, const deVector6 &y)
this = x where y = m x
Definition: TaoDeVector6Inl.h:56
Transformation class using quaternionThis class consists of a quaternion for rotation and a vector fo...
Definition: TaoDeFrame.h:36
DE_MATH_API void add(const deVector6 &v1, const deVector6 &v2)
this = v1 + v2
Definition: TaoDeVector6Inl.h:38
6x6 matrix classThis class consists of four 3x3 matrices.
Definition: TaoDeMatrix6.h:33
DE_MATH_API void operator=(const deVector6 &v)
this = v
Definition: TaoDeVector6Inl.h:35
DE_MATH_API void xformT(const deTransform &t, const deVector6 &v)
this = X^T v
Definition: TaoDeVector6Inl.h:65
DE_MATH_API void negate(const deVector6 &v)
this = -v
Definition: TaoDeVector6Inl.h:37
DE_MATH_API deFloat & elementAt(deInt i)
Definition: TaoDeVector6Inl.h:29
DE_MATH_API void xformInv(const deTransform &t, const deVector6 &v)
this = X^-1 v
Definition: TaoDeVector6Inl.h:78
void backSubSPD(const deMatrix6 &lu, const deVector6 &y)
this = x where y = LU x and L*U is SPD
Definition: TaoDeVector6.cpp:62
DE_MATH_API void crossMultiply(const deVector6 &v1, const deVector6 &v2)
this = [v0;v1]X[tmp0;tmp1] = [ v1x , v0x ; 0 , v1x ] [ tmp0 ; tmp1 ]
Definition: TaoDeVector6Inl.h:84
DE_MATH_API void xform(const deTransform &t, const deVector6 &v)
this = X v
Definition: TaoDeVector6Inl.h:58
DE_MATH_API void operator*=(const deFloat s)
this *= s
Definition: TaoDeVector6Inl.h:55
DE_MATH_API deFloat dot(const deVector6 &v) const
Definition: TaoDeVector6Inl.h:33