Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cvxcore optimization #1255

Merged
merged 15 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@ env:
matrix:
- PYTHON_VERSION="3.7"
COVERAGE="false"
USE_OPENMP="false"
DEPLOY_PYPI_SOURCE="False"
- PYTHON_VERSION="3.8"
COVERAGE="false"
USE_OPENMP="false"
DEPLOY_PYPI_SOURCE="True"
- PYTHON_VERSION="3.9"
COVERAGE="false"
USE_OPENMP="false"
DEPLOY_PYPI_SOURCE="False"
- PYTHON_VERSION="3.8"
COVERAGE="false"
USE_OPENMP="True"
DEPLOY_PYPI_SOURCE="false"
matrix:
exclude:
- os: osx
env: PYTHON_VERSION="3.8" COVERAGE="false" USE_OPENMP="True" DEPLOY_PYPI_SOURCE="false"
before_install:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then CC=gcc ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then CXX=g++; fi
Expand Down
6 changes: 5 additions & 1 deletion continuous_integration/Travis/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ elif [[ "$PYTHON_VERSION" == "3.9" ]]; then
pip install osqp
fi

if [[ "$USE_OPENMP" == "true" ]]; then
conda install -c conda-forge openmp
fi

pip install diffcp

if [[ "$COVERAGE" == "true" ]]; then
pip install coverage coveralls
fi
fi
9 changes: 8 additions & 1 deletion continuous_integration/Travis/test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ set -e
python --version
python -c "import numpy; print('numpy %s' % numpy.__version__)"
python -c "import scipy; print('scipy %s' % scipy.__version__)"
python setup.py install

if [ $USE_OPENMP == "True" ] && [ $TRAVIS_OS_NAME == "linux" ]; then
CFLAGS="-fopenmp" LDFLAGS="-lgomp" python setup.py install
export OMP_NUM_THREADS=4
else
python setup.py install
fi

python -c "import cvxpy; print(cvxpy.installed_solvers())"
python $(dirname ${BASH_SOURCE[0]})/../osqp_version.py

Expand Down
1 change: 1 addition & 0 deletions cvxpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
ECOS, SCS, DIFFCP, GUROBI, MOSEK, XPRESS, SCIP, ECOS_BB,
OPTIMAL, UNBOUNDED, INFEASIBLE, SOLVER_ERROR, ROBUST_KKTSOLVER,
OPTIMAL_INACCURATE, UNBOUNDED_INACCURATE, INFEASIBLE_INACCURATE)
from cvxpy.settings import get_num_threads, set_num_threads
from cvxpy.transforms import linearize, partial_optimize, suppfunc
from cvxpy.reductions import *
from cvxpy.reductions.solvers.defines import installed_solvers
11 changes: 0 additions & 11 deletions cvxpy/cvxcore/include/Eigen/Array

This file was deleted.

2 changes: 1 addition & 1 deletion cvxpy/cvxcore/include/Eigen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ install(FILES
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel
)

add_subdirectory(src)
install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h")
22 changes: 18 additions & 4 deletions cvxpy/cvxcore/include/Eigen/Cholesky
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_CHOLESKY_MODULE_H
#define EIGEN_CHOLESKY_MODULE_H

#include "Core"
#include "Jacobi"

#include "src/Core/util/DisableStupidWarnings.h"

Expand All @@ -10,20 +18,26 @@
*
*
* This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices.
* Those decompositions are accessible via the following MatrixBase methods:
* - MatrixBase::llt(),
* Those decompositions are also accessible via the following methods:
* - MatrixBase::llt()
* - MatrixBase::ldlt()
* - SelfAdjointView::llt()
* - SelfAdjointView::ldlt()
*
* \code
* #include <Eigen/Cholesky>
* \endcode
*/

#include "src/misc/Solve.h"
#include "src/Cholesky/LLT.h"
#include "src/Cholesky/LDLT.h"
#ifdef EIGEN_USE_LAPACKE
#include "src/Cholesky/LLT_MKL.h"
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/Cholesky/LLT_LAPACKE.h"
#endif

#include "src/Core/util/ReenableStupidWarnings.h"
Expand Down
13 changes: 8 additions & 5 deletions cvxpy/cvxcore/include/Eigen/CholmodSupport
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_CHOLMODSUPPORT_MODULE_H
#define EIGEN_CHOLMODSUPPORT_MODULE_H

Expand All @@ -12,7 +19,7 @@ extern "C" {
/** \ingroup Support_modules
* \defgroup CholmodSupport_Module CholmodSupport module
*
* This module provides an interface to the Cholmod library which is part of the <a href="http://www.cise.ufl.edu/research/sparse/SuiteSparse/">suitesparse</a> package.
* This module provides an interface to the Cholmod library which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
* It provides the two following main factorization classes:
* - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization.
* - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial).
Expand All @@ -33,12 +40,8 @@ extern "C" {
*
*/

#include "src/misc/Solve.h"
#include "src/misc/SparseSolve.h"

#include "src/CholmodSupport/CholmodSupport.h"


#include "src/Core/util/ReenableStupidWarnings.h"

#endif // EIGEN_CHOLMODSUPPORT_MODULE_H
Expand Down