/usr/include/ITK-4.9/vnl/vnl_det.txx is in libinsighttoolkit4-dev 4.9.0-4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | // This is core/vnl/vnl_det.txx
#ifndef vnl_det_txx_
#define vnl_det_txx_
#include "vnl_det.h"
template <class T>
T vnl_det(T const *row0, T const *row1)
{
return row0[0]*row1[1] - row0[1]*row1[0];
}
template <class T>
T vnl_det(T const *row0, T const *row1, T const *row2)
{
return // the extra '+' makes it work nicely with emacs indentation.
+ row0[0]*row1[1]*row2[2]
- row0[0]*row2[1]*row1[2]
- row1[0]*row0[1]*row2[2]
+ row1[0]*row2[1]*row0[2]
+ row2[0]*row0[1]*row1[2]
- row2[0]*row1[1]*row0[2];
}
template <class T>
T vnl_det(T const *row0, T const *row1, T const *row2, T const *row3)
{
return
+ row0[0]*row1[1]*row2[2]*row3[3]
- row0[0]*row1[1]*row3[2]*row2[3]
- row0[0]*row2[1]*row1[2]*row3[3]
+ row0[0]*row2[1]*row3[2]*row1[3]
+ row0[0]*row3[1]*row1[2]*row2[3]
- row0[0]*row3[1]*row2[2]*row1[3]
- row1[0]*row0[1]*row2[2]*row3[3]
+ row1[0]*row0[1]*row3[2]*row2[3]
+ row1[0]*row2[1]*row0[2]*row3[3]
- row1[0]*row2[1]*row3[2]*row0[3]
- row1[0]*row3[1]*row0[2]*row2[3]
+ row1[0]*row3[1]*row2[2]*row0[3]
+ row2[0]*row0[1]*row1[2]*row3[3]
- row2[0]*row0[1]*row3[2]*row1[3]
- row2[0]*row1[1]*row0[2]*row3[3]
+ row2[0]*row1[1]*row3[2]*row0[3]
+ row2[0]*row3[1]*row0[2]*row1[3]
- row2[0]*row3[1]*row1[2]*row0[3]
- row3[0]*row0[1]*row1[2]*row2[3]
+ row3[0]*row0[1]*row2[2]*row1[3]
+ row3[0]*row1[1]*row0[2]*row2[3]
- row3[0]*row1[1]*row2[2]*row0[3]
- row3[0]*row2[1]*row0[2]*row1[3]
+ row3[0]*row2[1]*row1[2]*row0[3];
}
//--------------------------------------------------------------------------------
#define VNL_DET_INSTANTIATE(T) \
template T vnl_det(T const *, T const *); \
template T vnl_det(T const *, T const *, T const *); \
template T vnl_det(T const *, T const *, T const *, T const *)
#endif // vnl_det_txx_
|