/* ---------------------------------------------------------------------------- * GTSAM Copyright 2010, Georgia Tech Research Corporation, * Atlanta, Georgia 30332-0415 * All Rights Reserved * Authors: Frank Dellaert, et al. (see THANKS for the full author list) * See LICENSE for the license information * -------------------------------------------------------------------------- */ /** * @file RawQP.h * @brief * @author Ivan Dario Jimenez * @date 3/5/16 */ #pragma once #include #include #include #include #include #include #include #include #include namespace gtsam { /** * This class is responsible for collecting a QP problem as the parser parses a QPS file * and then generating a QP problem. */ class RawQP { private: typedef std::unordered_map coefficient_v; typedef std::unordered_map constraint_v; std::unordered_map row_to_constraint_v; constraint_v E; constraint_v IG; constraint_v IL; unsigned int varNumber; std::unordered_map b; std::unordered_map ranges; std::unordered_map g; std::unordered_map varname_to_key; std::unordered_map > H; double f; std::string obj_name; std::string name_; std::unordered_map up; std::unordered_map lo; std::unordered_map fx; std::vector Free; const bool debug = false; public: RawQP() : row_to_constraint_v(), E(), IG(), IL(), varNumber(1), b(), ranges(), g(), varname_to_key(), H(), f(), obj_name(), name_(), up(), lo(), fx(), Free() { } void setName( boost::fusion::vector, std::vector, std::vector> const & name); void addColumn( boost::fusion::vector, std::vector, std::vector, std::vector, std::vector, double, std::vector> const & vars); void addColumnDouble( boost::fusion::vector, std::vector, std::vector, std::vector, double, std::vector, std::vector, std::vector, double> const & vars); void addRHS( boost::fusion::vector, std::vector, std::vector, std::vector, std::vector, double, std::vector> const & vars); void addRHSDouble( boost::fusion::vector, std::vector, std::vector, std::vector, std::vector, double, std::vector, std::vector, std::vector, double> const & vars); void addRangeSingle( boost::fusion::vector, std::vector, std::vector, std::vector, std::vector, double, std::vector> const & vars); void addRangeDouble( boost::fusion::vector, std::vector, std::vector, std::vector, std::vector, double, std::vector, std::vector, std::vector, double> const & vars); void addRow( boost::fusion::vector, char, std::vector, std::vector, std::vector> const & vars); void addBound( boost::fusion::vector, std::vector, std::vector, std::vector, std::vector, std::vector, std::vector, double> const & vars); void addBoundFr( boost::fusion::vector, std::vector, std::vector, std::vector, std::vector, std::vector, std::vector> const & vars); void addQuadTerm( boost::fusion::vector, std::vector, std::vector, std::vector, std::vector, double, std::vector> const & vars); QP makeQP(); } ; }