Mercurial > hg > orthanc-stone
annotate Framework/Toolbox/LinearAlgebra.h @ 884:aad5ccf1be10 am-dev
cleanup
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 09 Jul 2019 14:43:00 +0200 |
parents | 6af3099ed8da |
children | 32eaf4929b08 |
rev | line source |
---|---|
158 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
439 | 5 * Copyright (C) 2017-2019 Osimis S.A., Belgium |
158 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 // Patch for ublas in Boost 1.64.0 | |
25 // https://github.com/dealii/dealii/issues/4302 | |
26 #include <boost/version.hpp> | |
27 #if BOOST_VERSION >= 106300 // or 64, need to check | |
28 # include <boost/serialization/array_wrapper.hpp> | |
29 #endif | |
30 | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
31 #include <Core/DicomFormat/DicomMap.h> |
158 | 32 |
33 #include <boost/numeric/ublas/matrix.hpp> | |
34 #include <boost/numeric/ublas/vector.hpp> | |
35 | |
36 namespace OrthancStone | |
37 { | |
38 typedef boost::numeric::ublas::matrix<double> Matrix; | |
39 typedef boost::numeric::ublas::vector<double> Vector; | |
40 | |
41 namespace LinearAlgebra | |
42 { | |
43 void Print(const Vector& v); | |
44 | |
45 void Print(const Matrix& m); | |
46 | |
47 bool ParseVector(Vector& target, | |
48 const std::string& s); | |
49 | |
50 bool ParseVector(Vector& target, | |
51 const Orthanc::DicomMap& dataset, | |
52 const Orthanc::DicomTag& tag); | |
53 | |
181 | 54 inline void AssignVector(Vector& v, |
55 double v1, | |
56 double v2) | |
57 { | |
58 v.resize(2); | |
59 v[0] = v1; | |
60 v[1] = v2; | |
61 } | |
62 | |
165
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
63 |
181 | 64 inline void AssignVector(Vector& v, |
65 double v1) | |
66 { | |
67 v.resize(1); | |
68 v[0] = v1; | |
69 } | |
70 | |
158 | 71 |
181 | 72 inline void AssignVector(Vector& v, |
73 double v1, | |
74 double v2, | |
75 double v3) | |
76 { | |
77 v.resize(3); | |
78 v[0] = v1; | |
79 v[1] = v2; | |
80 v[2] = v3; | |
81 } | |
82 | |
158 | 83 |
181 | 84 inline void AssignVector(Vector& v, |
85 double v1, | |
86 double v2, | |
87 double v3, | |
88 double v4) | |
89 { | |
90 v.resize(4); | |
91 v[0] = v1; | |
92 v[1] = v2; | |
93 v[2] = v3; | |
94 v[3] = v4; | |
95 } | |
161
197a5ddaf68c
FiniteProjectiveCamera
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
159
diff
changeset
|
96 |
181 | 97 |
98 inline Vector CreateVector(double v1) | |
99 { | |
100 Vector v; | |
101 AssignVector(v, v1); | |
102 return v; | |
103 } | |
165
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
104 |
181 | 105 |
106 inline Vector CreateVector(double v1, | |
107 double v2) | |
108 { | |
109 Vector v; | |
110 AssignVector(v, v1, v2); | |
111 return v; | |
112 } | |
165
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
113 |
181 | 114 |
115 inline Vector CreateVector(double v1, | |
116 double v2, | |
117 double v3) | |
118 { | |
119 Vector v; | |
120 AssignVector(v, v1, v2, v3); | |
121 return v; | |
122 } | |
123 | |
165
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
124 |
181 | 125 inline Vector CreateVector(double v1, |
126 double v2, | |
127 double v3, | |
128 double v4) | |
129 { | |
130 Vector v; | |
131 AssignVector(v, v1, v2, v3, v4); | |
132 return v; | |
133 } | |
134 | |
165
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
135 |
158 | 136 inline bool IsNear(double x, |
137 double y, | |
138 double threshold) | |
139 { | |
647
6af3099ed8da
uncoupling OrthancStone::SlicesSorter from OrthancStone::Slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
140 return fabs(x - y) <= threshold; |
158 | 141 } |
142 | |
181 | 143 inline bool IsNear(double x, |
144 double y) | |
145 { | |
146 // As most input is read as single-precision numbers, we take the | |
147 // epsilon machine for float32 into consideration to compare numbers | |
148 return IsNear(x, y, 10.0 * std::numeric_limits<float>::epsilon()); | |
149 } | |
158 | 150 |
151 inline bool IsCloseToZero(double x) | |
152 { | |
153 return IsNear(x, 0.0); | |
154 } | |
155 | |
156 void NormalizeVector(Vector& u); | |
157 | |
158 void CrossProduct(Vector& result, | |
159 const Vector& u, | |
160 const Vector& v); | |
161 | |
162 void FillMatrix(Matrix& target, | |
163 size_t rows, | |
164 size_t columns, | |
165 const double values[]); | |
166 | |
167 void FillVector(Vector& target, | |
168 size_t size, | |
169 const double values[]); | |
170 | |
171 void Convert(Matrix& target, | |
172 const Vector& source); | |
159
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
173 |
165
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
174 inline Matrix Transpose(const Matrix& a) |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
175 { |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
176 return boost::numeric::ublas::trans(a); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
177 } |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
178 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
179 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
180 inline Matrix IdentityMatrix(size_t size) |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
181 { |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
182 return boost::numeric::ublas::identity_matrix<double>(size); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
183 } |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
184 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
185 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
186 inline Matrix ZeroMatrix(size_t size1, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
187 size_t size2) |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
188 { |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
189 return boost::numeric::ublas::zero_matrix<double>(size1, size2); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
190 } |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
191 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
192 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
193 inline Matrix Product(const Matrix& a, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
194 const Matrix& b) |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
195 { |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
196 return boost::numeric::ublas::prod(a, b); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
197 } |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
198 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
199 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
200 inline Vector Product(const Matrix& a, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
201 const Vector& b) |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
202 { |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
203 return boost::numeric::ublas::prod(a, b); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
204 } |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
205 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
206 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
207 inline Matrix Product(const Matrix& a, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
208 const Matrix& b, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
209 const Matrix& c) |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
210 { |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
211 return Product(a, Product(b, c)); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
212 } |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
213 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
214 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
215 inline Matrix Product(const Matrix& a, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
216 const Matrix& b, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
217 const Matrix& c, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
218 const Matrix& d) |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
219 { |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
220 return Product(a, Product(b, c, d)); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
221 } |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
222 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
223 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
224 inline Matrix Product(const Matrix& a, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
225 const Matrix& b, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
226 const Matrix& c, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
227 const Matrix& d, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
228 const Matrix& e) |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
229 { |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
230 return Product(a, Product(b, c, d, e)); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
231 } |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
232 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
233 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
234 inline Vector Product(const Matrix& a, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
235 const Matrix& b, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
236 const Vector& c) |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
237 { |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
238 return Product(Product(a, b), c); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
239 } |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
240 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
241 |
166 | 242 inline Vector Product(const Matrix& a, |
243 const Matrix& b, | |
244 const Matrix& c, | |
245 const Vector& d) | |
246 { | |
247 return Product(Product(a, b, c), d); | |
248 } | |
249 | |
250 | |
159
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
251 double ComputeDeterminant(const Matrix& a); |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
252 |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
253 bool IsOrthogonalMatrix(const Matrix& q, |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
254 double threshold); |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
255 |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
256 bool IsOrthogonalMatrix(const Matrix& q); |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
257 |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
258 bool IsRotationMatrix(const Matrix& r, |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
259 double threshold); |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
260 |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
261 bool IsRotationMatrix(const Matrix& r); |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
262 |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
263 void InvertUpperTriangularMatrix(Matrix& output, |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
264 const Matrix& k); |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
265 |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
266 /** |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
267 * This function computes the RQ decomposition of a 3x3 matrix, |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
268 * using Givens rotations. Reference: Algorithm A4.1 (page 579) of |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
269 * "Multiple View Geometry in Computer Vision" (2nd edition). The |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
270 * output matrix "Q" is a rotation matrix, and "R" is upper |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
271 * triangular. |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
272 **/ |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
273 void RQDecomposition3x3(Matrix& r, |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
274 Matrix& q, |
0a73d76333db
populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
158
diff
changeset
|
275 const Matrix& a); |
163
8c5b24892ed2
LinearAlgebra::InvertMatrix
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
161
diff
changeset
|
276 |
8c5b24892ed2
LinearAlgebra::InvertMatrix
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
161
diff
changeset
|
277 void InvertMatrix(Matrix& target, |
8c5b24892ed2
LinearAlgebra::InvertMatrix
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
161
diff
changeset
|
278 const Matrix& source); |
165
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
279 |
169 | 280 // This is the same as "InvertMatrix()", but without exception |
281 bool InvertMatrixUnsafe(Matrix& target, | |
282 const Matrix& source); | |
283 | |
165
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
284 void CreateSkewSymmetric(Matrix& s, |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
285 const Vector& v); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
286 |
166 | 287 Matrix InvertScalingTranslationMatrix(const Matrix& t); |
165
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
288 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
289 bool IsShearMatrix(const Matrix& shear); |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
290 |
8d50e6be565d
LinearAlgebra toolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
291 Matrix InvertShearMatrix(const Matrix& shear); |
158 | 292 }; |
293 } |