Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
tools.hpp
00001 /* $Id$ */
00002 
00003 #ifndef _TOOLS_HPP_
00004 #define _TOOLS_HPP_
00005 
00006 #include <vector>
00007 #include "jmath/jblas.hpp"
00008 #include "jmath/ublasExtra.hpp"
00009 
00010 #define BIG 100000
00011 
00012 namespace jafar {
00013   namespace sams {
00014     namespace tools {
00015       // 
00016       // jblas::vec f2m (jblas::vec const & v, jblas::mat const & t) {
00017       //  jblas::vec res(4);
00018       //  res(0) = floor(t(0,0)*v(0)+t(0,1)*v(1)+t(0,2)+0.5);
00019       //  res(1) = floor(t(1,0)*v(0)+t(1,1)*v(1)+t(1,2)+0.5);
00020       //  res(2) = atan2(t(1,0),t(0,0))+v(2);
00021       //  while (res(2) < -M_PI) res(2) += 2.0F * M_PI;
00022       //  while (res(2) > M_PI) res(2) -= 2.0F * M_PI;
00023       //  res(3) = v(3) * sqrt(pow(t(0,0),2)+pow(t(1,0),2));
00024       //  return res;
00025       // };
00026       // 
00027       // jblas::vec m2f (jblas::vec const & v, jblas::mat const & t) {
00028       //  jblas::mat t_inv(3,3);
00029       //  jafar::jmath::ublasExtra::lu_inv(t,t_inv);
00030       //  jblas::vec res(4);
00031       //  res(0) = floor(t_inv(0,0)*v(0)+t_inv(0,1)*v(1)+t_inv(0,2)+0.5);
00032       //  res(1) = floor(t_inv(1,0)*v(0)+t_inv(1,1)*v(1)+t_inv(1,2)+0.5);
00033       //  res(2) = atan2(t_inv(1,0),t_inv(0,0))+v(2);
00034       //  while (res(2) < -M_PI) res(2) += 2.0F * M_PI;
00035       //  while (res(2) > M_PI) res(2) -= 2.0F * M_PI;
00036       //  res(3) = v(3) * sqrt(pow(t_inv(0,0),2)+pow(t_inv(1,0),2));
00037       //  return res;
00038       // };
00039       // 
00040 
00041       template <class ForwardIterator>
00042       void map_delete (ForwardIterator first, ForwardIterator last) {
00043         while (first != last) delete (first++)->second;
00044       };
00045 
00048       double lap(int dim_,
00049         jblas::mat& assigncost_,
00050         ublas::vector<int>& rowsol_,
00051         ublas::vector<int>& colsol_,
00052         ublas::vector<int>& u_,
00053         ublas::vector<int>& v_);
00054 
00055     } // namespace tools
00056   } // namespace sams
00057 } // namespace jafar
00058 
00059 
00060 #endif /* _TOOLS_HPP_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:17 for Jafar by doxygen 1.7.6.1
LAAS-CNRS