qpmad
Eigen-based C++ QP solver.
common.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4 
5  @copyright 2017 Alexander Sherikov. Licensed under the Apache License,
6  Version 2.0. (see LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7 
8  @brief
9 */
10 
11 #pragma once
12 
13 #include <stdexcept>
14 #include <cmath>
15 #include <Eigen/Dense>
16 
17 #include "config.h"
18 
19 #include "cpput_config.h"
20 #include "cpput_exception.h"
21 
22 
23 #ifdef QPMAD_ENABLE_TRACING
24 #define QPMAD_TRACE(info) std::cout << info << std::endl;
25 #else
26 #define QPMAD_TRACE(info)
27 #endif
28 
29 
30 namespace qpmad
31 {
32  typedef int MatrixIndex;
33 
34  typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> QPMatrix;
35  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> QPVector;
36 
37 
38  template <class t_VectorType>
39  inline void dropElementWithoutResize( t_VectorType &vector,
40  const MatrixIndex index,
41  const MatrixIndex size)
42  {
43  vector.segment(index, size - index - 1) = vector.segment(index+1, size - index - 1);
44  }
45 }
Eigen::Matrix< double, Eigen::Dynamic, 1 > QPVector
Definition: common.h:35
int MatrixIndex
Definition: common.h:32
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > QPMatrix
Definition: common.h:34
Throw & assert macro.
void dropElementWithoutResize(t_VectorType &vector, const MatrixIndex index, const MatrixIndex size)
Definition: common.h:39