20 # include <vcl_msvc_warnings.h> 22 #include "vnl/vnl_export.h" 35 template <
class T,
unsigned int d>
38 assert(n >= 0 || d <= 4);
41 else if (n == 1 ||
m.is_identity())
47 return n%2==0 ? r * r : r * r *
m;
65 assert(
m.rows() ==
m.columns());
66 assert(n >= 0 ||
m.rows() <= 4);
69 else if (n == 1 ||
m.is_identity())
71 else if (n < 0 &&
m.rows() == 1)
73 else if (n < 0 &&
m.rows() == 2)
75 else if (n < 0 &&
m.rows() == 3)
77 else if (n < 0 &&
m.rows() == 4)
81 return n%2==0 ? r * r : r * r *
m;
85 #endif // vnl_power_h_ vnl_matrix_fixed< T, 1, 1 > vnl_inverse(vnl_matrix_fixed< T, 1, 1 > const &m)
Calculates inverse of a small vnl_matrix_fixed (not using svd).
An ordinary mathematical matrix.
Fixed size, stack-stored, space-efficient matrix.
vnl_matrix_fixed & set_identity()
Sets this matrix to an identity matrix, then returns "*this".
Calculates inverse of a small vnl_matrix_fixed (not using svd)
An ordinary mathematical matrix.
vnl_matrix_fixed< T, d, d > vnl_power(vnl_matrix_fixed< T, d, d > const &m, int n)
Calculates nth power of a vnl_matrix_fixed (not using svd).