Go to the documentation of this file.00001
00002 #ifndef vnl_cross_product_matrix_h_
00003 #define vnl_cross_product_matrix_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <vnl/vnl_vector_fixed.h>
00020 #include <vnl/vnl_double_3x3.h>
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class vnl_cross_product_matrix : public vnl_double_3x3
00031 {
00032 public:
00033 typedef vnl_double_3x3 base;
00034
00035 vnl_cross_product_matrix(vnl_vector_fixed<double,3> const& v) { set(v.data_block()); }
00036 vnl_cross_product_matrix(vnl_vector<double> const& v) { set(v.data_block()); }
00037 vnl_cross_product_matrix(const double* v) { set(v); }
00038 vnl_cross_product_matrix(vnl_cross_product_matrix const& that): base(that) {}
00039 ~vnl_cross_product_matrix() {}
00040
00041 vnl_cross_product_matrix& operator=(const vnl_cross_product_matrix& that) {
00042 base::operator= (that);
00043 return *this;
00044 }
00045
00046
00047
00048 inline vnl_cross_product_matrix& set(const double* v)
00049 {
00050 double const& e1 = v[0];
00051 double const& e2 = v[1];
00052 double const& e3 = v[2];
00053
00054 vnl_cross_product_matrix & E = *this;
00055
00056 E(0,0) = 0; E(0,1) = -e3; E(0,2) = e2;
00057 E(1,0) = e3; E(1,1) = 0; E(1,2) = -e1;
00058 E(2,0) = -e2; E(2,1) = e1; E(2,2) = 0;
00059
00060 return *this;
00061 }
00062 };
00063
00064 #endif // vnl_cross_product_matrix_h_