00001
00002 #ifndef vnl_fastops_h_
00003 #define vnl_fastops_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <vnl/vnl_vector.h>
00022 #include <vnl/vnl_matrix.h>
00023
00024
00025
00026
00027 class vnl_fastops
00028 {
00029 public:
00030 static void AtA(vnl_matrix<double>& out, const vnl_matrix<double>& A);
00031 static void AB (vnl_matrix<double>& out, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00032 static void AtB(vnl_matrix<double>& out, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00033 static void AtB(vnl_vector<double>& out, const vnl_matrix<double>& A, const vnl_vector<double>& b);
00034 static void Ab (vnl_vector<double>& out, const vnl_matrix<double>& A, const vnl_vector<double>& b);
00035 static void ABt(vnl_matrix<double>& out, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00036
00037 static double btAb (const vnl_matrix<double>& A, const vnl_vector<double>& b);
00038
00039 static void ABAt(vnl_matrix<double>& out, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00040
00041 static void inc_X_by_AtA(vnl_matrix<double>& X, const vnl_matrix<double>& A);
00042 static void inc_X_by_AB (vnl_matrix<double>& X, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00043 static void inc_X_by_AtB(vnl_matrix<double>& X, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00044 static void inc_X_by_AtB(vnl_vector<double>& X, const vnl_matrix<double>& A, const vnl_vector<double>& b);
00045 static void inc_X_by_ABt(vnl_matrix<double>& X, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00046 static void inc_X_by_ABAt(vnl_matrix<double>& X, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00047
00048 static void dec_X_by_AtA(vnl_matrix<double>& X, const vnl_matrix<double>& A);
00049 static void dec_X_by_AB (vnl_matrix<double>& X, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00050 static void dec_X_by_AtB(vnl_matrix<double>& X, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00051 static void dec_X_by_AtB(vnl_vector<double>& X, const vnl_matrix<double>& A, const vnl_vector<double>& b);
00052 static void dec_X_by_ABt(vnl_matrix<double>& X, const vnl_matrix<double>& A, const vnl_matrix<double>& B);
00053
00054 #if 0 // deprecated; use the ref-style versions instead!
00055 static void AtA(const vnl_matrix<double>& A, vnl_matrix<double>* out) {
00056 VXL_DEPRECATED("vnl_fastops::AtA"); AtA(*out, A); }
00057 static void AB (const vnl_matrix<double>& A, const vnl_matrix<double>& B, vnl_matrix<double>* out) {
00058 VXL_DEPRECATED("vnl_fastops::AA"); AB(*out, A,B); }
00059 static void AtB(const vnl_matrix<double>& A, const vnl_matrix<double>& B, vnl_matrix<double>* out) {
00060 VXL_DEPRECATED("vnl_fastops::AtB"); AtB(*out, A,B); }
00061 static void AtB(const vnl_matrix<double>& A, const vnl_vector<double>& b, vnl_vector<double>* out) {
00062 VXL_DEPRECATED("vnl_fastops::AtB"); AtB(*out, A,b); }
00063 static void ABt(const vnl_matrix<double>& A, const vnl_matrix<double>& B, vnl_matrix<double>* out) {
00064 VXL_DEPRECATED("vnl_fastops::ABt"); ABt(*out, A,B); }
00065 #endif // 0
00066
00067 private:
00068
00069 static double dot(const double* a, const double* b, unsigned int n);
00070 };
00071
00072 #endif // vnl_fastops_h_