this is my first question here, I've searched it all over for a long time yet no solution. I'm using QUadprog++ to solve a quadratic problem. When I use it in a test alone, it was alright. But when I implement it into my project, which contains Eigen, the Eigen operations will have errors like "Matrix A has no member named ‘lu_inverse’". If I comment the header files of Quadprog++ (Array.hh and Quadprog++.hh) out, the errors just disappear. So I assume that it was a conflict error between the header files of Eigen and Quadprog++. Does anyone have some clue? Thanks in advance!
C++ compilling errors when using Quadprog++ with Eigen together
677 Views Asked by liu jingyu At
2
There are 2 best solutions below
3
asherikov
On
You can also switch to one of QuadProgpp versions which can work with Eigen types directly: https://github.com/asherikov/QuadProgpp, https://www.cs.cmu.edu/~bstephe1/eiquadprog.hpp; or try an alternative implementation of the same algorithm (also Eigen based) https://github.com/asherikov/qpmad.
Related Questions in C++
- How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
- Why can't I use templates members in its specialization?
- How to fix "Access violation executing location" when using GLFW and GLAD
- Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures
- How do I apply the interface concept with the base-class in design?
- File refuses to compile std::erase() even if using -std=g++23
- How can I do a successful map when the number of elements to be mapped is not consistent in Thrust C++
- Can std::bit_cast be applied to an empty object?
- Unexpected inter-thread happens-before relationships from relaxed memory ordering
- How i can move element of dynamic vector in argument of function push_back for dynamic vector
- Brick Breaker Ball Bounce
- Thread-safe lock-free min where both operands can change c++
- Watchdog Timer Reset on ESP32 using Webservers
- How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
- Conda CMAKE CXX Compiler error while compiling Pytorch
Related Questions in EIGEN
- Eigen: What's the output of argmax/argmin when applied to a tensor with duplicate values?
- How to sum attributes of a Eigen vector of class
- Parallelize filling of Eigen Matrix in C++
- How can I include a file using Eigen's plugin include?
- Converting rowwise back to matrix
- After using Intel MKL for Eigen, calculate "VectorXd * Matrix" comlains error
- Installing Eigen to use in VS Code
- CMake doesn't find PCL components
- Using FFTW library to take a 2D FFT of an Eigen tensor in C++
- How to compute (row) basis of a sparse matrix in Eigen library?
- How to conduct fft with fftw on eigen matrix?
- Implement top_k for Eigen in c++
- Stack tensors with different shapes in Eigen across dim 1
- cannot use threadprivate variable in gcc, clang works
- Using VSCode and CMake, how do I get CMake to recognize Eigen3Config.cmake installed through MSYS2?
Related Questions in QUADPROG
- Implementing Ehling and Ramos (2006) Mean Variance Efficiency Test for Portfolio Diversification in R
- Portfolio optimisation in R with Long Panel data
- Maximum Decorrelation portfolio optimisation
- Error: While building wheels for quadprog
- Import Error undefined symbol: _Z7qpgen2_PdS_PiS0_S_S_S_S_S_S0_S0_S0_S0_S0_S0_S_S0_
- Portfolio Optimization - R solve.QP giving "constraints are inconsistent, no solution"
- How to properly install qpsolvers for Python on Windows?
- Error: Failed building wheel for quadprog (Ubuntu, python)
- Installing/using quadprog in Python
- Quadratic optimization - portfolio maximization problems
- how can get rid of "ValueError: all the input array dimensions except for the concatenation axis must match exactly" error when use cvxopt function?
- Find linear combination of vectors that is the best fit for a target vector
- Quadprog for Portfolio Optimization with Constraints
- Usage and determination of the arguments of quadprog::solve.QP
- How do I correct this Value Error due to Buffer having the wrong dimensions in a quadprog SVM implementation?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
if your
using namespace quadprogpp;then dont. your different libraries have the same typenames and thats causing the errors you have. It may be a few more characters to typequadprogpp::someFunction();but its worth it. This is also why you shouldn't ever put ausing namespacein a header ever. Its because you pollute all files that include that header with the namespace symbols and name conflicts can ensue which is the same kind of error your having right now.the Quadprog library is in it's own namespace.
notice how just after the #includes there is a decleration of namespace quadprogpp{} and everything that is defined in its enclosing brackets will be defined in scope to quadprogpp, so to use any of this library you have to prefix eveything with the namespace name. this is no different than using things from the standard library. I'm quite sure you've written the standard c++ hello world
cout and endl being part of namespace std have to be prefixed with std:: to access them. Many new programmers to c++ dislike this and one of the very first things they google is how to not have to type out namespaces.
the next thing new programmers often do is learn to place their definitions in header files and their program logic in cpp files. Thats when they commit the next common mistake.
doing that pollutes all of your code with everything in the standard library. That may seem like a trivial thing but when you start using another library or perhaps you create your own type that has the same name as things in the standard library that causes name collisions.
That's when the compiler simply cant reason about which Vector you want. But both Quadprog.hh and Array.hh in Quadprog++ are wrapped in namespace quadprogpp to specifically prevent name collision, which is the whole purpose of namespaces. So there is somewhere in your code, likely a header file, where you've made the statement of
using namespace quadprogpp;, or some other namespace that defines an Array type, and the compiler can't deduce which type your referring to in your code.Other than removing your using namespace statements you can also prefix a typename with its namespace qualifer to disambiguate which type your talking about. In your case I'm confident your Array should be declared as
quadprogpp::Array arraynamme;rather than simplyArray arrayname;