contrib/mul/mbl/mbl_matxvec.h
Go to the documentation of this file.
00001 // This is mul/mbl/mbl_matxvec.h
00002 #ifndef mbl_matxvec_h
00003 #define mbl_matxvec_h
00004 //:
00005 // \file
00006 // \brief Various specialised versions of simple linear algebra operators.
00007 // \author Tim Cootes
00008 // \date 3-Oct-97
00009 // Modifications
00010 // \verbatim
00011 // TFC    Revised version 3-Oct-97
00012 // TFC    Added TC_MatXVec2
00013 // NPC    Added NC_VecXMat
00014 // IMS    started conversion to VXL 18 April 2001
00015 // \endverbatim
00016 //
00017 // Some of the code in this file has been converted to use VXL,
00018 // the rest has been #if-ed out. Only convert the other functions
00019 // as they are needed, and after checking that a suitable function doesn't
00020 // already exist in VXL.
00021 
00022 #include <vnl/vnl_fwd.h>
00023 
00024 #if 0 // commented out
00025 #include <vcl_vector.h>
00026   //: Compute R = V*M
00027   //  R is resized to the number of rows of V * cols of M
00028 void NC_VecXMat(const vnl_vector<double>& V,const vnl_matrix<double>& M,
00029                 vnl_matrix<double>& R);
00030 #endif // commented out
00031 
00032   //: Compute R = M*V
00033   //  Only use first V.size() columns of M
00034   //  R is resized to the number of rows of M
00035 void mbl_matxvec_prod_mv(const vnl_matrix<double>& M,
00036                          const vnl_vector<double>& V,
00037                          vnl_vector<double>& R);
00038 
00039   //: Compute R = M*V
00040   //  Only use first V.size() columns of M
00041   //  Only use first R.size() rows of M
00042   //  R is not resized - its size determines how many rows to use
00043 void mbl_matxvec_prod_mv_2(const vnl_matrix<double>& M,
00044                            const vnl_vector<double>& V,
00045                            vnl_vector<double>& R);
00046 
00047 #if 0
00048 void TC_MatXVec(const vnl_matrix<double>& M,
00049                 const vnl_vector<double>& V,
00050                 vnl_vector<double>& R,
00051                 const vcl_vector<int>& index);
00052 #endif // commented out
00053 
00054   //: Fast Compute R = V' * M = ( M.transpose() * V ).transpose()
00055   // Only use the first R.size() columns of M
00056   // R is not resized - its size determines how many columns to use
00057   // Ensure that V.elems() == M.rows().
00058 void mbl_matxvec_prod_vm(const vnl_vector<double>& V,
00059                          const vnl_matrix<double>& M,
00060                          vnl_vector<double>& R);
00061 
00062   //: Fast Compute R += V' * M = ( M.transpose() * V ).transpose()
00063   // Only use the first R.size() columns of M
00064   // R is not resized - its size determines how many columns to use
00065   // Ensure that V.elems() == M.rows().
00066 void mbl_matxvec_add_prod_vm(const vnl_vector<double>& V,
00067                              const vnl_matrix<double>& M,
00068                              vnl_vector<double>& R);
00069 
00070 #if 0 // commented out
00071 
00072 
00073 //: Computes MD where D is diagonal with elements d(i)
00074 void TC_ProductMD(vnl_matrix<double>& MD, const vnl_matrix<double>& M, const vnl_vector<double>& d);
00075 
00076 //: Computes DM where D is diagonal with elements d(i)
00077 void TC_ProductDM(vnl_matrix<double>& DM, const vnl_matrix<double>& M, const vnl_vector<double>& d);
00078 #endif // commented out
00079 
00080 #endif // mbl_matxvec_h