base_multi_edge.h
Go to the documentation of this file.
00001 // g2o - General Graph Optimization
00002 // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, H. Strasdat, W. Burgard
00003 // 
00004 // g2o is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU Lesser General Public License as published
00006 // by the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 // 
00009 // g2o is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU Lesser General Public License for more details.
00013 // 
00014 // You should have received a copy of the GNU Lesser General Public License
00015 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017 #ifndef BASE_MULTI_EDGE_H
00018 #define BASE_MULTI_EDGE_H
00019 
00020 #include <iostream>
00021 #include <iomanip>
00022 #include <limits>
00023 
00024 #include "base_edge.h"
00025 #include "g2o/config.h"
00026 
00027 namespace g2o {
00028 
00029   using namespace Eigen;
00030 
00037   template <int D, typename E>
00038   class BaseMultiEdge : public BaseEdge<D,E>
00039   {
00040     public:
00045       struct HessianHelper
00046       {
00047         Map<MatrixXd> matrix;     
00048         bool transposed;          
00049         HessianHelper() : matrix(0, 0, 0), transposed(false) {}
00050       };
00051 
00052     public:
00053       static const int Dimension = BaseEdge<D,E>::Dimension;
00054       typedef typename BaseEdge<D,E>::Measurement Measurement;
00055       typedef MatrixXd JacobianType;
00056       typedef typename BaseEdge<D,E>::ErrorVector ErrorVector;
00057       typedef typename BaseEdge<D,E>::InformationType InformationType;
00058       typedef Map<MatrixXd, MatrixXd::Flags & AlignedBit ? Aligned : Unaligned >
00059          HessianBlockType;
00060 
00061       BaseMultiEdge() : BaseEdge<D,E>()   {}
00062 
00067       virtual void linearizeOplus();
00068       
00069       virtual void resize(size_t size);
00070 
00071       virtual void constructQuadraticForm() ;
00072 
00073       virtual void mapHessianMemory(double* d, int i, int j, bool rowMajor);
00074 
00075       using BaseEdge<D,E>::computeError;
00076 
00077     protected:
00078       using BaseEdge<D,E>::_measurement;
00079       using BaseEdge<D,E>::_inverseMeasurement;
00080       using BaseEdge<D,E>::_information;
00081       using BaseEdge<D,E>::_error;
00082       using BaseEdge<D,E>::_vertices;
00083       using BaseEdge<D,E>::_dimension;
00084 
00085       std::vector<HessianHelper> _hessian;
00087       std::vector<JacobianType> _jacobianOplus;
00088 
00089     public:
00090       EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00091   };
00092 
00093 #include "base_multi_edge.hpp"
00094 
00095 } // end namespace g2o
00096 
00097 #endif


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:30:47