mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cee93a92af | ||
|
|
ed5cd0a4d1 | ||
|
|
17c2fde66b | ||
|
|
adb6679262 | ||
|
|
036ed69bc7 | ||
|
|
1ded6bf3fa | ||
|
|
18038fc829 | ||
|
|
03fd417f66 | ||
|
|
91207cbae3 |
41
.gitignore
vendored
Normal file
41
.gitignore
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
qrc_*cxx
|
||||||
|
*.orig
|
||||||
|
*.pyc
|
||||||
|
*.diff
|
||||||
|
diff
|
||||||
|
*.save
|
||||||
|
save
|
||||||
|
*.old
|
||||||
|
*.gmo
|
||||||
|
*.qm
|
||||||
|
core
|
||||||
|
core.*
|
||||||
|
*.bak
|
||||||
|
*~
|
||||||
|
*.build*
|
||||||
|
*.moc.*
|
||||||
|
*.moc
|
||||||
|
ui_*
|
||||||
|
CMakeCache.txt
|
||||||
|
tags
|
||||||
|
.*.swp
|
||||||
|
activity.png
|
||||||
|
*.out
|
||||||
|
*.php*
|
||||||
|
*.log
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
log
|
||||||
|
patch
|
||||||
|
*.patch
|
||||||
|
a
|
||||||
|
a.*
|
||||||
|
lapack/testing
|
||||||
|
lapack/reference
|
||||||
|
.*project
|
||||||
|
.settings
|
||||||
|
Makefile
|
||||||
|
!ci/build.gitlab-ci.yml
|
||||||
|
!scripts/buildtests.in
|
||||||
|
!Eigen/Core
|
||||||
|
!Eigen/src/Core
|
||||||
28
.gitlab-ci.yml
Normal file
28
.gitlab-ci.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# This file is part of Eigen, a lightweight C++ template library
|
||||||
|
# for linear algebra.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023, The Eigen Authors
|
||||||
|
#
|
||||||
|
# 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/.
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
variables:
|
||||||
|
# CMake build directory.
|
||||||
|
EIGEN_CI_BUILDDIR: .build
|
||||||
|
# Specify the CMake build target.
|
||||||
|
EIGEN_CI_BUILD_TARGET: ""
|
||||||
|
# If a test regex is specified, that will be selected.
|
||||||
|
# Otherwise, we will try a label if specified.
|
||||||
|
EIGEN_CI_CTEST_REGEX: ""
|
||||||
|
EIGEN_CI_CTEST_LABEL: ""
|
||||||
|
EIGEN_CI_CTEST_ARGS: ""
|
||||||
|
|
||||||
|
include:
|
||||||
|
- "/ci/common.gitlab-ci.yml"
|
||||||
|
- "/ci/build.linux.gitlab-ci.yml"
|
||||||
|
- "/ci/deploy.gitlab-ci.yml"
|
||||||
@@ -14,34 +14,40 @@ namespace Eigen {
|
|||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template<typename Scalar, typename CholmodType>
|
template<typename Scalar> struct cholmod_configure_matrix;
|
||||||
void cholmod_configure_matrix(CholmodType& mat)
|
|
||||||
{
|
template<> struct cholmod_configure_matrix<double> {
|
||||||
if (internal::is_same<Scalar,float>::value)
|
template<typename CholmodType>
|
||||||
{
|
static void run(CholmodType& mat) {
|
||||||
mat.xtype = CHOLMOD_REAL;
|
|
||||||
mat.dtype = CHOLMOD_SINGLE;
|
|
||||||
}
|
|
||||||
else if (internal::is_same<Scalar,double>::value)
|
|
||||||
{
|
|
||||||
mat.xtype = CHOLMOD_REAL;
|
mat.xtype = CHOLMOD_REAL;
|
||||||
mat.dtype = CHOLMOD_DOUBLE;
|
mat.dtype = CHOLMOD_DOUBLE;
|
||||||
}
|
}
|
||||||
else if (internal::is_same<Scalar,std::complex<float> >::value)
|
};
|
||||||
{
|
|
||||||
mat.xtype = CHOLMOD_COMPLEX;
|
template<> struct cholmod_configure_matrix<std::complex<double> > {
|
||||||
mat.dtype = CHOLMOD_SINGLE;
|
template<typename CholmodType>
|
||||||
}
|
static void run(CholmodType& mat) {
|
||||||
else if (internal::is_same<Scalar,std::complex<double> >::value)
|
|
||||||
{
|
|
||||||
mat.xtype = CHOLMOD_COMPLEX;
|
mat.xtype = CHOLMOD_COMPLEX;
|
||||||
mat.dtype = CHOLMOD_DOUBLE;
|
mat.dtype = CHOLMOD_DOUBLE;
|
||||||
}
|
}
|
||||||
else
|
};
|
||||||
{
|
|
||||||
eigen_assert(false && "Scalar type not supported by CHOLMOD");
|
// Other scalar types are not yet suppotred by Cholmod
|
||||||
}
|
// template<> struct cholmod_configure_matrix<float> {
|
||||||
}
|
// template<typename CholmodType>
|
||||||
|
// static void run(CholmodType& mat) {
|
||||||
|
// mat.xtype = CHOLMOD_REAL;
|
||||||
|
// mat.dtype = CHOLMOD_SINGLE;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// template<> struct cholmod_configure_matrix<std::complex<float> > {
|
||||||
|
// template<typename CholmodType>
|
||||||
|
// static void run(CholmodType& mat) {
|
||||||
|
// mat.xtype = CHOLMOD_COMPLEX;
|
||||||
|
// mat.dtype = CHOLMOD_SINGLE;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
@@ -88,7 +94,7 @@ cholmod_sparse viewAsCholmod(SparseMatrix<_Scalar,_Options,_Index>& mat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// setup res.xtype
|
// setup res.xtype
|
||||||
internal::cholmod_configure_matrix<_Scalar>(res);
|
internal::cholmod_configure_matrix<_Scalar>::run(res);
|
||||||
|
|
||||||
res.stype = 0;
|
res.stype = 0;
|
||||||
|
|
||||||
@@ -131,7 +137,7 @@ cholmod_dense viewAsCholmod(MatrixBase<Derived>& mat)
|
|||||||
res.x = (void*)(mat.derived().data());
|
res.x = (void*)(mat.derived().data());
|
||||||
res.z = 0;
|
res.z = 0;
|
||||||
|
|
||||||
internal::cholmod_configure_matrix<Scalar>(res);
|
internal::cholmod_configure_matrix<Scalar>::run(res);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -172,14 +178,16 @@ class CholmodBase : internal::noncopyable
|
|||||||
CholmodBase()
|
CholmodBase()
|
||||||
: m_cholmodFactor(0), m_info(Success), m_isInitialized(false)
|
: m_cholmodFactor(0), m_info(Success), m_isInitialized(false)
|
||||||
{
|
{
|
||||||
m_shiftOffset[0] = m_shiftOffset[1] = RealScalar(0.0);
|
EIGEN_STATIC_ASSERT((internal::is_same<double,RealScalar>::value), CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY);
|
||||||
|
m_shiftOffset[0] = m_shiftOffset[1] = 0.0;
|
||||||
cholmod_start(&m_cholmod);
|
cholmod_start(&m_cholmod);
|
||||||
}
|
}
|
||||||
|
|
||||||
CholmodBase(const MatrixType& matrix)
|
CholmodBase(const MatrixType& matrix)
|
||||||
: m_cholmodFactor(0), m_info(Success), m_isInitialized(false)
|
: m_cholmodFactor(0), m_info(Success), m_isInitialized(false)
|
||||||
{
|
{
|
||||||
m_shiftOffset[0] = m_shiftOffset[1] = RealScalar(0.0);
|
EIGEN_STATIC_ASSERT((internal::is_same<double,RealScalar>::value), CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY);
|
||||||
|
m_shiftOffset[0] = m_shiftOffset[1] = 0.0;
|
||||||
cholmod_start(&m_cholmod);
|
cholmod_start(&m_cholmod);
|
||||||
compute(matrix);
|
compute(matrix);
|
||||||
}
|
}
|
||||||
@@ -277,7 +285,7 @@ class CholmodBase : internal::noncopyable
|
|||||||
eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
|
eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
|
||||||
cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView<UpLo>());
|
cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView<UpLo>());
|
||||||
cholmod_factorize_p(&A, m_shiftOffset, 0, 0, m_cholmodFactor, &m_cholmod);
|
cholmod_factorize_p(&A, m_shiftOffset, 0, 0, m_cholmodFactor, &m_cholmod);
|
||||||
|
|
||||||
// If the factorization failed, minor is the column at which it did. On success minor == n.
|
// If the factorization failed, minor is the column at which it did. On success minor == n.
|
||||||
this->m_info = (m_cholmodFactor->minor == m_cholmodFactor->n ? Success : NumericalIssue);
|
this->m_info = (m_cholmodFactor->minor == m_cholmodFactor->n ? Success : NumericalIssue);
|
||||||
m_factorizationIsOk = true;
|
m_factorizationIsOk = true;
|
||||||
@@ -344,7 +352,7 @@ class CholmodBase : internal::noncopyable
|
|||||||
*/
|
*/
|
||||||
Derived& setShift(const RealScalar& offset)
|
Derived& setShift(const RealScalar& offset)
|
||||||
{
|
{
|
||||||
m_shiftOffset[0] = offset;
|
m_shiftOffset[0] = double(offset);
|
||||||
return derived();
|
return derived();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,7 +363,7 @@ class CholmodBase : internal::noncopyable
|
|||||||
protected:
|
protected:
|
||||||
mutable cholmod_common m_cholmod;
|
mutable cholmod_common m_cholmod;
|
||||||
cholmod_factor* m_cholmodFactor;
|
cholmod_factor* m_cholmodFactor;
|
||||||
RealScalar m_shiftOffset[2];
|
double m_shiftOffset[2];
|
||||||
mutable ComputationInfo m_info;
|
mutable ComputationInfo m_info;
|
||||||
bool m_isInitialized;
|
bool m_isInitialized;
|
||||||
int m_factorizationIsOk;
|
int m_factorizationIsOk;
|
||||||
@@ -378,6 +386,8 @@ class CholmodBase : internal::noncopyable
|
|||||||
*
|
*
|
||||||
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
||||||
*
|
*
|
||||||
|
* \warning Only double precision real and complex scalar types are supported by Cholmod.
|
||||||
|
*
|
||||||
* \sa \ref TutorialSparseDirectSolvers, class CholmodSupernodalLLT, class SimplicialLLT
|
* \sa \ref TutorialSparseDirectSolvers, class CholmodSupernodalLLT, class SimplicialLLT
|
||||||
*/
|
*/
|
||||||
template<typename _MatrixType, int _UpLo = Lower>
|
template<typename _MatrixType, int _UpLo = Lower>
|
||||||
@@ -425,6 +435,8 @@ class CholmodSimplicialLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimpl
|
|||||||
*
|
*
|
||||||
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
||||||
*
|
*
|
||||||
|
* \warning Only double precision real and complex scalar types are supported by Cholmod.
|
||||||
|
*
|
||||||
* \sa \ref TutorialSparseDirectSolvers, class CholmodSupernodalLLT, class SimplicialLDLT
|
* \sa \ref TutorialSparseDirectSolvers, class CholmodSupernodalLLT, class SimplicialLDLT
|
||||||
*/
|
*/
|
||||||
template<typename _MatrixType, int _UpLo = Lower>
|
template<typename _MatrixType, int _UpLo = Lower>
|
||||||
@@ -470,6 +482,8 @@ class CholmodSimplicialLDLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimp
|
|||||||
*
|
*
|
||||||
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
||||||
*
|
*
|
||||||
|
* \warning Only double precision real and complex scalar types are supported by Cholmod.
|
||||||
|
*
|
||||||
* \sa \ref TutorialSparseDirectSolvers
|
* \sa \ref TutorialSparseDirectSolvers
|
||||||
*/
|
*/
|
||||||
template<typename _MatrixType, int _UpLo = Lower>
|
template<typename _MatrixType, int _UpLo = Lower>
|
||||||
@@ -517,6 +531,8 @@ class CholmodSupernodalLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSuper
|
|||||||
*
|
*
|
||||||
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
* This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.
|
||||||
*
|
*
|
||||||
|
* \warning Only double precision real and complex scalar types are supported by Cholmod.
|
||||||
|
*
|
||||||
* \sa \ref TutorialSparseDirectSolvers
|
* \sa \ref TutorialSparseDirectSolvers
|
||||||
*/
|
*/
|
||||||
template<typename _MatrixType, int _UpLo = Lower>
|
template<typename _MatrixType, int _UpLo = Lower>
|
||||||
|
|||||||
@@ -412,10 +412,11 @@
|
|||||||
// attribute to maximize inlining. This should only be used when really necessary: in particular,
|
// attribute to maximize inlining. This should only be used when really necessary: in particular,
|
||||||
// it uses __attribute__((always_inline)) on GCC, which most of the time is useless and can severely harm compile times.
|
// it uses __attribute__((always_inline)) on GCC, which most of the time is useless and can severely harm compile times.
|
||||||
// FIXME with the always_inline attribute,
|
// FIXME with the always_inline attribute,
|
||||||
// gcc 3.4.x reports the following compilation error:
|
// gcc 3.4.x and 4.1 reports the following compilation error:
|
||||||
// Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const'
|
// Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const'
|
||||||
// : function body not available
|
// : function body not available
|
||||||
#if EIGEN_GNUC_AT_LEAST(4,0)
|
// See also bug 1367
|
||||||
|
#if EIGEN_GNUC_AT_LEAST(4,2)
|
||||||
#define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline
|
#define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline
|
||||||
#else
|
#else
|
||||||
#define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE
|
#define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE
|
||||||
|
|||||||
@@ -92,7 +92,8 @@
|
|||||||
THE_STORAGE_ORDER_OF_BOTH_SIDES_MUST_MATCH,
|
THE_STORAGE_ORDER_OF_BOTH_SIDES_MUST_MATCH,
|
||||||
OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG,
|
OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG,
|
||||||
IMPLICIT_CONVERSION_TO_SCALAR_IS_FOR_INNER_PRODUCT_ONLY,
|
IMPLICIT_CONVERSION_TO_SCALAR_IS_FOR_INNER_PRODUCT_ONLY,
|
||||||
STORAGE_LAYOUT_DOES_NOT_MATCH
|
STORAGE_LAYOUT_DOES_NOT_MATCH,
|
||||||
|
CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -218,7 +218,10 @@ public:
|
|||||||
inline Hyperplane& transform(const MatrixBase<XprType>& mat, TransformTraits traits = Affine)
|
inline Hyperplane& transform(const MatrixBase<XprType>& mat, TransformTraits traits = Affine)
|
||||||
{
|
{
|
||||||
if (traits==Affine)
|
if (traits==Affine)
|
||||||
|
{
|
||||||
normal() = mat.inverse().transpose() * normal();
|
normal() = mat.inverse().transpose() * normal();
|
||||||
|
m_coeffs /= normal().norm();
|
||||||
|
}
|
||||||
else if (traits==Isometry)
|
else if (traits==Isometry)
|
||||||
normal() = mat * normal();
|
normal() = mat * normal();
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -110,16 +110,16 @@ class SPQR
|
|||||||
max2Norm = RealScalar(1);
|
max2Norm = RealScalar(1);
|
||||||
pivotThreshold = 20 * (mat.rows() + mat.cols()) * max2Norm * NumTraits<RealScalar>::epsilon();
|
pivotThreshold = 20 * (mat.rows() + mat.cols()) * max2Norm * NumTraits<RealScalar>::epsilon();
|
||||||
}
|
}
|
||||||
|
|
||||||
cholmod_sparse A;
|
cholmod_sparse A;
|
||||||
A = viewAsCholmod(mat);
|
A = viewAsCholmod(mat);
|
||||||
|
m_rows = matrix.rows();
|
||||||
Index col = matrix.cols();
|
Index col = matrix.cols();
|
||||||
m_rank = SuiteSparseQR<Scalar>(m_ordering, pivotThreshold, col, &A,
|
m_rank = SuiteSparseQR<Scalar>(m_ordering, pivotThreshold, col, &A,
|
||||||
&m_cR, &m_E, &m_H, &m_HPinv, &m_HTau, &m_cc);
|
&m_cR, &m_E, &m_H, &m_HPinv, &m_HTau, &m_cc);
|
||||||
|
|
||||||
if (!m_cR)
|
if (!m_cR)
|
||||||
{
|
{
|
||||||
m_info = NumericalIssue;
|
m_info = NumericalIssue;
|
||||||
m_isInitialized = false;
|
m_isInitialized = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ class SPQR
|
|||||||
/**
|
/**
|
||||||
* Get the number of rows of the input matrix and the Q matrix
|
* Get the number of rows of the input matrix and the Q matrix
|
||||||
*/
|
*/
|
||||||
inline Index rows() const {return m_cR->nrow; }
|
inline Index rows() const {return m_rows; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of columns of the input matrix.
|
* Get the number of columns of the input matrix.
|
||||||
@@ -254,6 +254,7 @@ class SPQR
|
|||||||
mutable Index m_rank; // The rank of the matrix
|
mutable Index m_rank; // The rank of the matrix
|
||||||
mutable cholmod_common m_cc; // Workspace and parameters
|
mutable cholmod_common m_cc; // Workspace and parameters
|
||||||
bool m_useDefaultThreshold; // Use default threshold
|
bool m_useDefaultThreshold; // Use default threshold
|
||||||
|
Index m_rows;
|
||||||
template<typename ,typename > friend struct SPQR_QProduct;
|
template<typename ,typename > friend struct SPQR_QProduct;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,20 @@ struct traits<SparseView<MatrixType> > : traits<MatrixType>
|
|||||||
|
|
||||||
} // end namespace internal
|
} // end namespace internal
|
||||||
|
|
||||||
|
/** \ingroup SparseCore_Module
|
||||||
|
* \class SparseView
|
||||||
|
*
|
||||||
|
* \brief Expression of a dense or sparse matrix with zero or too small values removed
|
||||||
|
*
|
||||||
|
* \tparam MatrixType the type of the object of which we are removing the small entries
|
||||||
|
*
|
||||||
|
* This class represents an expression of a given dense or sparse matrix with
|
||||||
|
* entries smaller than \c reference * \c epsilon are removed.
|
||||||
|
* It is the return type of MatrixBase::sparseView() and SparseMatrixBase::pruned()
|
||||||
|
* and most of the time this is the only way it is used.
|
||||||
|
*
|
||||||
|
* \sa MatrixBase::sparseView(), SparseMatrixBase::pruned()
|
||||||
|
*/
|
||||||
template<typename MatrixType>
|
template<typename MatrixType>
|
||||||
class SparseView : public SparseMatrixBase<SparseView<MatrixType> >
|
class SparseView : public SparseMatrixBase<SparseView<MatrixType> >
|
||||||
{
|
{
|
||||||
@@ -87,6 +101,25 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** \ingroup SparseCore_Module
|
||||||
|
*
|
||||||
|
* \returns a sparse expression of the dense expression \c *this with values smaller than
|
||||||
|
* \a reference * \a epsilon removed.
|
||||||
|
*
|
||||||
|
* This method is typically used when prototyping to convert a quickly assembled dense Matrix \c D to a SparseMatrix \c S:
|
||||||
|
* \code
|
||||||
|
* MatrixXd D(n,m);
|
||||||
|
* SparseMatrix<double> S;
|
||||||
|
* S = D.sparseView(); // suppress numerical zeros (exact)
|
||||||
|
* S = D.sparseView(reference);
|
||||||
|
* S = D.sparseView(reference,epsilon);
|
||||||
|
* \endcode
|
||||||
|
* where \a reference is a meaningful non zero reference value,
|
||||||
|
* and \a epsilon is a tolerance factor defaulting to NumTraits<Scalar>::dummy_precision().
|
||||||
|
*
|
||||||
|
* \sa SparseMatrixBase::pruned(), class SparseView */
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
const SparseView<Derived> MatrixBase<Derived>::sparseView(const Scalar& m_reference,
|
const SparseView<Derived> MatrixBase<Derived>::sparseView(const Scalar& m_reference,
|
||||||
const typename NumTraits<Scalar>::Real& m_epsilon) const
|
const typename NumTraits<Scalar>::Real& m_epsilon) const
|
||||||
|
|||||||
30
ci/build.linux.gitlab-ci.yml
Normal file
30
ci/build.linux.gitlab-ci.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# Base configuration for linux cross-compilation.
|
||||||
|
.build:linux:cross:
|
||||||
|
extends: .common:linux:cross
|
||||||
|
stage: build
|
||||||
|
variables:
|
||||||
|
EIGEN_CI_BUILD_TARGET: buildtests
|
||||||
|
script:
|
||||||
|
- . ci/scripts/build.linux.script.sh
|
||||||
|
tags:
|
||||||
|
- saas-linux-2xlarge-amd64
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "web" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_PROJECT_NAMESPACE == "libeigen" && $CI_MERGE_REQUEST_LABELS =~ "/all-tests/"
|
||||||
|
cache:
|
||||||
|
key: "$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG-BUILD"
|
||||||
|
paths:
|
||||||
|
- ${EIGEN_CI_BUILDDIR}/
|
||||||
|
|
||||||
|
build:linux:docs:
|
||||||
|
extends: .build:linux:cross
|
||||||
|
variables:
|
||||||
|
EIGEN_CI_TARGET_ARCH: any
|
||||||
|
EIGEN_CI_BUILD_TARGET: doc
|
||||||
|
EIGEN_CI_INSTALL: ca-certificates clang flex python3 bison graphviz
|
||||||
|
EIGEN_CI_C_COMPILER: clang
|
||||||
|
EIGEN_CI_CXX_COMPILER: clang++
|
||||||
|
EIGEN_CI_BEFORE_SCRIPT: ". ci/scripts/build_and_install_doxygen.sh Release_1_13_2"
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||||
24
ci/common.gitlab-ci.yml
Normal file
24
ci/common.gitlab-ci.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Base configuration for linux builds and tests.
|
||||||
|
.common:linux:cross:
|
||||||
|
image: ubuntu:20.04
|
||||||
|
variables:
|
||||||
|
EIGEN_CI_TARGET_ARCH: ""
|
||||||
|
EIGEN_CI_ADDITIONAL_ARGS: ""
|
||||||
|
# If host matches target, use the following:
|
||||||
|
EIGEN_CI_C_COMPILER: ""
|
||||||
|
EIGEN_CI_CXX_COMPILER: ""
|
||||||
|
EIGEN_CI_INSTALL: "${EIGEN_CI_C_COMPILER} ${EIGEN_CI_CXX_COMPILER}"
|
||||||
|
# If host does not match the target, use the following:
|
||||||
|
EIGEN_CI_CROSS_TARGET_TRIPLE: ""
|
||||||
|
EIGEN_CI_CROSS_C_COMPILER: ${EIGEN_CI_C_COMPILER}
|
||||||
|
EIGEN_CI_CROSS_CXX_COMPILER: ${EIGEN_CI_CXX_COMPILER}
|
||||||
|
EIGEN_CI_CROSS_INSTALL: "${EIGEN_CI_CROSS_C_COMPILER} ${EIGEN_CI_CROSS_CXX_COMPILER}"
|
||||||
|
before_script:
|
||||||
|
# Call script in current shell - it sets up some environment variables.
|
||||||
|
- . ci/scripts/common.linux.before_script.sh
|
||||||
|
artifacts:
|
||||||
|
when: always
|
||||||
|
name: "$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG"
|
||||||
|
paths:
|
||||||
|
- ${EIGEN_CI_BUILDDIR}/
|
||||||
|
expire_in: 5 days
|
||||||
25
ci/deploy.gitlab-ci.yml
Normal file
25
ci/deploy.gitlab-ci.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Upload docs if pipeline succeeded.
|
||||||
|
deploy:docs:
|
||||||
|
stage: deploy
|
||||||
|
image: busybox
|
||||||
|
dependencies: [ build:linux:docs ]
|
||||||
|
variables:
|
||||||
|
PAGES_PREFIX: docs-nightly
|
||||||
|
script:
|
||||||
|
- echo "Deploying site to $CI_PAGES_URL"
|
||||||
|
- mv ${EIGEN_CI_BUILDDIR}/doc/html public
|
||||||
|
pages:
|
||||||
|
path_prefix: $PAGES_PREFIX
|
||||||
|
expire_in: never
|
||||||
|
artifacts:
|
||||||
|
name: "$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG"
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
tags:
|
||||||
|
- saas-linux-small-amd64
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "web" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||||
|
variables:
|
||||||
|
PAGES_PREFIX: docs-$CI_COMMIT_REF_NAME
|
||||||
31
ci/scripts/build.linux.script.sh
Executable file
31
ci/scripts/build.linux.script.sh
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# Create and enter build directory.
|
||||||
|
rootdir=`pwd`
|
||||||
|
mkdir -p ${EIGEN_CI_BUILDDIR}
|
||||||
|
cd ${EIGEN_CI_BUILDDIR}
|
||||||
|
|
||||||
|
# Configure build.
|
||||||
|
cmake -G Ninja \
|
||||||
|
-DCMAKE_CXX_COMPILER=${EIGEN_CI_CXX_COMPILER} \
|
||||||
|
-DCMAKE_C_COMPILER=${EIGEN_CI_C_COMPILER} \
|
||||||
|
-DCMAKE_CXX_COMPILER_TARGET=${EIGEN_CI_CXX_COMPILER_TARGET} \
|
||||||
|
${EIGEN_CI_ADDITIONAL_ARGS} ${rootdir}
|
||||||
|
|
||||||
|
target=""
|
||||||
|
if [[ ${EIGEN_CI_BUILD_TARGET} ]]; then
|
||||||
|
target="--target ${EIGEN_CI_BUILD_TARGET}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Builds (particularly gcc) sometimes get killed, potentially when running
|
||||||
|
# out of resources. In that case, keep trying to build the remaining
|
||||||
|
# targets (k0), then try to build again with a single thread (j1) to minimize
|
||||||
|
# resource use.
|
||||||
|
cmake --build . ${target} -- -k0 || cmake --build . ${target} -- -k0 -j1
|
||||||
|
|
||||||
|
# Return to root directory.
|
||||||
|
cd ${rootdir}
|
||||||
|
|
||||||
|
set +x
|
||||||
6
ci/scripts/build_and_install_doxygen.sh
Normal file
6
ci/scripts/build_and_install_doxygen.sh
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
git clone --depth 1 --branch $1 https://github.com/doxygen/doxygen.git
|
||||||
|
cmake -B doxygen/.build -G Ninja \
|
||||||
|
-DCMAKE_CXX_COMPILER=${EIGEN_CI_CXX_COMPILER} \
|
||||||
|
-DCMAKE_C_COMPILER=${EIGEN_CI_C_COMPILER} \
|
||||||
|
doxygen
|
||||||
|
cmake --build doxygen/.build -t install
|
||||||
46
ci/scripts/common.linux.before_script.sh
Executable file
46
ci/scripts/common.linux.before_script.sh
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
echo "Running ${CI_JOB_NAME}"
|
||||||
|
|
||||||
|
# Get architecture and display CI configuration.
|
||||||
|
export ARCH=`uname -m`
|
||||||
|
export NPROC=`nproc`
|
||||||
|
echo "arch=$ARCH, target=${EIGEN_CI_TARGET_ARCH}"
|
||||||
|
echo "Processors: ${NPROC}"
|
||||||
|
echo "CI Variables:"
|
||||||
|
export | grep EIGEN
|
||||||
|
|
||||||
|
# Set noninteractive, otherwise tzdata may be installed and prompt for a
|
||||||
|
# geographical region.
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get update -y > /dev/null
|
||||||
|
apt-get install -y --no-install-recommends ninja-build cmake git > /dev/null
|
||||||
|
|
||||||
|
# Install required dependencies and set up compilers.
|
||||||
|
# These are required even for testing to ensure that dynamic runtime libraries
|
||||||
|
# are available.
|
||||||
|
if [[ "$ARCH" == "${EIGEN_CI_TARGET_ARCH}" || "${EIGEN_CI_TARGET_ARCH}" == "any" ]]; then
|
||||||
|
apt-get install -y --no-install-recommends ${EIGEN_CI_INSTALL} > /dev/null;
|
||||||
|
export EIGEN_CI_CXX_IMPLICIT_INCLUDE_DIRECTORIES="";
|
||||||
|
export EIGEN_CI_CXX_COMPILER_TARGET="";
|
||||||
|
else
|
||||||
|
apt-get install -y --no-install-recommends ${EIGEN_CI_CROSS_INSTALL} > /dev/null;
|
||||||
|
export EIGEN_CI_C_COMPILER=${EIGEN_CI_CROSS_C_COMPILER};
|
||||||
|
export EIGEN_CI_CXX_COMPILER=${EIGEN_CI_CROSS_CXX_COMPILER};
|
||||||
|
export EIGEN_CI_CXX_COMPILER_TARGET=${EIGEN_CI_CROSS_TARGET_TRIPLE};
|
||||||
|
# Tell the compiler where to find headers and libraries if using clang.
|
||||||
|
# NOTE: this breaks GCC since it messes with include path order
|
||||||
|
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129)
|
||||||
|
if [[ "${EIGEN_CI_CROSS_CXX_COMPILER}" == *"clang"* ]]; then
|
||||||
|
export CPLUS_INCLUDE_PATH="/usr/${EIGEN_CI_CROSS_TARGET_TRIPLE}/include";
|
||||||
|
export LIBRARY_PATH="/usr/${EIGEN_CI_CROSS_TARGET_TRIPLE}/lib64";
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Compilers: ${EIGEN_CI_C_COMPILER} ${EIGEN_CI_CXX_COMPILER}"
|
||||||
|
|
||||||
|
if [ -n "$EIGEN_CI_BEFORE_SCRIPT" ]; then eval "$EIGEN_CI_BEFORE_SCRIPT"; fi
|
||||||
|
|
||||||
|
set +x
|
||||||
@@ -17,18 +17,22 @@ $generatedby  <a href="http://www.doxygen.org/index.html">
|
|||||||
</small></address>
|
</small></address>
|
||||||
<!--END !GENERATE_TREEVIEW-->
|
<!--END !GENERATE_TREEVIEW-->
|
||||||
|
|
||||||
<!-- Piwik -->
|
<!-- Matomo -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.sylphide-consulting.com/piwik/" : "http://stats.sylphide-consulting.com/piwik/");
|
var _paq = _paq || [];
|
||||||
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
|
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||||
</script><script type="text/javascript">
|
_paq.push(['trackPageView']);
|
||||||
try {
|
_paq.push(['enableLinkTracking']);
|
||||||
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 20);
|
(function() {
|
||||||
piwikTracker.trackPageView();
|
var u="//stats.sylphide-consulting.com/matomo/";
|
||||||
piwikTracker.enableLinkTracking();
|
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||||
} catch( err ) {}
|
_paq.push(['setSiteId', '20']);
|
||||||
</script><noscript><p><img src="http://stats.sylphide-consulting.com/piwik/piwik.php?idsite=20" style="border:0" alt="" /></p></noscript>
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
<!-- End Piwik Tracking Code -->
|
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<noscript><p><img src="//stats.sylphide-consulting.com/matomo/piwik.php?idsite=20&rec=1" style="border:0;" alt="" /></p></noscript>
|
||||||
|
<!-- End Matomo Code -->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -59,12 +59,15 @@ template<typename HyperplaneType> void hyperplane(const HyperplaneType& _plane)
|
|||||||
VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot,Isometry).absDistance(rot * p1), Scalar(1) );
|
VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot,Isometry).absDistance(rot * p1), Scalar(1) );
|
||||||
pl2 = pl1;
|
pl2 = pl1;
|
||||||
VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot*scaling).absDistance((rot*scaling) * p1), Scalar(1) );
|
VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot*scaling).absDistance((rot*scaling) * p1), Scalar(1) );
|
||||||
|
VERIFY_IS_APPROX( pl2.normal().norm(), RealScalar(1) );
|
||||||
pl2 = pl1;
|
pl2 = pl1;
|
||||||
VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot*scaling*translation)
|
VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot*scaling*translation)
|
||||||
.absDistance((rot*scaling*translation) * p1), Scalar(1) );
|
.absDistance((rot*scaling*translation) * p1), Scalar(1) );
|
||||||
|
VERIFY_IS_APPROX( pl2.normal().norm(), RealScalar(1) );
|
||||||
pl2 = pl1;
|
pl2 = pl1;
|
||||||
VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot*translation,Isometry)
|
VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot*translation,Isometry)
|
||||||
.absDistance((rot*translation) * p1), Scalar(1) );
|
.absDistance((rot*translation) * p1), Scalar(1) );
|
||||||
|
VERIFY_IS_APPROX( pl2.normal().norm(), RealScalar(1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// casting
|
// casting
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows
|
|||||||
int cols = internal::random<int>(1,rows);
|
int cols = internal::random<int>(1,rows);
|
||||||
double density = (std::max)(8./(rows*cols), 0.01);
|
double density = (std::max)(8./(rows*cols), 0.01);
|
||||||
|
|
||||||
A.resize(rows,rows);
|
A.resize(rows,cols);
|
||||||
dA.resize(rows,rows);
|
dA.resize(rows,cols);
|
||||||
initSparse<Scalar>(density, dA, A,ForceNonZeroDiag);
|
initSparse<Scalar>(density, dA, A,ForceNonZeroDiag);
|
||||||
A.makeCompressed();
|
A.makeCompressed();
|
||||||
return rows;
|
return rows;
|
||||||
|
|||||||
Reference in New Issue
Block a user