Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

vnl_scatter_3x3.h

Go to the documentation of this file.
00001 #ifndef vnl_scatter_3x3_h_
00002 #define vnl_scatter_3x3_h_
00003 //:
00004 //  \file 
00005 //  \brief 
00006 //  \author Andrew W. Fitzgibbon, Oxford RRG, 02 Oct 96
00007 
00008 //    Modifications:
00009 //     18 Feb 2000. fsm: templated.
00010 //     4/4/01 LSB (Manchester) documentation tidied
00011 //
00012 //-----------------------------------------------------------------------------
00013 
00014 #include <vnl/vnl_matrix_fixed.h>
00015 #include <vnl/vnl_vector_fixed.h>
00016 
00017 template <class T>
00018 class vnl_scatter_3x3 : public vnl_matrix_fixed<T,3,3> {
00019 public:
00020   typedef vnl_matrix_fixed<T,3,3> base;
00021   typedef vnl_vector_fixed<T,3> vect;
00022 
00023   //: Constructor.  Fills with zeros.
00024   vnl_scatter_3x3();
00025 
00026   //: Add v*v' to scatter.
00027   void add_outer_product(const vnl_vector_fixed<T,3> & v);
00028 
00029   //: Add v*u' to scatter.
00030   void add_outer_product(const vnl_vector_fixed<T,3> & u,
00031         const vnl_vector_fixed<T,3> & v);
00032 
00033   //: Subtract v*v' from scatter.
00034   void sub_outer_product(const vnl_vector_fixed<T,3> & v);
00035 
00036   //: Subtract v*u' from scatter.
00037   void sub_outer_product(const vnl_vector_fixed<T,3> & u, 
00038         const vnl_vector_fixed<T,3> & v);
00039 
00040   //: Replace S with $(S+S^\top)/2$.
00041   void force_symmetric();
00042 
00043   //: Compute the eigensystem of S.
00044   void compute_eigensystem();
00045 
00046   //: Return the eigenvector corresponding to the smallest eigenvalue.
00047   vnl_vector_fixed<T,3> minimum_eigenvector() {
00048     if (!eigenvectors_currentp) compute_eigensystem();
00049     return vnl_vector_fixed<T,3>(V_(0,0), V_(1,0), V_(2,0));
00050   }
00051 
00052   //: Return the column matrix of eigenvectors, sorted in increasing order
00053   // of eigenvalue.
00054   vnl_matrix_fixed<T,3,3>& V() {
00055     if (!eigenvectors_currentp) compute_eigensystem();
00056     return V_;
00057   }
00058 
00059 protected:
00060   bool symmetricp;
00061   bool eigenvectors_currentp;
00062   vnl_matrix_fixed<T,3,3> V_;
00063   vnl_vector_fixed<T,3> D;
00064 };
00065 
00066 
00067 #endif // vnl_scatter_3x3_h_

Generated at Wed Mar 12 01:13:15 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000