contrib/mul/m23d/m23d_set_q_constraint.h
Go to the documentation of this file.
00001 //:
00002 // \file
00003 // \author Tim Cootes
00004 // \brief Functions to construct linear constraints as rows in a matrix
00005 
00006 #ifndef m23d_set_q_constraint_h_
00007 #define m23d_set_q_constraint_h_
00008 
00009 #include <vnl/vnl_vector.h>
00010 #include <vnl/vnl_matrix.h>
00011 
00012 //: Defines constraint on elements of Q of form a'Qb=r
00013 //  Q is a symmetric matrix, with n(n+1)/2 independent elements
00014 //  The constraints on these elements are placed in row c of A
00015 void m23d_set_q_constraint1(vnl_matrix<double> & A,
00016                       vnl_vector<double> & rhs,
00017                       unsigned c,
00018                       const vnl_vector<double>& a,
00019                       const vnl_vector<double>& b,
00020                       double r);
00021 
00022 //: Defines constraint on elements of Q of form aQa'-bQb'=0
00023 //  Q is a symmetric matrix, with n(n+1)/2 independent elements
00024 //  The constraints on these elements are placed in row c of A
00025 void m23d_set_q_constraint2(vnl_matrix<double> & A,
00026                       vnl_vector<double> & rhs,
00027                       unsigned c,
00028                       const vnl_vector<double>& a,
00029                       const vnl_vector<double>& b);
00030 
00031 //: Generate matrix of all constraints on elements of Q
00032 // Q symmetric, encoded using elements i,j<=i in the vector q
00033 // q obtained by solving Aq=rhs
00034 void m23d_set_q_constraints(const vnl_matrix<double> & M, unsigned k,
00035                             vnl_matrix<double>& A,
00036                             vnl_vector<double>& rhs);
00037 
00038 #endif // m23d_set_q_constraint_h_
00039 
00040 
00041