vnl_scatter_3x3.h
Go to the documentation of this file.
1 // This is core/vnl/algo/vnl_scatter_3x3.h
2 #ifndef vnl_scatter_3x3_h_
3 #define vnl_scatter_3x3_h_
4 //:
5 // \file
6 // \brief 3x3 scatter matrix
7 // \author Andrew W. Fitzgibbon, Oxford RRG
8 // \date 02 Oct 96
9 //
10 // \verbatim
11 // Modifications
12 // 18 Feb 2000. fsm: templated.
13 // 4/4/01 LSB (Manchester) documentation tidied
14 // Feb.2002 - Peter Vanroose - brief doxygen comment placed on single line
15 // 13 Jan.2003 - Peter Vanroose - added missing implem. for sub_outer_product
16 // \endverbatim
17 //-----------------------------------------------------------------------------
18 
19 #include <vnl/vnl_matrix_fixed.h>
20 #include <vnl/vnl_vector_fixed.h>
21 #include <vnl/algo/vnl_algo_export.h>
22 
23 template <class T>
24 class vnl_scatter_3x3 : public vnl_matrix_fixed<T,3,3>
25 {
26  public:
29 
30  //: Constructor. Fills with zeros.
32 
33  //: Add v*v' to scatter.
35 
36  //: Add v*u' to scatter.
38  const vnl_vector_fixed<T,3> & v);
39 
40  //: Subtract v*v' from scatter.
42 
43  //: Subtract v*u' from scatter.
45  const vnl_vector_fixed<T,3> & v);
46 
47  //: Replace S with $(S+S^\top)/2$.
48  void force_symmetric();
49 
50  //: Compute the eigensystem of S.
51  void compute_eigensystem();
52 
53  //: Return the eigenvector corresponding to the smallest eigenvalue.
56  return vnl_vector_fixed<T,3>(V_(0,0), V_(1,0), V_(2,0));
57  }
58 
59  //: Return the column matrix of eigenvectors, sorted in increasing order of eigenvalue.
61  {
63  return V_;
64  }
65 
66  protected:
67  bool symmetricp;
71 };
72 
73 
74 #endif // vnl_scatter_3x3_h_
vnl_matrix_fixed< T, 3, 3 > base
vnl_matrix_fixed< T, 3, 3 > & V()
Return the column matrix of eigenvectors, sorted in increasing order of eigenvalue.
void sub_outer_product(const vnl_vector_fixed< T, 3 > &v)
Subtract v*v' from scatter.
Fixed size, stack-stored, space-efficient matrix.
Definition: vnl_fwd.h:23
vnl_vector_fixed< T, 3 > D
void compute_eigensystem()
Compute the eigensystem of S.
#define v
Definition: vnl_vector.h:42
vnl_vector_fixed< T, 3 > minimum_eigenvector()
Return the eigenvector corresponding to the smallest eigenvalue.
vnl_matrix_fixed< T, 3, 3 > V_
void add_outer_product(const vnl_vector_fixed< T, 3 > &v)
Add v*v' to scatter.
void force_symmetric()
Replace S with $(S+S^\top)/2$.
fixed size matrix
Fixed length stack-stored vector.
vnl_vector_fixed< T, 3 > vect
vnl_scatter_3x3()
Constructor. Fills with zeros.