NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
matrix_base_types.h
Go to the documentation of this file.
1 #ifndef SDK_MATRIX_BASE_TYPES_H_
11 #define SDK_MATRIX_BASE_TYPES_H_
12 
13 #if defined(__clang__) || defined(__GNUC__)
14 #pragma GCC diagnostic push
15 #pragma GCC diagnostic ignored "-Wmissing-braces"
16 #endif
17 
18 // Forward declarations
19 struct SDKMatrixF3X2;
20 struct SDKMatrixF3X3;
21 struct SDKMatrixF4X4;
22 struct SDKMatrixD3X2;
23 struct SDKMatrixD3X3;
24 struct SDKMatrixD4X4;
25 
26 typedef struct SDKMatrixF3X2 SDKMatrix3X2;
27 typedef struct SDKMatrixF3X3 SDKMatrix3X3;
28 typedef struct SDKMatrixF4X4 SDKMatrix4X4;
29 
30 
33 typedef struct SDKMatrixF3X2 {
34  union {
35  struct {
36  float _11, _12;
37  float _21, _22;
38  float _31, _32;
39  };
40  float _m[3][2]; // row-major order.
41  float _v[6];
42  };
43  #ifdef __cplusplus
44  typedef float coordinate_type;
45  //SDKMatrixF3X2& operator=(const SDKMatrixF3X2& m) noexcept;
46  SDKMatrixF3X2& operator=(const SDKMatrixD3X2& m) noexcept;
47  SDKMatrixF3X2& operator=(const SDKMatrixF3X3& m) noexcept;
48  SDKMatrixF3X2& operator=(const SDKMatrixD3X3& m) noexcept;
49  SDKMatrixF3X2& operator=(const SDKMatrixF4X4& m) noexcept;
50  SDKMatrixF3X2& operator=(const SDKMatrixD4X4& m) noexcept;
51  //operator SDKMatrixF3X2() const noexcept;
52  operator SDKMatrixD3X2() const noexcept;
53  operator SDKMatrixF3X3() const noexcept;
54  operator SDKMatrixD3X3() const noexcept;
55  operator SDKMatrixF4X4() const noexcept;
56  operator SDKMatrixD4X4() const noexcept;
57  #endif
59 
62 typedef struct SDKMatrixF3X3 {
63  union {
64  struct {
65  float _11, _12, _13;
66  float _21, _22, _23;
67  float _31, _32, _33;
68  };
69  float _m[3][3]; // row-major order.
70  float _v[9];
71  };
72  #ifdef __cplusplus
73  typedef float coordinate_type;
74  SDKMatrixF3X3& operator=(const SDKMatrixF3X2& m) noexcept;
75  SDKMatrixF3X3& operator=(const SDKMatrixD3X2& m) noexcept;
76  //SDKMatrixF3X3& operator=(const SDKMatrixF3X3& m) noexcept;
77  SDKMatrixF3X3& operator=(const SDKMatrixD3X3& m) noexcept;
78  SDKMatrixF3X3& operator=(const SDKMatrixF4X4& m) noexcept;
79  SDKMatrixF3X3& operator=(const SDKMatrixD4X4& m) noexcept;
80  operator SDKMatrixF3X2() const noexcept;
81  operator SDKMatrixD3X2() const noexcept;
82  //operator SDKMatrixF3X3() const noexcept;
83  operator SDKMatrixD3X3() const noexcept;
84  operator SDKMatrixF4X4() const noexcept;
85  operator SDKMatrixD4X4() const noexcept;
86  #endif
88 
91 typedef struct SDKMatrixF4X4 {
92  union {
93  struct {
94  float _11, _12, _13, _14;
95  float _21, _22, _23, _24;
96  float _31, _32, _33, _34;
97  float _41, _42, _43, _44;
98  };
99  float _m[4][4]; // row-major order.
100  float _v[16];
101  };
102  #ifdef __cplusplus
103  typedef float coordinate_type;
104  SDKMatrixF4X4& operator=(const SDKMatrixF3X2& m) noexcept;
105  SDKMatrixF4X4& operator=(const SDKMatrixD3X2& m) noexcept;
106  SDKMatrixF4X4& operator=(const SDKMatrixF3X3& m) noexcept;
107  SDKMatrixF4X4& operator=(const SDKMatrixD3X3& m) noexcept;
108  //SDKMatrixF4X4& operator=(const SDKMatrixF4X4& m) noexcept;
109  SDKMatrixF4X4& operator=(const SDKMatrixD4X4& m) noexcept;
110  operator SDKMatrixF3X2() const noexcept;
111  operator SDKMatrixD3X2() const noexcept;
112  operator SDKMatrixF3X3() const noexcept;
113  operator SDKMatrixD3X3() const noexcept;
114  //operator SDKMatrixF4X4() const noexcept;
115  operator SDKMatrixD4X4() const noexcept;
116  #endif
117 } SDKMatrixF4X4;
118 
120 typedef struct SDKMatrixD3X2 {
121  union {
122  struct {
123  double _11, _12;
124  double _21, _22;
125  double _31, _32;
126  };
127  double _m[3][2]; // row-major order.
128  double _v[6];
129  };
130  #ifdef __cplusplus
131  typedef double coordinate_type;
132  SDKMatrixD3X2& operator=(const SDKMatrixF3X2& m) noexcept;
133  //SDKMatrixD3X2& operator=(const SDKMatrixD3X2& m) noexcept;
134  SDKMatrixD3X2& operator=(const SDKMatrixF3X3& m) noexcept;
135  SDKMatrixD3X2& operator=(const SDKMatrixD3X3& m) noexcept;
136  SDKMatrixD3X2& operator=(const SDKMatrixF4X4& m) noexcept;
137  SDKMatrixD3X2& operator=(const SDKMatrixD4X4& m) noexcept;
138  operator SDKMatrixF3X2() const noexcept;
139  //operator SDKMatrixD3X2() const noexcept;
140  operator SDKMatrixF3X3() const noexcept;
141  operator SDKMatrixD3X3() const noexcept;
142  operator SDKMatrixF4X4() const noexcept;
143  operator SDKMatrixD4X4() const noexcept;
144  #endif
145 } SDKMatrixD3X2;
146 
149 typedef struct SDKMatrixD3X3 {
150  union {
151  struct {
152  double _11, _12, _13;
153  double _21, _22, _23;
154  double _31, _32, _33;
155  };
156  double _m[3][3]; // row-major order.
157  double _v[9];
158  };
159  #ifdef __cplusplus
160  typedef double coordinate_type;
161  SDKMatrixD3X3& operator=(const SDKMatrixF3X2& m) noexcept;
162  SDKMatrixD3X3& operator=(const SDKMatrixD3X2& m) noexcept;
163  SDKMatrixD3X3& operator=(const SDKMatrixF3X3& m) noexcept;
164  //SDKMatrixD3X3& operator=(const SDKMatrixD3X3& m) noexcept;
165  SDKMatrixD3X3& operator=(const SDKMatrixF4X4& m) noexcept;
166  SDKMatrixD3X3& operator=(const SDKMatrixD4X4& m) noexcept;
167  operator SDKMatrixF3X2() const noexcept;
168  operator SDKMatrixD3X2() const noexcept;
169  operator SDKMatrixF3X3() const noexcept;
170  //operator SDKMatrixD3X3() const noexcept;
171  operator SDKMatrixF4X4() const noexcept;
172  operator SDKMatrixD4X4() const noexcept;
173  #endif
174 } SDKMatrixD3X3;
175 
178 typedef struct SDKMatrixD4X4 {
179  union {
180  struct {
181  double _11, _12, _13, _14;
182  double _21, _22, _23, _24;
183  double _31, _32, _33, _34;
184  double _41, _42, _43, _44;
185  };
186  double _m[4][4]; // row-major order.
187  double _v[16];
188  };
189  #ifdef __cplusplus
190  typedef double coordinate_type;
191  SDKMatrixD4X4& operator=(const SDKMatrixF3X2& m) noexcept;
192  SDKMatrixD4X4& operator=(const SDKMatrixD3X2& m) noexcept;
193  SDKMatrixD4X4& operator=(const SDKMatrixF3X3& m) noexcept;
194  SDKMatrixD4X4& operator=(const SDKMatrixD3X3& m) noexcept;
195  SDKMatrixD4X4& operator=(const SDKMatrixF4X4& m) noexcept;
196  //SDKMatrixD4X4& operator=(const SDKMatrixD4X4& m) noexcept;
197  operator SDKMatrixF3X2() const noexcept;
198  operator SDKMatrixD3X2() const noexcept;
199  operator SDKMatrixF3X3() const noexcept;
200  operator SDKMatrixD3X3() const noexcept;
201  operator SDKMatrixF4X4() const noexcept;
202  //operator SDKMatrixD4X4() const noexcept;
203  #endif
204 } SDKMatrixD4X4;
205 
206 #ifdef __cplusplus
207 #if 1 || SDKMatrixF3X2
208 inline SDKMatrixF3X2& SDKMatrixF3X2::operator=(const SDKMatrixD3X2& m) noexcept {
209  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
210  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
211  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
212  return *this;
213 }
214 inline SDKMatrixF3X2& SDKMatrixF3X2::operator=(const SDKMatrixF3X3& m) noexcept {
215  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
216  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
217  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
218  return *this;
219 }
220 inline SDKMatrixF3X2& SDKMatrixF3X2::operator=(const SDKMatrixD3X3& m) noexcept {
221  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
222  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
223  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
224  return *this;
225 }
226 inline SDKMatrixF3X2& SDKMatrixF3X2::operator=(const SDKMatrixF4X4& m) noexcept {
227  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
228  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
229  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
230  return *this;
231 }
232 inline SDKMatrixF3X2& SDKMatrixF3X2::operator=(const SDKMatrixD4X4& m) noexcept {
233  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
234  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
235  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
236  return *this;
237 }
238 //inline SDKMatrixF3X2::operator SDKMatrixF3X2() const noexcept {
239 // typedef SDKMatrixF3X2 M;
240 // M m = {
241 // M::coordinate_type(this->_11), M::coordinate_type(this->_12),
242 // M::coordinate_type(this->_21), M::coordinate_type(this->_22),
243 // M::coordinate_type(this->_31), M::coordinate_type(this->_32),
244 // };
245 // return m;
246 //}
247 inline SDKMatrixF3X2::operator SDKMatrixD3X2() const noexcept {
248  typedef SDKMatrixD3X2 M;
249  M m = {
250  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
251  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
252  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
253  };
254  return m;
255 }
256 inline SDKMatrixF3X2::operator SDKMatrixF3X3() const noexcept {
257  typedef SDKMatrixF3X3 M;
258  M m = {
259  M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0,
260  M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0,
261  M::coordinate_type(this->_31), M::coordinate_type(this->_32), 1,
262  };
263  return m;
264 }
265 inline SDKMatrixF3X2::operator SDKMatrixD3X3() const noexcept {
266  typedef SDKMatrixD3X3 M;
267  M m = {
268  M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0,
269  M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0,
270  M::coordinate_type(this->_31), M::coordinate_type(this->_32), 1,
271  };
272  return m;
273 }
274 inline SDKMatrixF3X2::operator SDKMatrixF4X4() const noexcept {
275  typedef SDKMatrixF4X4 M;
276  M m = {
277  M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0, 0,
278  M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0, 0,
279  M::coordinate_type(this->_31), M::coordinate_type(this->_32), 0, 0,
280  0, 0, 0, 1,
281  };
282  return m;
283 }
284 inline SDKMatrixF3X2::operator SDKMatrixD4X4() const noexcept {
285  typedef SDKMatrixD4X4 M;
286  M m = {
287  M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0, 0,
288  M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0, 0,
289  M::coordinate_type(this->_31), M::coordinate_type(this->_32), 0, 0,
290  0, 0, 0, 1,
291  };
292  return m;
293 }
294 #endif
295 
296 #if 1 || SDKMatrixF3X3
297 inline SDKMatrixF3X3& SDKMatrixF3X3::operator=(const SDKMatrixF3X2& m) noexcept {
298  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0;
299  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0;
300  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1;
301  return *this;
302 }
303 inline SDKMatrixF3X3& SDKMatrixF3X3::operator=(const SDKMatrixD3X2& m) noexcept {
304  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0;
305  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0;
306  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1;
307  return *this;
308 }
309 inline SDKMatrixF3X3& SDKMatrixF3X3::operator=(const SDKMatrixD3X3& m) noexcept {
310  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
311  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
312  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
313  return *this;
314 }
315 inline SDKMatrixF3X3& SDKMatrixF3X3::operator=(const SDKMatrixF4X4& m) noexcept {
316  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
317  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
318  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
319  return *this;
320 }
321 inline SDKMatrixF3X3& SDKMatrixF3X3::operator=(const SDKMatrixD4X4& m) noexcept {
322  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
323  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
324  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
325  return *this;
326 }
327 inline SDKMatrixF3X3::operator SDKMatrixF3X2() const noexcept {
328  typedef SDKMatrixF3X2 M;
329  M m = {
330  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
331  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
332  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
333  };
334  return m;
335 }
336 inline SDKMatrixF3X3::operator SDKMatrixD3X2() const noexcept {
337  typedef SDKMatrixD3X2 M;
338  M m = {
339  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
340  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
341  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
342  };
343  return m;
344 }
345 //inline SDKMatrixF3X3::operator SDKMatrixF3X3() const noexcept {
346 // typedef SDKMatrixF3X3 M;
347 // M m = {
348 // M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
349 // M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
350 // M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
351 // };
352 // return m;
353 //}
354 inline SDKMatrixF3X3::operator SDKMatrixD3X3() const noexcept {
355  typedef SDKMatrixD3X3 M;
356  M m = {
357  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
358  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
359  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
360  };
361  return m;
362 }
363 inline SDKMatrixF3X3::operator SDKMatrixF4X4() const noexcept {
364  typedef SDKMatrixF4X4 M;
365  M m = {
366  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), 0,
367  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), 0,
368  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), 0,
369  0, 0, 0, 1,
370  };
371  return m;
372 }
373 inline SDKMatrixF3X3::operator SDKMatrixD4X4() const noexcept {
374  typedef SDKMatrixD4X4 M;
375  M m = {
376  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), 0,
377  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), 0,
378  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), 0,
379  0, 0, 0, 1,
380  };
381  return m;
382 }
383 #endif
384 
385 #if 1 || SDKMatrixF4X4
386 inline SDKMatrixF4X4& SDKMatrixF4X4::operator=(const SDKMatrixF3X2& m) noexcept {
387  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0, this->_14 = 0;
388  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0, this->_24 = 0;
389  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1, this->_34 = 0;
390  this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
391  return *this;
392 }
393 inline SDKMatrixF4X4& SDKMatrixF4X4::operator=(const SDKMatrixD3X2& m) noexcept {
394  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0, this->_14 = 0;
395  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0, this->_24 = 0;
396  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1, this->_34 = 0;
397  this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
398  return *this;
399 }
400 inline SDKMatrixF4X4& SDKMatrixF4X4::operator=(const SDKMatrixF3X3& m) noexcept {
401  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13), this->_14 = 0;
402  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23), this->_24 = 0;
403  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33), this->_34 = 0;
404  this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
405  return *this;
406 }
407 inline SDKMatrixF4X4& SDKMatrixF4X4::operator=(const SDKMatrixD3X3& m) noexcept {
408  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13), this->_14 = 0;
409  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23), this->_24 = 0;
410  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33), this->_34 = 0;
411  this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
412  return *this;
413 }
414 inline SDKMatrixF4X4& SDKMatrixF4X4::operator=(const SDKMatrixD4X4& m) noexcept {
415  for (int row = 0; row < 4; ++row) {
416  this->_m[row][0] = coordinate_type(m._m[row][0]);
417  this->_m[row][1] = coordinate_type(m._m[row][1]);
418  this->_m[row][2] = coordinate_type(m._m[row][2]);
419  this->_m[row][3] = coordinate_type(m._m[row][3]);
420  }
421  return *this;
422 }
423 inline SDKMatrixF4X4::operator SDKMatrixF3X2() const noexcept {
424  typedef SDKMatrixF3X2 M;
425  M m = {
426  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
427  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
428  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
429  };
430  return m;
431 }
432 inline SDKMatrixF4X4::operator SDKMatrixD3X2() const noexcept {
433  typedef SDKMatrixD3X2 M;
434  M m = {
435  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
436  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
437  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
438  };
439  return m;
440 }
441 inline SDKMatrixF4X4::operator SDKMatrixF3X3() const noexcept {
442  typedef SDKMatrixF3X3 M;
443  M m = {
444  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
445  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
446  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
447  };
448  return m;
449 }
450 inline SDKMatrixF4X4::operator SDKMatrixD3X3() const noexcept {
451  typedef SDKMatrixD3X3 M;
452  M m = {
453  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
454  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
455  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
456  };
457  return m;
458 }
459 //inline SDKMatrixF4X4::operator SDKMatrixF4X4() const noexcept {
460 // typedef SDKMatrixF4X4 M;
461 // M m = {
462 // M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), M::coordinate_type(this->_14),
463 // M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), M::coordinate_type(this->_24),
464 // M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), M::coordinate_type(this->_34),
465 // M::coordinate_type(this->_41), M::coordinate_type(this->_42), M::coordinate_type(this->_43), M::coordinate_type(this->_44),
466 // };
467 // return m;
468 //}
469 inline SDKMatrixF4X4::operator SDKMatrixD4X4() const noexcept {
470  typedef SDKMatrixD4X4 M;
471  M m = {
472  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), M::coordinate_type(this->_14),
473  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), M::coordinate_type(this->_24),
474  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), M::coordinate_type(this->_34),
475  M::coordinate_type(this->_41), M::coordinate_type(this->_42), M::coordinate_type(this->_43), M::coordinate_type(this->_44),
476  };
477  return m;
478 }
479 #endif
480 
481 #if 1 || SDKMatrixD3X2
482 inline SDKMatrixD3X2& SDKMatrixD3X2::operator=(const SDKMatrixF3X2& m) noexcept {
483  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
484  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
485  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
486  return *this;
487 }
488 inline SDKMatrixD3X2& SDKMatrixD3X2::operator=(const SDKMatrixF3X3& m) noexcept {
489  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
490  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
491  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
492  return *this;
493 }
494 inline SDKMatrixD3X2& SDKMatrixD3X2::operator=(const SDKMatrixD3X3& m) noexcept {
495  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
496  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
497  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
498  return *this;
499 }
500 inline SDKMatrixD3X2& SDKMatrixD3X2::operator=(const SDKMatrixF4X4& m) noexcept {
501  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
502  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
503  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
504  return *this;
505 }
506 inline SDKMatrixD3X2& SDKMatrixD3X2::operator=(const SDKMatrixD4X4& m) noexcept {
507  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
508  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
509  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
510  return *this;
511 }
512 inline SDKMatrixD3X2::operator SDKMatrixF3X2() const noexcept {
513  typedef SDKMatrixF3X2 M;
514  M m = {
515  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
516  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
517  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
518  };
519  return m;
520 }
521 //inline SDKMatrixD3X2::operator SDKMatrixD3X2() const noexcept {
522 // typedef SDKMatrixD3X2 M;
523 // M m = {
524 // M::coordinate_type(this->_11), M::coordinate_type(this->_12),
525 // M::coordinate_type(this->_21), M::coordinate_type(this->_22),
526 // M::coordinate_type(this->_31), M::coordinate_type(this->_32),
527 // };
528 // return m;
529 //}
530 inline SDKMatrixD3X2::operator SDKMatrixF3X3() const noexcept {
531  typedef SDKMatrixF3X3 M;
532  M m = {
533  M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0,
534  M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0,
535  M::coordinate_type(this->_31), M::coordinate_type(this->_32), 1,
536  };
537  return m;
538 }
539 inline SDKMatrixD3X2::operator SDKMatrixD3X3() const noexcept {
540  typedef SDKMatrixD3X3 M;
541  M m = {
542  M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0,
543  M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0,
544  M::coordinate_type(this->_31), M::coordinate_type(this->_32), 1,
545  };
546  return m;
547 }
548 inline SDKMatrixD3X2::operator SDKMatrixF4X4() const noexcept {
549  typedef SDKMatrixF4X4 M;
550  M m = {
551  M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0, 0,
552  M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0, 0,
553  M::coordinate_type(this->_31), M::coordinate_type(this->_32), 0, 0,
554  0, 0, 0, 1,
555  };
556  return m;
557 }
558 inline SDKMatrixD3X2::operator SDKMatrixD4X4() const noexcept {
559  typedef SDKMatrixD4X4 M;
560  M m = {
561  M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0, 0,
562  M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0, 0,
563  M::coordinate_type(this->_31), M::coordinate_type(this->_32), 0, 0,
564  0, 0, 0, 1,
565  };
566  return m;
567 }
568 #endif
569 
570 #if 1 || SDKMatrixD3X3
571 inline SDKMatrixD3X3& SDKMatrixD3X3::operator=(const SDKMatrixF3X2& m) noexcept {
572  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0;
573  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0;
574  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1;
575  return *this;
576 }
577 inline SDKMatrixD3X3& SDKMatrixD3X3::operator=(const SDKMatrixD3X2& m) noexcept {
578  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0;
579  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0;
580  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1;
581  return *this;
582 }
583 inline SDKMatrixD3X3& SDKMatrixD3X3::operator=(const SDKMatrixF3X3& m) noexcept {
584  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
585  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
586  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
587  return *this;
588 }
589 inline SDKMatrixD3X3& SDKMatrixD3X3::operator=(const SDKMatrixF4X4& m) noexcept {
590  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
591  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
592  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
593  return *this;
594 }
595 inline SDKMatrixD3X3& SDKMatrixD3X3::operator=(const SDKMatrixD4X4& m) noexcept {
596  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
597  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
598  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
599  return *this;
600 }
601 inline SDKMatrixD3X3::operator SDKMatrixF3X2() const noexcept {
602  typedef SDKMatrixF3X2 M;
603  M m = {
604  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
605  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
606  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
607  };
608  return m;
609 }
610 inline SDKMatrixD3X3::operator SDKMatrixD3X2() const noexcept {
611  typedef SDKMatrixD3X2 M;
612  M m = {
613  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
614  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
615  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
616  };
617  return m;
618 }
619 inline SDKMatrixD3X3::operator SDKMatrixF3X3() const noexcept {
620  typedef SDKMatrixF3X3 M;
621  M m = {
622  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
623  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
624  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
625  };
626  return m;
627 }
628 //inline SDKMatrixD3X3::operator SDKMatrixD3X3() const noexcept {
629 // typedef SDKMatrixD3X3 M;
630 // M m = {
631 // M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
632 // M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
633 // M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
634 // };
635 // return m;
636 //}
637 inline SDKMatrixD3X3::operator SDKMatrixF4X4() const noexcept {
638  typedef SDKMatrixF4X4 M;
639  M m = {
640  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), 0,
641  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), 0,
642  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), 0,
643  0, 0, 0, 1,
644  };
645  return m;
646 }
647 inline SDKMatrixD3X3::operator SDKMatrixD4X4() const noexcept {
648  typedef SDKMatrixD4X4 M;
649  M m = {
650  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), 0,
651  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), 0,
652  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), 0,
653  0, 0, 0, 1,
654  };
655  return m;
656 }
657 #endif
658 
659 #if 1 || SDKMatrixD4X4
660 inline SDKMatrixD4X4& SDKMatrixD4X4::operator=(const SDKMatrixF3X2& m) noexcept {
661  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0, this->_14 = 0;
662  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0, this->_24 = 0;
663  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1, this->_34 = 0;
664  this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
665  return *this;
666 }
667 inline SDKMatrixD4X4& SDKMatrixD4X4::operator=(const SDKMatrixD3X2& m) noexcept {
668  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0, this->_14 = 0;
669  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0, this->_24 = 0;
670  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1, this->_34 = 0;
671  this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
672  return *this;
673 }
674 inline SDKMatrixD4X4& SDKMatrixD4X4::operator=(const SDKMatrixF3X3& m) noexcept {
675  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13), this->_14 = 0;
676  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23), this->_24 = 0;
677  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33), this->_34 = 0;
678  this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
679  return *this;
680 }
681 inline SDKMatrixD4X4& SDKMatrixD4X4::operator=(const SDKMatrixD3X3& m) noexcept {
682  this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13), this->_14 = 0;
683  this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23), this->_24 = 0;
684  this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33), this->_34 = 0;
685  this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
686  return *this;
687 }
688 inline SDKMatrixD4X4& SDKMatrixD4X4::operator=(const SDKMatrixF4X4& m) noexcept {
689  for (int row = 0; row < 4; ++row) {
690  this->_m[row][0] = coordinate_type(m._m[row][0]);
691  this->_m[row][1] = coordinate_type(m._m[row][1]);
692  this->_m[row][2] = coordinate_type(m._m[row][2]);
693  this->_m[row][3] = coordinate_type(m._m[row][3]);
694  }
695  return *this;
696 }
697 inline SDKMatrixD4X4::operator SDKMatrixF3X2() const noexcept {
698  typedef SDKMatrixF3X2 M;
699  M m = {
700  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
701  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
702  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
703  };
704  return m;
705 }
706 inline SDKMatrixD4X4::operator SDKMatrixD3X2() const noexcept {
707  typedef SDKMatrixD3X2 M;
708  M m = {
709  M::coordinate_type(this->_11), M::coordinate_type(this->_12),
710  M::coordinate_type(this->_21), M::coordinate_type(this->_22),
711  M::coordinate_type(this->_31), M::coordinate_type(this->_32),
712  };
713  return m;
714 }
715 inline SDKMatrixD4X4::operator SDKMatrixF3X3() const noexcept {
716  typedef SDKMatrixF3X3 M;
717  M m = {
718  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
719  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
720  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
721  };
722  return m;
723 }
724 inline SDKMatrixD4X4::operator SDKMatrixD3X3() const noexcept {
725  typedef SDKMatrixD3X3 M;
726  M m = {
727  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
728  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
729  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
730  };
731  return m;
732 }
733 inline SDKMatrixD4X4::operator SDKMatrixF4X4() const noexcept {
734  typedef SDKMatrixF4X4 M;
735  M m = {
736  M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), M::coordinate_type(this->_14),
737  M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), M::coordinate_type(this->_24),
738  M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), M::coordinate_type(this->_34),
739  M::coordinate_type(this->_41), M::coordinate_type(this->_42), M::coordinate_type(this->_43), M::coordinate_type(this->_44),
740  };
741  return m;
742 }
743 //inline SDKMatrixD4X4::operator SDKMatrixD4X4() const noexcept {
744 // typedef SDKMatrixD4X4 M;
745 // M m = {
746 // M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), M::coordinate_type(this->_14),
747 // M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), M::coordinate_type(this->_24),
748 // M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), M::coordinate_type(this->_34),
749 // M::coordinate_type(this->_41), M::coordinate_type(this->_42), M::coordinate_type(this->_43), M::coordinate_type(this->_44),
750 // };
751 // return m;
752 //}
753 #endif
754 
755 inline bool operator==(const SDKMatrixF3X2& lhs, const SDKMatrixF3X2& rhs) noexcept
756 {
757  return true
758  && lhs._11 == rhs._11 && lhs._12 == rhs._12
759  && lhs._21 == rhs._21 && lhs._22 == rhs._22
760  && lhs._31 == rhs._31 && lhs._32 == rhs._32;
761 }
762 inline bool operator!=(const SDKMatrixF3X2& lhs, const SDKMatrixF3X2& rhs) noexcept
763 {
764  return !(lhs == rhs);
765 }
766 inline bool operator==(const SDKMatrixF3X3& lhs, const SDKMatrixF3X3& rhs) noexcept
767 {
768  return true
769  && lhs._11 == rhs._11 && lhs._12 == rhs._12 && lhs._13 == rhs._13
770  && lhs._21 == rhs._21 && lhs._22 == rhs._22 && lhs._23 == rhs._23
771  && lhs._31 == rhs._31 && lhs._32 == rhs._32 && lhs._33 == rhs._33;
772 }
773 inline bool operator!=(const SDKMatrixF3X3& lhs, const SDKMatrixF3X3& rhs) noexcept
774 {
775  return !(lhs == rhs);
776 }
777 inline bool operator==(const SDKMatrixF4X4& lhs, const SDKMatrixF4X4& rhs) noexcept
778 {
779  for (int j = 0; j < 4; ++j)
780  {
781  for (int i = 0; i < 4; ++i)
782  {
783  if (lhs._m[j][i] != rhs._m[j][i])
784  return false;
785  }
786  }
787  return true;
788 }
789 inline bool operator!=(const SDKMatrixF4X4& lhs, const SDKMatrixF4X4& rhs) noexcept
790 {
791  return !(lhs == rhs);
792 }
793 inline bool operator==(const SDKMatrixD3X2& lhs, const SDKMatrixD3X2& rhs) noexcept
794 {
795  return true
796  && lhs._11 == rhs._11 && lhs._12 == rhs._12
797  && lhs._21 == rhs._21 && lhs._22 == rhs._22
798  && lhs._31 == rhs._31 && lhs._32 == rhs._32;
799 }
800 inline bool operator!=(const SDKMatrixD3X2& lhs, const SDKMatrixD3X2& rhs) noexcept
801 {
802  return !(lhs == rhs);
803 }
804 inline bool operator==(const SDKMatrixD3X3& lhs, const SDKMatrixD3X3& rhs) noexcept
805 {
806  return true
807  && lhs._11 == rhs._11 && lhs._12 == rhs._12 && lhs._13 == rhs._13
808  && lhs._21 == rhs._21 && lhs._22 == rhs._22 && lhs._23 == rhs._23
809  && lhs._31 == rhs._31 && lhs._32 == rhs._32 && lhs._33 == rhs._33;
810 }
811 inline bool operator!=(const SDKMatrixD3X3& lhs, const SDKMatrixD3X3& rhs) noexcept
812 {
813  return !(lhs == rhs);
814 }
815 inline bool operator==(const SDKMatrixD4X4& lhs, const SDKMatrixD4X4& rhs) noexcept
816 {
817  for (int j = 0; j < 4; ++j)
818  {
819  for (int i = 0; i < 4; ++i)
820  {
821  if (lhs._m[j][i] != rhs._m[j][i])
822  return false;
823  }
824  }
825  return true;
826 }
827 inline bool operator!=(const SDKMatrixD4X4& lhs, const SDKMatrixD4X4& rhs) noexcept
828 {
829  return !(lhs == rhs);
830 }
831 
832 template <class _Matrix3X3>
833 _Matrix3X3 Matrix3X3MultiplyHelper(const _Matrix3X3& lhs, const _Matrix3X3& rhs)
834 {
835  _Matrix3X3 res;
836  typedef typename _Matrix3X3::coordinate_type coordinate_type;
837  res._11 = coordinate_type(double(lhs._11) * rhs._11 + double(lhs._12) * rhs._21 + double(lhs._13) * rhs._31);
838  res._12 = coordinate_type(double(lhs._11) * rhs._12 + double(lhs._12) * rhs._22 + double(lhs._13) * rhs._32);
839  res._13 = coordinate_type(double(lhs._11) * rhs._13 + double(lhs._12) * rhs._23 + double(lhs._13) * rhs._33);
840 
841  res._21 = coordinate_type(double(lhs._21) * rhs._11 + double(lhs._22) * rhs._21 + double(lhs._23) * rhs._31);
842  res._22 = coordinate_type(double(lhs._21) * rhs._12 + double(lhs._22) * rhs._22 + double(lhs._23) * rhs._32);
843  res._23 = coordinate_type(double(lhs._21) * rhs._13 + double(lhs._22) * rhs._23 + double(lhs._23) * rhs._33);
844 
845  res._31 = coordinate_type(double(lhs._31) * rhs._11 + double(lhs._32) * rhs._21 + double(lhs._33) * rhs._31);
846  res._32 = coordinate_type(double(lhs._31) * rhs._12 + double(lhs._32) * rhs._22 + double(lhs._33) * rhs._32);
847  res._33 = coordinate_type(double(lhs._31) * rhs._13 + double(lhs._32) * rhs._23 + double(lhs._33) * rhs._33);
848  return res;
849 }
850 
851 inline SDKMatrixF3X3 operator*(const SDKMatrixF3X3& lhs, const SDKMatrixF3X3& rhs)
852 {
853  return Matrix3X3MultiplyHelper(lhs, rhs);
854 }
855 
856 inline SDKMatrixD3X3 operator*(const SDKMatrixD3X3& lhs, const SDKMatrixD3X3& rhs)
857 {
858  return Matrix3X3MultiplyHelper(lhs, rhs);
859 }
860 
861 inline SDKMatrixD3X3 operator*(const SDKMatrixF3X3& lhs, const SDKMatrixD3X3& rhs)
862 {
863  SDKMatrixD3X3 _lhs; _lhs = lhs;
864  return _lhs * rhs;
865 }
866 
867 inline SDKMatrixD3X3 operator*(const SDKMatrixD3X3& lhs, const SDKMatrixF3X3& rhs)
868 {
869  SDKMatrixD3X3 _rhs; _rhs = rhs;
870  return lhs * _rhs;
871 }
872 
873 template <class _Matrix4X4>
874 _Matrix4X4 Matrix4X4MultiplyHelper(const _Matrix4X4& lhs, const _Matrix4X4& rhs)
875 {
876  _Matrix4X4 res;
877  typedef typename _Matrix4X4::coordinate_type coordinate_type;
878  res._11 = coordinate_type(
879  double(lhs._11) * rhs._11 + double(lhs._12) * rhs._21 + double(lhs._13) * rhs._31 + double(lhs._14) * rhs._41);
880  res._21 = coordinate_type(
881  double(lhs._21) * rhs._11 + double(lhs._22) * rhs._21 + double(lhs._23) * rhs._31 + double(lhs._24) * rhs._41);
882  res._31 = coordinate_type(
883  double(lhs._31) * rhs._11 + double(lhs._32) * rhs._21 + double(lhs._33) * rhs._31 + double(lhs._34) * rhs._41);
884  res._41 = coordinate_type(
885  double(lhs._41) * rhs._11 + double(lhs._42) * rhs._21 + double(lhs._43) * rhs._31 + double(lhs._44) * rhs._41);
886  res._12 = coordinate_type(
887  double(lhs._11) * rhs._12 + double(lhs._12) * rhs._22 + double(lhs._13) * rhs._32 + double(lhs._14) * rhs._42);
888  res._22 = coordinate_type(
889  double(lhs._21) * rhs._12 + double(lhs._22) * rhs._22 + double(lhs._23) * rhs._32 + double(lhs._24) * rhs._42);
890  res._32 = coordinate_type(
891  double(lhs._31) * rhs._12 + double(lhs._32) * rhs._22 + double(lhs._33) * rhs._32 + double(lhs._34) * rhs._42);
892  res._42 = coordinate_type(
893  double(lhs._41) * rhs._12 + double(lhs._42) * rhs._22 + double(lhs._43) * rhs._32 + double(lhs._44) * rhs._42);
894  res._13 = coordinate_type(
895  double(lhs._11) * rhs._13 + double(lhs._12) * rhs._23 + double(lhs._13) * rhs._33 + double(lhs._14) * rhs._43);
896  res._23 = coordinate_type(
897  double(lhs._21) * rhs._13 + double(lhs._22) * rhs._23 + double(lhs._23) * rhs._33 + double(lhs._24) * rhs._43);
898  res._33 = coordinate_type(
899  double(lhs._31) * rhs._13 + double(lhs._32) * rhs._23 + double(lhs._33) * rhs._33 + double(lhs._34) * rhs._43);
900  res._43 = coordinate_type(
901  double(lhs._41) * rhs._13 + double(lhs._42) * rhs._23 + double(lhs._43) * rhs._33 + double(lhs._44) * rhs._43);
902  res._14 = coordinate_type(
903  double(lhs._11) * rhs._14 + double(lhs._12) * rhs._24 + double(lhs._13) * rhs._34 + double(lhs._14) * rhs._44);
904  res._24 = coordinate_type(
905  double(lhs._21) * rhs._14 + double(lhs._22) * rhs._24 + double(lhs._23) * rhs._34 + double(lhs._24) * rhs._44);
906  res._34 = coordinate_type(
907  double(lhs._31) * rhs._14 + double(lhs._32) * rhs._24 + double(lhs._33) * rhs._34 + double(lhs._34) * rhs._44);
908  res._44 = coordinate_type(
909  double(lhs._41) * rhs._14 + double(lhs._42) * rhs._24 + double(lhs._43) * rhs._34 + double(lhs._44) * rhs._44);
910  return res;
911 }
912 
913 inline SDKMatrixF4X4 operator*(const SDKMatrixF4X4& lhs, const SDKMatrixF4X4& rhs)
914 {
915  return Matrix4X4MultiplyHelper(lhs, rhs);
916 }
917 
918 inline SDKMatrixD4X4 operator*(const SDKMatrixD4X4& lhs, const SDKMatrixD4X4& rhs)
919 {
920  return Matrix4X4MultiplyHelper(lhs, rhs);
921 }
922 
923 inline SDKMatrixD4X4 operator*(const SDKMatrixF4X4& lhs, const SDKMatrixD4X4& rhs)
924 {
925  SDKMatrixD4X4 _lhs; _lhs = lhs;
926  return _lhs * rhs;
927 }
928 
929 inline SDKMatrixD4X4 operator*(const SDKMatrixD4X4& lhs, const SDKMatrixF4X4& rhs)
930 {
931  SDKMatrixD4X4 _rhs; _rhs = rhs;
932  return lhs * _rhs;
933 }
934 
935 namespace sdk {
936 inline double min4dbl(double d1, double d2, double d3, double d4) {
937  double min1 = (d1 < d2) ? d1 : d2;
938  double min2 = (d3 < d4) ? d3 : d4;
939  return (min1 < min2) ? min1 : min2;
940 }
941 
942 inline double max4dbl(double d1, double d2, double d3, double d4) {
943  double max1 = (d1 > d2) ? d1 : d2;
944  double max2 = (d3 > d4) ? d3 : d4;
945  return (max1 > max2) ? max1 : max2;
946 }
947 }
948 #endif
949 
950 #if defined(__clang__) || defined(__GNUC__)
951 #pragma GCC diagnostic pop
952 #endif
953 
954 #endif // SDK_MATRIX_BASE_TYPES_H_
SDKMatrixD3X2
Matrix 3x2.
Definition: matrix_base_types.h:120
SDKMatrixF3X3
Matrix 3X3.
Definition: matrix_base_types.h:62
SDKMatrixD3X3
Matrix 3X3.
Definition: matrix_base_types.h:149
SDKMatrixF4X4
Matrix 4X4.
Definition: matrix_base_types.h:91
SDKMatrixF3X2
Matrix 3x2.
Definition: matrix_base_types.h:33
SDKMatrixD4X4
Matrix 4X4.
Definition: matrix_base_types.h:178