20 #ifndef MIRTK_TransformationJacobian_H 21 #define MIRTK_TransformationJacobian_H 23 #include "mirtk/Object.h" 25 #include "mirtk/Math.h" 26 #include "mirtk/Matrix.h" 27 #include "mirtk/Vector3D.h" 28 #include "mirtk/OrderedMap.h" 49 typedef OrderedMap<int, ColumnType> SparseMatrixType;
50 typedef SparseMatrixType::iterator ColumnIterator;
51 typedef SparseMatrixType::const_iterator ConstColumnIterator;
80 ColumnIterator
Begin();
83 ConstColumnIterator
Begin()
const;
89 ConstColumnIterator
End()
const;
119 ColumnIterator
Find(
int);
122 ConstColumnIterator
Find(
int)
const;
176 return static_cast<int>(
_Columns.size());
206 ColumnIterator it =
_Columns.begin();
207 for (
int j = 0; j < i; j++) {
210 cerr <<
"TransformationJacobian::GetNonZeroColumn: Index is out of bounds: " << i << endl;
220 ConstColumnIterator it =
_Columns.begin();
221 for (
int j = 0; j < i; j++) {
224 cerr <<
"TransformationJacobian::GetNonZeroColumn: Index is out of bounds: " << i << endl;
292 for (ConstColumnIterator it = b.
Begin(); it != b.
End(); ++it) {
301 for (ColumnIterator it =
Begin(); it !=
End(); ++it) it->second *= s;
310 for (ColumnIterator it =
Begin(); it !=
End(); ++it) {
311 v.
_x = a(0, 0) * it->second._x + a(0, 1) * it->second._y + a(0, 2) * it->second._z;
312 v.
_y = a(1, 0) * it->second._x + a(1, 1) * it->second._y + a(1, 2) * it->second._z;
313 v.
_z = a(2, 0) * it->second._x + a(2, 1) * it->second._y + a(2, 2) * it->second._z;
364 for (ConstColumnIterator it = b.
Begin(); it != b.
End(); ++it) {
365 _Columns[it->first] += it->second * s;
376 for (TransformationJacobian::ConstColumnIterator it = a.
Begin(); it != a.
End(); ++it) {
377 if (
IsNaN(it->second._x) ||
IsNaN(it->second._y) ||
IsNaN(it->second._z)) {
378 cerr <<
"TransformationJacobian::has_nan: Found NaN in column " << it->first << endl;
388 #endif // MIRTK_TransformationJacobian_H
MIRTKCU_API bool IsNaN(double x)
Check if floating point value is not a number (NaN)