contrib/oxl/mvl/PMatrixDecompAa.h
Go to the documentation of this file.
00001 // This is oxl/mvl/PMatrixDecompAa.h
00002 #ifndef PMatrixDecompAa_h_
00003 #define PMatrixDecompAa_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 //  \file
00009 // \brief Decompose PMatrix into [A a]
00010 //
00011 //    Decompose PMatrix into [A a] where A is 3x3 and a is 3x1.
00012 //
00013 // \author
00014 //     Andrew W. Fitzgibbon, Oxford RRG, 14 Feb 97
00015 
00016 #include <vnl/vnl_double_3x3.h>
00017 #include <vnl/vnl_double_3.h>
00018 #include <mvl/PMatrix.h>
00019 
00020 class PMatrixDecompAa
00021 {
00022  public:
00023 
00024 //: Public data members for A and a.
00025   vnl_double_3x3 A;
00026   vnl_double_3   a;
00027   //{genman, do not do anything to this line -- awf}
00028 
00029 //: Default constructor
00030   PMatrixDecompAa() {}
00031 
00032 //: Construct from PMatrix.
00033   PMatrixDecompAa(const PMatrix& P) { set(P); }
00034 
00035 //: Construct from PMatrix.
00036   PMatrixDecompAa(const vnl_matrix<double>& P) { set(P); }
00037 
00038 //:  Set [A a] from PMatrix.
00039   void set(const PMatrix& P) { P.get(&A.as_ref().non_const(), &a.as_ref().non_const()); }
00040 
00041 //:  Set [A a] from PMatrix.
00042   void set(const vnl_matrix<double>& P);
00043 
00044 //:  Set PMatrix from [A a].
00045   void get(PMatrix* P) const { P->set(A, a); }
00046 };
00047 
00048 #endif // PMatrixDecompAa_h_