mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bcca69afa | ||
|
|
2827b35b29 | ||
|
|
3664ba0811 | ||
|
|
ebef1f829d | ||
|
|
d2deedd5a8 | ||
|
|
8c78edc04c | ||
|
|
b029007996 | ||
|
|
8ebe822a20 | ||
|
|
bd7475cc0c | ||
|
|
e5203d46fe | ||
|
|
7065c3a398 | ||
|
|
f90db64e6a | ||
|
|
d6293e6385 | ||
|
|
aaaa9301a8 | ||
|
|
780f312228 | ||
|
|
ced86f3bfc | ||
|
|
1869a02f52 | ||
|
|
0c8a25ef94 | ||
|
|
70f355b51a | ||
|
|
2d0963fb00 | ||
|
|
907fba9ea9 | ||
|
|
7e0b7b1f25 | ||
|
|
5ac00624ed | ||
|
|
c0a0d2d181 | ||
|
|
ec39a39cb6 | ||
|
|
ccc6731f86 | ||
|
|
b09bb50aeb | ||
|
|
c7b8de77c0 | ||
|
|
c44bbabdcc | ||
|
|
468863f3a0 | ||
|
|
81f36b0e21 | ||
|
|
c196a49f67 | ||
|
|
e18e51d891 | ||
|
|
58fc972ed3 | ||
|
|
e7b6a4bcba | ||
|
|
eaa81c135a | ||
|
|
ad8b6c2342 | ||
|
|
37fe67372b |
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"
|
||||||
@@ -7,7 +7,7 @@ set(INCLUDE_INSTALL_DIR
|
|||||||
"The directory where we install the header files"
|
"The directory where we install the header files"
|
||||||
FORCE)
|
FORCE)
|
||||||
|
|
||||||
set(EIGEN_VERSION_NUMBER "2.0.13")
|
set(EIGEN_VERSION_NUMBER "2.0.17")
|
||||||
set(EIGEN_VERSION "${EIGEN_VERSION_NUMBER}")
|
set(EIGEN_VERSION "${EIGEN_VERSION_NUMBER}")
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ inline bool MatrixBase<Derived>::any() const
|
|||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline int MatrixBase<Derived>::count() const
|
inline int MatrixBase<Derived>::count() const
|
||||||
{
|
{
|
||||||
return this->cast<bool>().cast<int>().sum();
|
return this->cast<bool>().template cast<int>().sum();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EIGEN_ALLANDANY_H
|
#endif // EIGEN_ALLANDANY_H
|
||||||
|
|||||||
@@ -132,11 +132,12 @@ void LLT<MatrixType>::compute(const MatrixType& a)
|
|||||||
m_isInitialized = true;
|
m_isInitialized = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_matrix.col(0).end(size-1) = a.row(0).end(size-1).adjoint() / ei_real(m_matrix.coeff(0,0));
|
if(ei_real(m_matrix.coeff(0,0))>0)
|
||||||
|
m_matrix.col(0).end(size-1) = a.row(0).end(size-1).adjoint() / ei_real(m_matrix.coeff(0,0));
|
||||||
for (int j = 1; j < size; ++j)
|
for (int j = 1; j < size; ++j)
|
||||||
{
|
{
|
||||||
x = ei_real(a.coeff(j,j)) - m_matrix.row(j).start(j).squaredNorm();
|
x = ei_real(a.coeff(j,j)) - m_matrix.row(j).start(j).squaredNorm();
|
||||||
if (x < cutoff)
|
if (x <= cutoff)
|
||||||
{
|
{
|
||||||
m_isPositiveDefinite = false;
|
m_isPositiveDefinite = false;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -90,6 +90,28 @@ public:
|
|||||||
? ( int(MayUnrollCompletely) && int(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) )
|
? ( int(MayUnrollCompletely) && int(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) )
|
||||||
: int(NoUnrolling)
|
: int(NoUnrolling)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef EIGEN_DEBUG_ASSIGN
|
||||||
|
#define EIGEN_DEBUG_VAR(x) std::cerr << #x << " = " << x << std::endl;
|
||||||
|
static void debug()
|
||||||
|
{
|
||||||
|
EIGEN_DEBUG_VAR(DstIsAligned)
|
||||||
|
EIGEN_DEBUG_VAR(SrcIsAligned)
|
||||||
|
EIGEN_DEBUG_VAR(SrcAlignment)
|
||||||
|
EIGEN_DEBUG_VAR(InnerSize)
|
||||||
|
EIGEN_DEBUG_VAR(InnerMaxSize)
|
||||||
|
EIGEN_DEBUG_VAR(PacketSize)
|
||||||
|
EIGEN_DEBUG_VAR(MightVectorize)
|
||||||
|
EIGEN_DEBUG_VAR(MayInnerVectorize)
|
||||||
|
EIGEN_DEBUG_VAR(MayLinearVectorize)
|
||||||
|
EIGEN_DEBUG_VAR(MaySliceVectorize)
|
||||||
|
EIGEN_DEBUG_VAR(Vectorization)
|
||||||
|
EIGEN_DEBUG_VAR(UnrollingLimit)
|
||||||
|
EIGEN_DEBUG_VAR(MayUnrollCompletely)
|
||||||
|
EIGEN_DEBUG_VAR(MayUnrollInner)
|
||||||
|
EIGEN_DEBUG_VAR(Unrolling)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@@ -400,6 +422,9 @@ template<typename OtherDerived>
|
|||||||
EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>
|
EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>
|
||||||
::lazyAssign(const MatrixBase<OtherDerived>& other)
|
::lazyAssign(const MatrixBase<OtherDerived>& other)
|
||||||
{
|
{
|
||||||
|
#ifdef EIGEN_DEBUG_ASSIGN
|
||||||
|
ei_assign_traits<Derived, OtherDerived>::debug();
|
||||||
|
#endif
|
||||||
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived)
|
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived)
|
||||||
EIGEN_STATIC_ASSERT((ei_is_same_type<typename Derived::Scalar, typename OtherDerived::Scalar>::ret),
|
EIGEN_STATIC_ASSERT((ei_is_same_type<typename Derived::Scalar, typename OtherDerived::Scalar>::ret),
|
||||||
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
|
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ struct ei_L2_block_traits {
|
|||||||
#ifndef EIGEN_EXTERN_INSTANTIATIONS
|
#ifndef EIGEN_EXTERN_INSTANTIATIONS
|
||||||
|
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
static void ei_cache_friendly_product(
|
void ei_cache_friendly_product(
|
||||||
int _rows, int _cols, int depth,
|
int _rows, int _cols, int depth,
|
||||||
bool _lhsRowMajor, const Scalar* _lhs, int _lhsStride,
|
bool _lhsRowMajor, const Scalar* _lhs, int _lhsStride,
|
||||||
bool _rhsRowMajor, const Scalar* _rhs, int _rhsStride,
|
bool _rhsRowMajor, const Scalar* _rhs, int _rhsStride,
|
||||||
@@ -352,7 +352,7 @@ static void ei_cache_friendly_product(
|
|||||||
* TODO: since rhs gets evaluated only once, no need to evaluate it
|
* TODO: since rhs gets evaluated only once, no need to evaluate it
|
||||||
*/
|
*/
|
||||||
template<typename Scalar, typename RhsType>
|
template<typename Scalar, typename RhsType>
|
||||||
static EIGEN_DONT_INLINE void ei_cache_friendly_product_colmajor_times_vector(
|
EIGEN_DONT_INLINE void ei_cache_friendly_product_colmajor_times_vector(
|
||||||
int size,
|
int size,
|
||||||
const Scalar* lhs, int lhsStride,
|
const Scalar* lhs, int lhsStride,
|
||||||
const RhsType& rhs,
|
const RhsType& rhs,
|
||||||
@@ -542,7 +542,7 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_colmajor_times_vector(
|
|||||||
|
|
||||||
// TODO add peeling to mask unaligned load/stores
|
// TODO add peeling to mask unaligned load/stores
|
||||||
template<typename Scalar, typename ResType>
|
template<typename Scalar, typename ResType>
|
||||||
static EIGEN_DONT_INLINE void ei_cache_friendly_product_rowmajor_times_vector(
|
EIGEN_DONT_INLINE void ei_cache_friendly_product_rowmajor_times_vector(
|
||||||
const Scalar* lhs, int lhsStride,
|
const Scalar* lhs, int lhsStride,
|
||||||
const Scalar* rhs, int rhsSize,
|
const Scalar* rhs, int rhsSize,
|
||||||
ResType& res)
|
ResType& res)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Eigen
|
|||||||
{
|
{
|
||||||
|
|
||||||
#define EIGEN_INSTANTIATE_PRODUCT(TYPE) \
|
#define EIGEN_INSTANTIATE_PRODUCT(TYPE) \
|
||||||
template static void ei_cache_friendly_product<TYPE>( \
|
template void ei_cache_friendly_product<TYPE>( \
|
||||||
int _rows, int _cols, int depth, \
|
int _rows, int _cols, int depth, \
|
||||||
bool _lhsRowMajor, const TYPE* _lhs, int _lhsStride, \
|
bool _lhsRowMajor, const TYPE* _lhs, int _lhsStride, \
|
||||||
bool _rhsRowMajor, const TYPE* _rhs, int _rhsStride, \
|
bool _rhsRowMajor, const TYPE* _rhs, int _rhsStride, \
|
||||||
|
|||||||
@@ -35,16 +35,6 @@ template<typename T> inline T ei_random_amplitude()
|
|||||||
else return static_cast<T>(10);
|
else return static_cast<T>(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> inline T ei_hypot(T x, T y)
|
|
||||||
{
|
|
||||||
T _x = ei_abs(x);
|
|
||||||
T _y = ei_abs(y);
|
|
||||||
T p = std::max(_x, _y);
|
|
||||||
T q = std::min(_x, _y);
|
|
||||||
T qp = q/p;
|
|
||||||
return p * ei_sqrt(T(1) + qp*qp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************
|
/**************
|
||||||
*** int ***
|
*** int ***
|
||||||
**************/
|
**************/
|
||||||
@@ -292,4 +282,14 @@ inline bool ei_isApproxOrLessThan(long double a, long double b, long double prec
|
|||||||
return a <= b || ei_isApprox(a, b, prec);
|
return a <= b || ei_isApprox(a, b, prec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T> inline T ei_hypot(T x, T y)
|
||||||
|
{
|
||||||
|
T _x = ei_abs(x);
|
||||||
|
T _y = ei_abs(y);
|
||||||
|
T p = std::max(_x, _y);
|
||||||
|
T q = std::min(_x, _y);
|
||||||
|
T qp = q/p;
|
||||||
|
return p * ei_sqrt(T(1) + qp*qp);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // EIGEN_MATHFUNCTIONS_H
|
#endif // EIGEN_MATHFUNCTIONS_H
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ template <typename T, int Size, int MatrixOptions,
|
|||||||
{
|
{
|
||||||
#ifndef EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
|
#ifndef EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
|
||||||
ei_assert((reinterpret_cast<size_t>(array) & 0xf) == 0
|
ei_assert((reinterpret_cast<size_t>(array) & 0xf) == 0
|
||||||
&& "this assertion is explained here: http://eigen.tuxfamily.org/dox/UnalignedArrayAssert.html **** READ THIS WEB PAGE !!! ****");
|
&& "this assertion is explained here: http://eigen.tuxfamily.org/dox-2.0/UnalignedArrayAssert.html **** READ THIS WEB PAGE !!! ****");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,6 +187,17 @@ template<typename LhsNested, typename RhsNested, int ProductMode> class Product
|
|||||||
_LhsNested, _RhsNested, Scalar> ScalarCoeffImpl;
|
_LhsNested, _RhsNested, Scalar> ScalarCoeffImpl;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
typedef typename ei_nested<_LhsNested,_RhsNested::ColsAtCompileTime>::type LhsNestedX;
|
||||||
|
typedef typename ei_nested<_RhsNested,_LhsNested::RowsAtCompileTime>::type RhsNestedX;
|
||||||
|
typedef typename ei_cleantype<LhsNestedX>::type _LhsNestedX;
|
||||||
|
typedef typename ei_cleantype<RhsNestedX>::type _RhsNestedX;
|
||||||
|
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LhsNestedFlags = _LhsNestedX::Flags,
|
||||||
|
RhsNestedFlags = _RhsNestedX::Flags
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
template<typename Lhs, typename Rhs>
|
template<typename Lhs, typename Rhs>
|
||||||
inline Product(const Lhs& lhs, const Rhs& rhs)
|
inline Product(const Lhs& lhs, const Rhs& rhs)
|
||||||
@@ -522,11 +533,11 @@ static void ei_cache_friendly_product_rowmajor_times_vector(
|
|||||||
|
|
||||||
template<typename ProductType,
|
template<typename ProductType,
|
||||||
int LhsRows = ei_traits<ProductType>::RowsAtCompileTime,
|
int LhsRows = ei_traits<ProductType>::RowsAtCompileTime,
|
||||||
int LhsOrder = int(ei_traits<ProductType>::LhsFlags)&RowMajorBit ? RowMajor : ColMajor,
|
int LhsOrder = int(ProductType::LhsNestedFlags)&RowMajorBit ? RowMajor : ColMajor,
|
||||||
int LhsHasDirectAccess = int(ei_traits<ProductType>::LhsFlags)&DirectAccessBit? HasDirectAccess : NoDirectAccess,
|
int LhsHasDirectAccess = int(ProductType::LhsNestedFlags)&DirectAccessBit? HasDirectAccess : NoDirectAccess,
|
||||||
int RhsCols = ei_traits<ProductType>::ColsAtCompileTime,
|
int RhsCols = ProductType::ColsAtCompileTime,
|
||||||
int RhsOrder = int(ei_traits<ProductType>::RhsFlags)&RowMajorBit ? RowMajor : ColMajor,
|
int RhsOrder = int(ProductType::RhsNestedFlags)&RowMajorBit ? RowMajor : ColMajor,
|
||||||
int RhsHasDirectAccess = int(ei_traits<ProductType>::RhsFlags)&DirectAccessBit? HasDirectAccess : NoDirectAccess>
|
int RhsHasDirectAccess = int(ProductType::RhsNestedFlags)&DirectAccessBit? HasDirectAccess : NoDirectAccess>
|
||||||
struct ei_cache_friendly_product_selector
|
struct ei_cache_friendly_product_selector
|
||||||
{
|
{
|
||||||
template<typename DestDerived>
|
template<typename DestDerived>
|
||||||
@@ -543,9 +554,12 @@ struct ei_cache_friendly_product_selector<ProductType,LhsRows,ColMajor,NoDirectA
|
|||||||
template<typename DestDerived>
|
template<typename DestDerived>
|
||||||
inline static void run(DestDerived& res, const ProductType& product)
|
inline static void run(DestDerived& res, const ProductType& product)
|
||||||
{
|
{
|
||||||
const int size = product.rhs().rows();
|
typename ProductType::LhsNestedX lhs(product.lhs());
|
||||||
|
typename ProductType::RhsNestedX rhs(product.rhs());
|
||||||
|
|
||||||
|
const int size = rhs.rows();
|
||||||
for (int k=0; k<size; ++k)
|
for (int k=0; k<size; ++k)
|
||||||
res += product.rhs().coeff(k) * product.lhs().col(k);
|
res += rhs.coeff(k) * lhs.col(k);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -559,6 +573,9 @@ struct ei_cache_friendly_product_selector<ProductType,LhsRows,ColMajor,HasDirect
|
|||||||
template<typename DestDerived>
|
template<typename DestDerived>
|
||||||
inline static void run(DestDerived& res, const ProductType& product)
|
inline static void run(DestDerived& res, const ProductType& product)
|
||||||
{
|
{
|
||||||
|
typename ProductType::LhsNestedX lhs(product.lhs());
|
||||||
|
typename ProductType::RhsNestedX rhs(product.rhs());
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
EvalToRes = (ei_packet_traits<Scalar>::size==1)
|
EvalToRes = (ei_packet_traits<Scalar>::size==1)
|
||||||
||((DestDerived::Flags&ActualPacketAccessBit) && (!(DestDerived::Flags & RowMajorBit))) };
|
||((DestDerived::Flags&ActualPacketAccessBit) && (!(DestDerived::Flags & RowMajorBit))) };
|
||||||
@@ -571,8 +588,8 @@ struct ei_cache_friendly_product_selector<ProductType,LhsRows,ColMajor,HasDirect
|
|||||||
Map<Matrix<Scalar,DestDerived::RowsAtCompileTime,1,ColMajor> >(_res, res.size()) = res;
|
Map<Matrix<Scalar,DestDerived::RowsAtCompileTime,1,ColMajor> >(_res, res.size()) = res;
|
||||||
}
|
}
|
||||||
ei_cache_friendly_product_colmajor_times_vector(res.size(),
|
ei_cache_friendly_product_colmajor_times_vector(res.size(),
|
||||||
&product.lhs().const_cast_derived().coeffRef(0,0), product.lhs().stride(),
|
&lhs.const_cast_derived().coeffRef(0,0), lhs.stride(),
|
||||||
product.rhs(), _res);
|
rhs, _res);
|
||||||
|
|
||||||
if (!EvalToRes)
|
if (!EvalToRes)
|
||||||
{
|
{
|
||||||
@@ -589,9 +606,12 @@ struct ei_cache_friendly_product_selector<ProductType,1,LhsOrder,LhsAccess,RhsCo
|
|||||||
template<typename DestDerived>
|
template<typename DestDerived>
|
||||||
inline static void run(DestDerived& res, const ProductType& product)
|
inline static void run(DestDerived& res, const ProductType& product)
|
||||||
{
|
{
|
||||||
const int cols = product.lhs().cols();
|
typename ProductType::LhsNestedX lhs(product.lhs());
|
||||||
|
typename ProductType::RhsNestedX rhs(product.rhs());
|
||||||
|
|
||||||
|
const int cols = lhs.cols();
|
||||||
for (int j=0; j<cols; ++j)
|
for (int j=0; j<cols; ++j)
|
||||||
res += product.lhs().coeff(j) * product.rhs().row(j);
|
res += lhs.coeff(j) * rhs.row(j);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -605,6 +625,9 @@ struct ei_cache_friendly_product_selector<ProductType,1,LhsOrder,LhsAccess,RhsCo
|
|||||||
template<typename DestDerived>
|
template<typename DestDerived>
|
||||||
inline static void run(DestDerived& res, const ProductType& product)
|
inline static void run(DestDerived& res, const ProductType& product)
|
||||||
{
|
{
|
||||||
|
typename ProductType::LhsNestedX lhs(product.lhs());
|
||||||
|
typename ProductType::RhsNestedX rhs(product.rhs());
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
EvalToRes = (ei_packet_traits<Scalar>::size==1)
|
EvalToRes = (ei_packet_traits<Scalar>::size==1)
|
||||||
||((DestDerived::Flags & ActualPacketAccessBit) && (DestDerived::Flags & RowMajorBit)) };
|
||((DestDerived::Flags & ActualPacketAccessBit) && (DestDerived::Flags & RowMajorBit)) };
|
||||||
@@ -614,15 +637,15 @@ struct ei_cache_friendly_product_selector<ProductType,1,LhsOrder,LhsAccess,RhsCo
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
_res = ei_aligned_stack_new(Scalar, res.size());
|
_res = ei_aligned_stack_new(Scalar, res.size());
|
||||||
Map<Matrix<Scalar,DestDerived::SizeAtCompileTime,1,ColMajor> >(_res, res.size()) = res;
|
Map<Matrix<Scalar,1,DestDerived::SizeAtCompileTime,ColMajor> >(_res, res.size()) = res;
|
||||||
}
|
}
|
||||||
ei_cache_friendly_product_colmajor_times_vector(res.size(),
|
ei_cache_friendly_product_colmajor_times_vector(res.size(),
|
||||||
&product.rhs().const_cast_derived().coeffRef(0,0), product.rhs().stride(),
|
&rhs.const_cast_derived().coeffRef(0,0), rhs.stride(),
|
||||||
product.lhs().transpose(), _res);
|
lhs.transpose(), _res);
|
||||||
|
|
||||||
if (!EvalToRes)
|
if (!EvalToRes)
|
||||||
{
|
{
|
||||||
res = Map<Matrix<Scalar,DestDerived::SizeAtCompileTime,1,ColMajor> >(_res, res.size());
|
res = Map<Matrix<Scalar,1,DestDerived::SizeAtCompileTime,ColMajor> >(_res, res.size());
|
||||||
ei_aligned_stack_delete(Scalar, _res, res.size());
|
ei_aligned_stack_delete(Scalar, _res, res.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -635,25 +658,28 @@ struct ei_cache_friendly_product_selector<ProductType,LhsRows,RowMajor,HasDirect
|
|||||||
typedef typename ProductType::Scalar Scalar;
|
typedef typename ProductType::Scalar Scalar;
|
||||||
typedef typename ei_traits<ProductType>::_RhsNested Rhs;
|
typedef typename ei_traits<ProductType>::_RhsNested Rhs;
|
||||||
enum {
|
enum {
|
||||||
UseRhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (Rhs::Flags&ActualPacketAccessBit))
|
UseRhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (ProductType::RhsNestedFlags&ActualPacketAccessBit))
|
||||||
&& (Rhs::Flags&DirectAccessBit)
|
&& (ProductType::RhsNestedFlags&DirectAccessBit)
|
||||||
&& (!(Rhs::Flags & RowMajorBit)) };
|
&& (!(ProductType::RhsNestedFlags & RowMajorBit)) };
|
||||||
|
|
||||||
template<typename DestDerived>
|
template<typename DestDerived>
|
||||||
inline static void run(DestDerived& res, const ProductType& product)
|
inline static void run(DestDerived& res, const ProductType& product)
|
||||||
{
|
{
|
||||||
|
typename ProductType::LhsNestedX lhs(product.lhs());
|
||||||
|
typename ProductType::RhsNestedX rhs(product.rhs());
|
||||||
|
|
||||||
Scalar* EIGEN_RESTRICT _rhs;
|
Scalar* EIGEN_RESTRICT _rhs;
|
||||||
if (UseRhsDirectly)
|
if (UseRhsDirectly)
|
||||||
_rhs = &product.rhs().const_cast_derived().coeffRef(0);
|
_rhs = &rhs.const_cast_derived().coeffRef(0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_rhs = ei_aligned_stack_new(Scalar, product.rhs().size());
|
_rhs = ei_aligned_stack_new(Scalar, rhs.size());
|
||||||
Map<Matrix<Scalar,Rhs::SizeAtCompileTime,1,ColMajor> >(_rhs, product.rhs().size()) = product.rhs();
|
Map<Matrix<Scalar,Rhs::SizeAtCompileTime,1,ColMajor> >(_rhs, rhs.size()) = rhs;
|
||||||
}
|
}
|
||||||
ei_cache_friendly_product_rowmajor_times_vector(&product.lhs().const_cast_derived().coeffRef(0,0), product.lhs().stride(),
|
ei_cache_friendly_product_rowmajor_times_vector(&lhs.const_cast_derived().coeffRef(0,0), lhs.stride(),
|
||||||
_rhs, product.rhs().size(), res);
|
_rhs, rhs.size(), res);
|
||||||
|
|
||||||
if (!UseRhsDirectly) ei_aligned_stack_delete(Scalar, _rhs, product.rhs().size());
|
if (!UseRhsDirectly) ei_aligned_stack_delete(Scalar, _rhs, rhs.size());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -664,25 +690,28 @@ struct ei_cache_friendly_product_selector<ProductType,1,LhsOrder,LhsAccess,RhsCo
|
|||||||
typedef typename ProductType::Scalar Scalar;
|
typedef typename ProductType::Scalar Scalar;
|
||||||
typedef typename ei_traits<ProductType>::_LhsNested Lhs;
|
typedef typename ei_traits<ProductType>::_LhsNested Lhs;
|
||||||
enum {
|
enum {
|
||||||
UseLhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (Lhs::Flags&ActualPacketAccessBit))
|
UseLhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (ProductType::LhsNestedFlags&ActualPacketAccessBit))
|
||||||
&& (Lhs::Flags&DirectAccessBit)
|
&& (ProductType::LhsNestedFlags&DirectAccessBit)
|
||||||
&& (Lhs::Flags & RowMajorBit) };
|
&& (ProductType::LhsNestedFlags & RowMajorBit) };
|
||||||
|
|
||||||
template<typename DestDerived>
|
template<typename DestDerived>
|
||||||
inline static void run(DestDerived& res, const ProductType& product)
|
inline static void run(DestDerived& res, const ProductType& product)
|
||||||
{
|
{
|
||||||
|
typename ProductType::LhsNestedX lhs(product.lhs());
|
||||||
|
typename ProductType::RhsNestedX rhs(product.rhs());
|
||||||
|
|
||||||
Scalar* EIGEN_RESTRICT _lhs;
|
Scalar* EIGEN_RESTRICT _lhs;
|
||||||
if (UseLhsDirectly)
|
if (UseLhsDirectly)
|
||||||
_lhs = &product.lhs().const_cast_derived().coeffRef(0);
|
_lhs = &lhs.const_cast_derived().coeffRef(0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_lhs = ei_aligned_stack_new(Scalar, product.lhs().size());
|
_lhs = ei_aligned_stack_new(Scalar, lhs.size());
|
||||||
Map<Matrix<Scalar,Lhs::SizeAtCompileTime,1,ColMajor> >(_lhs, product.lhs().size()) = product.lhs();
|
Map<Matrix<Scalar,1,Lhs::SizeAtCompileTime,ColMajor> >(_lhs, lhs.size()) = lhs;
|
||||||
}
|
}
|
||||||
ei_cache_friendly_product_rowmajor_times_vector(&product.rhs().const_cast_derived().coeffRef(0,0), product.rhs().stride(),
|
ei_cache_friendly_product_rowmajor_times_vector(&rhs.const_cast_derived().coeffRef(0,0), rhs.stride(),
|
||||||
_lhs, product.lhs().size(), res);
|
_lhs, lhs.size(), res);
|
||||||
|
|
||||||
if(!UseLhsDirectly) ei_aligned_stack_delete(Scalar, _lhs, product.lhs().size());
|
if(!UseLhsDirectly) ei_aligned_stack_delete(Scalar, _lhs, lhs.size());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -735,7 +764,7 @@ inline Derived& MatrixBase<Derived>::lazyAssign(const Product<Lhs,Rhs,CacheFrien
|
|||||||
{
|
{
|
||||||
typedef typename ei_cleantype<Lhs>::type _Lhs;
|
typedef typename ei_cleantype<Lhs>::type _Lhs;
|
||||||
typedef typename ei_cleantype<Rhs>::type _Rhs;
|
typedef typename ei_cleantype<Rhs>::type _Rhs;
|
||||||
|
|
||||||
typedef typename ei_nested<_Lhs,_Rhs::ColsAtCompileTime>::type LhsNested;
|
typedef typename ei_nested<_Lhs,_Rhs::ColsAtCompileTime>::type LhsNested;
|
||||||
typedef typename ei_nested<_Rhs,_Lhs::RowsAtCompileTime>::type RhsNested;
|
typedef typename ei_nested<_Rhs,_Lhs::RowsAtCompileTime>::type RhsNested;
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ template<typename Lhs, typename Rhs,
|
|||||||
? UpperTriangular
|
? UpperTriangular
|
||||||
: -1,
|
: -1,
|
||||||
int StorageOrder = ei_is_part<Lhs>::value ? -1 // this is to solve ambiguous specializations
|
int StorageOrder = ei_is_part<Lhs>::value ? -1 // this is to solve ambiguous specializations
|
||||||
: int(Lhs::Flags) & (RowMajorBit|SparseBit)
|
: int(Lhs::Flags) & int(RowMajorBit|SparseBit)
|
||||||
>
|
>
|
||||||
struct ei_solve_triangular_selector;
|
struct ei_solve_triangular_selector;
|
||||||
|
|
||||||
|
|||||||
@@ -114,13 +114,13 @@ template<> EIGEN_STRONG_INLINE void ei_pstoreu<float>(float* to, const __m128&
|
|||||||
template<> EIGEN_STRONG_INLINE void ei_pstoreu<double>(double* to, const __m128d& from) { _mm_storeu_pd(to, from); }
|
template<> EIGEN_STRONG_INLINE void ei_pstoreu<double>(double* to, const __m128d& from) { _mm_storeu_pd(to, from); }
|
||||||
template<> EIGEN_STRONG_INLINE void ei_pstoreu<int>(int* to, const __m128i& from) { _mm_storeu_si128(reinterpret_cast<__m128i*>(to), from); }
|
template<> EIGEN_STRONG_INLINE void ei_pstoreu<int>(int* to, const __m128i& from) { _mm_storeu_si128(reinterpret_cast<__m128i*>(to), from); }
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER <= 1500) && defined(_WIN64)
|
#if defined(_MSC_VER) && (_MSC_VER <= 1500) && defined(_WIN64) && !defined(__INTEL_COMPILER)
|
||||||
// The temporary variable fixes an internal compilation error.
|
// The temporary variable fixes an internal compilation error.
|
||||||
// Direct of the struct members fixed bug #62.
|
// Direct of the struct members fixed bug #62.
|
||||||
template<> EIGEN_STRONG_INLINE float ei_pfirst<__m128>(const __m128& a) { return a.m128_f32[0]; }
|
template<> EIGEN_STRONG_INLINE float ei_pfirst<__m128>(const __m128& a) { return a.m128_f32[0]; }
|
||||||
template<> EIGEN_STRONG_INLINE double ei_pfirst<__m128d>(const __m128d& a) { return a.m128d_f64[0]; }
|
template<> EIGEN_STRONG_INLINE double ei_pfirst<__m128d>(const __m128d& a) { return a.m128d_f64[0]; }
|
||||||
template<> EIGEN_STRONG_INLINE int ei_pfirst<__m128i>(const __m128i& a) { int x = _mm_cvtsi128_si32(a); return x; }
|
template<> EIGEN_STRONG_INLINE int ei_pfirst<__m128i>(const __m128i& a) { int x = _mm_cvtsi128_si32(a); return x; }
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER <= 1500)
|
#elif defined(_MSC_VER) && (_MSC_VER <= 1500) && !defined(__INTEL_COMPILER)
|
||||||
// The temporary variable fixes an internal compilation error.
|
// The temporary variable fixes an internal compilation error.
|
||||||
template<> EIGEN_STRONG_INLINE float ei_pfirst<__m128>(const __m128& a) { float x = _mm_cvtss_f32(a); return x; }
|
template<> EIGEN_STRONG_INLINE float ei_pfirst<__m128>(const __m128& a) { float x = _mm_cvtss_f32(a); return x; }
|
||||||
template<> EIGEN_STRONG_INLINE double ei_pfirst<__m128d>(const __m128d& a) { double x = _mm_cvtsd_f64(a); return x; }
|
template<> EIGEN_STRONG_INLINE double ei_pfirst<__m128d>(const __m128d& a) { double x = _mm_cvtsd_f64(a); return x; }
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#define EIGEN_WORLD_VERSION 2
|
#define EIGEN_WORLD_VERSION 2
|
||||||
#define EIGEN_MAJOR_VERSION 0
|
#define EIGEN_MAJOR_VERSION 0
|
||||||
#define EIGEN_MINOR_VERSION 13
|
#define EIGEN_MINOR_VERSION 17
|
||||||
|
|
||||||
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
|
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
|
||||||
(EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
|
(EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
|
||||||
|
|||||||
@@ -188,7 +188,8 @@ template<> inline void ei_conditional_aligned_free<false>(void *ptr)
|
|||||||
template<typename T> inline void ei_destruct_elements_of_array(T *ptr, std::size_t size)
|
template<typename T> inline void ei_destruct_elements_of_array(T *ptr, std::size_t size)
|
||||||
{
|
{
|
||||||
// always destruct an array starting from the end.
|
// always destruct an array starting from the end.
|
||||||
while(size) ptr[--size].~T();
|
if(ptr)
|
||||||
|
while(size) ptr[--size].~T();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \internal delete objects constructed with ei_aligned_new
|
/** \internal delete objects constructed with ei_aligned_new
|
||||||
@@ -385,7 +386,7 @@ public:
|
|||||||
return std::numeric_limits<size_type>::max();
|
return std::numeric_limits<size_type>::max();
|
||||||
}
|
}
|
||||||
|
|
||||||
pointer allocate( size_type num, const_pointer* hint = 0 )
|
pointer allocate( size_type num, const void* hint = 0 )
|
||||||
{
|
{
|
||||||
static_cast<void>( hint ); // suppress unused variable warning
|
static_cast<void>( hint ); // suppress unused variable warning
|
||||||
return static_cast<pointer>( ei_aligned_malloc( num * sizeof(T) ) );
|
return static_cast<pointer>( ei_aligned_malloc( num * sizeof(T) ) );
|
||||||
|
|||||||
@@ -94,10 +94,16 @@ class ei_compute_matrix_flags
|
|||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
row_major_bit = Options&RowMajor ? RowMajorBit : 0,
|
row_major_bit = Options&RowMajor ? RowMajorBit : 0,
|
||||||
inner_max_size = row_major_bit ? MaxCols : MaxRows,
|
inner_max_size = int(MaxRows==1) ? int(MaxCols)
|
||||||
|
: int(MaxCols==1) ? int(MaxRows)
|
||||||
|
: int(row_major_bit) ? int(MaxCols) : int(MaxRows),
|
||||||
is_big = inner_max_size == Dynamic,
|
is_big = inner_max_size == Dynamic,
|
||||||
is_packet_size_multiple = (Cols*Rows) % ei_packet_traits<Scalar>::size == 0,
|
storage_has_fixed_size = MaxRows != Dynamic && MaxCols != Dynamic,
|
||||||
aligned_bit = ((Options&AutoAlign) && (is_big || is_packet_size_multiple)) ? AlignedBit : 0,
|
storage_has_aligned_fixed_size = storage_has_fixed_size
|
||||||
|
&& ( (MaxCols*MaxRows) % ei_packet_traits<Scalar>::size == 0 ),
|
||||||
|
aligned_bit = ( (Options&AutoAlign)
|
||||||
|
&& (is_big || storage_has_aligned_fixed_size)
|
||||||
|
) ? AlignedBit : 0,
|
||||||
packet_access_bit = ei_packet_traits<Scalar>::size > 1 && aligned_bit ? PacketAccessBit : 0
|
packet_access_bit = ei_packet_traits<Scalar>::size > 1 && aligned_bit ? PacketAccessBit : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -114,7 +120,7 @@ template<int _Rows, int _Cols> struct ei_size_at_compile_time
|
|||||||
* in order to avoid a useless copy
|
* in order to avoid a useless copy
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T, int Sparseness = ei_traits<T>::Flags&SparseBit> class ei_eval;
|
template<typename T, int Sparseness = ei_traits<T>::Flags&SparseBit> struct ei_eval;
|
||||||
|
|
||||||
template<typename T> struct ei_eval<T,IsDense>
|
template<typename T> struct ei_eval<T,IsDense>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
*
|
*
|
||||||
* A parametrized line is defined by an origin point \f$ \mathbf{o} \f$ and a unit
|
* A parametrized line is defined by an origin point \f$ \mathbf{o} \f$ and a unit
|
||||||
* direction vector \f$ \mathbf{d} \f$ such that the line corresponds to
|
* direction vector \f$ \mathbf{d} \f$ such that the line corresponds to
|
||||||
* the set \f$ l(t) = \mathbf{o} + t \mathbf{d} \f$, \f$ l \in \mathbf{R} \f$.
|
* the set \f$ l(t) = \mathbf{o} + t \mathbf{d} \f$, \f$ t \in \mathbf{R} \f$.
|
||||||
*
|
*
|
||||||
* \param _Scalar the scalar type, i.e., the type of the coefficients
|
* \param _Scalar the scalar type, i.e., the type of the coefficients
|
||||||
* \param _AmbientDim the dimension of the ambient space, can be a compile time value or Dynamic.
|
* \param _AmbientDim the dimension of the ambient space, can be a compile time value or Dynamic.
|
||||||
|
|||||||
@@ -63,10 +63,10 @@ template<typename MatrixType> class LU
|
|||||||
|
|
||||||
typedef typename MatrixType::Scalar Scalar;
|
typedef typename MatrixType::Scalar Scalar;
|
||||||
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
|
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
|
||||||
typedef Matrix<int, 1, MatrixType::ColsAtCompileTime> IntRowVectorType;
|
typedef Matrix<int, 1, MatrixType::ColsAtCompileTime, MatrixType::Options, 1, MatrixType::MaxColsAtCompileTime> IntRowVectorType;
|
||||||
typedef Matrix<int, MatrixType::RowsAtCompileTime, 1> IntColVectorType;
|
typedef Matrix<int, MatrixType::RowsAtCompileTime, 1, MatrixType::Options, MatrixType::MaxRowsAtCompileTime, 1> IntColVectorType;
|
||||||
typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
|
typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime, MatrixType::Options, 1, MatrixType::MaxColsAtCompileTime> RowVectorType;
|
||||||
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> ColVectorType;
|
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1, MatrixType::Options, MatrixType::MaxRowsAtCompileTime, 1> ColVectorType;
|
||||||
|
|
||||||
enum { MaxSmallDimAtCompileTime = EIGEN_SIZE_MIN(
|
enum { MaxSmallDimAtCompileTime = EIGEN_SIZE_MIN(
|
||||||
MatrixType::MaxColsAtCompileTime,
|
MatrixType::MaxColsAtCompileTime,
|
||||||
@@ -515,9 +515,10 @@ bool LU<MatrixType>::solve(
|
|||||||
if(!ei_isMuchSmallerThan(c.coeff(row,col), biggest_in_c, m_precision))
|
if(!ei_isMuchSmallerThan(c.coeff(row,col), biggest_in_c, m_precision))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_lu.corner(TopLeft, m_rank, m_rank)
|
if(m_rank>0)
|
||||||
.template marked<UpperTriangular>()
|
m_lu.corner(TopLeft, m_rank, m_rank)
|
||||||
.solveTriangularInPlace(c.corner(TopLeft, m_rank, c.cols()));
|
.template marked<UpperTriangular>()
|
||||||
|
.solveTriangularInPlace(c.corner(TopLeft, m_rank, c.cols()));
|
||||||
|
|
||||||
// Step 4
|
// Step 4
|
||||||
result->resize(m_lu.cols(), b.cols());
|
result->resize(m_lu.cols(), b.cols());
|
||||||
|
|||||||
@@ -54,10 +54,13 @@
|
|||||||
* constants \f$a,b,c\f$ so that the plane of equation \f$y=ax+bz+c\f$ fits
|
* constants \f$a,b,c\f$ so that the plane of equation \f$y=ax+bz+c\f$ fits
|
||||||
* best the five above points. To do that, call this function as follows:
|
* best the five above points. To do that, call this function as follows:
|
||||||
* @code
|
* @code
|
||||||
|
// create a vector of pointers to the points
|
||||||
|
std::vector<Vector3d> points_ptrs(5);
|
||||||
|
for(int k=0; k<5; ++k) points_ptrs[k] = &points[k];
|
||||||
Vector3d coeffs; // will store the coefficients a, b, c
|
Vector3d coeffs; // will store the coefficients a, b, c
|
||||||
linearRegression(
|
linearRegression(
|
||||||
5,
|
5,
|
||||||
&points,
|
&(points_ptrs[0]),
|
||||||
&coeffs,
|
&coeffs,
|
||||||
1 // the coord to express as a function of
|
1 // the coord to express as a function of
|
||||||
// the other ones. 0 means x, 1 means y, 2 means z.
|
// the other ones. 0 means x, 1 means y, 2 means z.
|
||||||
|
|||||||
@@ -270,12 +270,18 @@ bool QR<MatrixType>::solve(
|
|||||||
ei_assert(m_isInitialized && "QR is not initialized.");
|
ei_assert(m_isInitialized && "QR is not initialized.");
|
||||||
const int rows = m_qr.rows();
|
const int rows = m_qr.rows();
|
||||||
ei_assert(b.rows() == rows);
|
ei_assert(b.rows() == rows);
|
||||||
result->resize(rows, b.cols());
|
// enforce the computation of the rank
|
||||||
|
rank();
|
||||||
|
|
||||||
|
result->resize(m_qr.cols(), b.cols());
|
||||||
|
|
||||||
// TODO(keir): There is almost certainly a faster way to multiply by
|
// TODO(keir): There is almost certainly a faster way to multiply by
|
||||||
// Q^T without explicitly forming matrixQ(). Investigate.
|
// Q^T without explicitly forming matrixQ(). Investigate.
|
||||||
*result = matrixQ().transpose()*b;
|
*result = matrixQ().transpose()*b;
|
||||||
|
|
||||||
|
if(m_rank==0)
|
||||||
|
return result->isZero();
|
||||||
|
|
||||||
if(!isSurjective())
|
if(!isSurjective())
|
||||||
{
|
{
|
||||||
// is result is in the image of R ?
|
// is result is in the image of R ?
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ void Tridiagonalization<MatrixType>::_decomposeInPlace3x3(MatrixType& mat, Diago
|
|||||||
{
|
{
|
||||||
diag[0] = ei_real(mat(0,0));
|
diag[0] = ei_real(mat(0,0));
|
||||||
RealScalar v1norm2 = ei_abs2(mat(0,2));
|
RealScalar v1norm2 = ei_abs2(mat(0,2));
|
||||||
if (ei_isMuchSmallerThan(v1norm2, RealScalar(1)))
|
if (v1norm2==RealScalar(0))
|
||||||
{
|
{
|
||||||
diag[1] = ei_real(mat(1,1));
|
diag[1] = ei_real(mat(1,1));
|
||||||
diag[2] = ei_real(mat(2,2));
|
diag[2] = ei_real(mat(2,2));
|
||||||
|
|||||||
@@ -96,8 +96,8 @@ class SparseLU
|
|||||||
|
|
||||||
void setOrderingMethod(int m)
|
void setOrderingMethod(int m)
|
||||||
{
|
{
|
||||||
ei_assert(m&~OrderingMask == 0 && m!=0 && "invalid ordering method");
|
ei_assert((m&~OrderingMask) == 0 && m!=0 && "invalid ordering method");
|
||||||
m_flags = m_flags&~OrderingMask | m&OrderingMask;
|
m_flags = (m_flags&~OrderingMask) | (m&OrderingMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
int orderingMethod() const
|
int orderingMethod() const
|
||||||
|
|||||||
31
ci/build.linux.gitlab-ci.yml
Normal file
31
ci/build.linux.gitlab-ci.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# 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"
|
||||||
|
EIGEN_CI_ADDITIONAL_ARGS: '-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations -Wno-ignored-reference-qualifiers"'
|
||||||
|
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
|
||||||
@@ -39,7 +39,7 @@ add_custom_target(
|
|||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Eigen_Silly_Professor_64x64.png
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Eigen_Silly_Professor_64x64.png
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/html/
|
${CMAKE_CURRENT_BINARY_DIR}/html/
|
||||||
COMMAND doxygen
|
COMMAND doxygen
|
||||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/cleanhierarchy.sh ${CMAKE_CURRENT_BINARY_DIR}/html/hierarchy.html
|
# COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/cleanhierarchy.sh ${CMAKE_CURRENT_BINARY_DIR}/html/hierarchy.html
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -783,9 +783,7 @@ HTML_HEADER = "${Eigen_BINARY_DIR}/doc/eigendoxy_header.html"
|
|||||||
# each generated HTML page. If it is left blank doxygen will generate a
|
# each generated HTML page. If it is left blank doxygen will generate a
|
||||||
# standard footer.
|
# standard footer.
|
||||||
|
|
||||||
# the footer has not been customized yet, so let's use the default one
|
HTML_FOOTER = "${Eigen_BINARY_DIR}/doc/eigendoxy_footer.html"
|
||||||
# ${Eigen_BINARY_DIR}/doc/eigendoxy_footer.html
|
|
||||||
HTML_FOOTER =
|
|
||||||
|
|
||||||
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
|
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
|
||||||
# style sheet that is used by each HTML page. It can be used to
|
# style sheet that is used by each HTML page. It can be used to
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 24 23:40:21 2008 for Eigen by
|
<hr class="footer"/>
|
||||||
<a href="http://www.doxygen.org/index.html">
|
|
||||||
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
<!-- Piwik -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.sylphide-consulting.com/piwik/" : "http://stats.sylphide-consulting.com/piwik/");
|
||||||
|
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
|
||||||
|
</script><script type="text/javascript">
|
||||||
|
try {
|
||||||
|
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 20);
|
||||||
|
piwikTracker.trackPageView();
|
||||||
|
piwikTracker.enableLinkTracking();
|
||||||
|
} catch( err ) {}
|
||||||
|
</script><noscript><p><img src="http://stats.sylphide-consulting.com/piwik/piwik.php?idsite=20" style="border:0" alt="" /></p></noscript>
|
||||||
|
<!-- End Piwik Tracking Code -->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -4,16 +4,21 @@
|
|||||||
# You should call this script with USER set as you want, else some default
|
# You should call this script with USER set as you want, else some default
|
||||||
# will be used
|
# will be used
|
||||||
USER=${USER:-'orzel'}
|
USER=${USER:-'orzel'}
|
||||||
|
UPLOAD_DIR=dox-2.0
|
||||||
|
|
||||||
|
#ulimit -v 1024000
|
||||||
|
|
||||||
# step 1 : build
|
# step 1 : build
|
||||||
# todo if 'build is not there, create one:
|
rm build/doc/html -Rf
|
||||||
#mkdir build
|
mkdir build -p
|
||||||
(cd build && cmake .. && make -j3 doc) || { echo "make failed"; exit 1; }
|
(cd build && cmake .. && make doc) || { echo "make failed"; exit 1; }
|
||||||
#todo: n+1 where n = number of cpus
|
|
||||||
|
|
||||||
#step 2 : upload
|
#step 2 : upload
|
||||||
# (the '/' at the end of path are very important, see rsync documentation)
|
# (the '/' at the end of path is very important, see rsync documentation)
|
||||||
rsync -az build/doc/html/ $USER@ssh.tuxfamily.org:eigen/eigen.tuxfamily.org-web/htdocs/dox-2.0/ || { echo "upload failed"; exit 1; }
|
rsync -az --no-p --delete build/doc/html/ $USER@ssh.tuxfamily.org:eigen/eigen.tuxfamily.org-web/htdocs/$UPLOAD_DIR/ || { echo "upload failed"; exit 1; }
|
||||||
|
|
||||||
|
#step 3 : fix the perm
|
||||||
|
ssh $USER@ssh.tuxfamily.org "chmod -R g+w /home/eigen/eigen.tuxfamily.org-web/htdocs/$UPLOAD_DIR" || { echo "perm failed"; exit 1; }
|
||||||
|
|
||||||
echo "Uploaded successfully"
|
echo "Uploaded successfully"
|
||||||
|
|
||||||
|
|||||||
@@ -124,4 +124,8 @@ void test_cholesky()
|
|||||||
CALL_SUBTEST( cholesky(MatrixXf(17,17)) );
|
CALL_SUBTEST( cholesky(MatrixXf(17,17)) );
|
||||||
CALL_SUBTEST( cholesky(MatrixXd(33,33)) );
|
CALL_SUBTEST( cholesky(MatrixXd(33,33)) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MatrixXf m = MatrixXf::Zero(10,10);
|
||||||
|
VectorXf b = VectorXf::Zero(10);
|
||||||
|
VERIFY(!m.llt().isPositiveDefinite());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,4 +132,10 @@ void test_lu()
|
|||||||
CALL_SUBTEST( lu_invertible<MatrixXcf>() );
|
CALL_SUBTEST( lu_invertible<MatrixXcf>() );
|
||||||
CALL_SUBTEST( lu_invertible<MatrixXcd>() );
|
CALL_SUBTEST( lu_invertible<MatrixXcd>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MatrixXf m = MatrixXf::Zero(10,10);
|
||||||
|
VectorXf b = VectorXf::Zero(10);
|
||||||
|
VectorXf x = VectorXf::Random(10);
|
||||||
|
VERIFY(m.lu().solve(b,&x));
|
||||||
|
VERIFY(x.isZero());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,4 +48,11 @@ void test_product_large()
|
|||||||
MatrixXf a = MatrixXf::Random(10,4), b = MatrixXf::Random(4,10), c = a;
|
MatrixXf a = MatrixXf::Random(10,4), b = MatrixXf::Random(4,10), c = a;
|
||||||
VERIFY_IS_APPROX((a = a * b), (c * b).eval());
|
VERIFY_IS_APPROX((a = a * b), (c * b).eval());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
MatrixXf mat1(10,10); mat1.setRandom();
|
||||||
|
MatrixXf mat2(32,10); mat2.setRandom();
|
||||||
|
MatrixXf result = mat1.row(2)*mat2.transpose();
|
||||||
|
VERIFY_IS_APPROX(result, (mat1.row(2)*mat2.transpose()).eval());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,4 +75,11 @@ void test_qr()
|
|||||||
mat << 1, 1, 1, 2, 2, 2, 1, 2, 3;
|
mat << 1, 1, 1, 2, 2, 2, 1, 2, 3;
|
||||||
VERIFY(!mat.qr().isFullRank());
|
VERIFY(!mat.qr().isFullRank());
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
MatrixXf m = MatrixXf::Zero(10,10);
|
||||||
|
VectorXf b = VectorXf::Zero(10);
|
||||||
|
VectorXf x = VectorXf::Random(10);
|
||||||
|
VERIFY(m.qr().solve(b,&x));
|
||||||
|
VERIFY(x.isZero());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,11 +121,40 @@ template<typename MatrixType> void triangular(const MatrixType& m)
|
|||||||
m3.setZero();
|
m3.setZero();
|
||||||
m3.template part<Eigen::UpperTriangular>().setOnes();
|
m3.template part<Eigen::UpperTriangular>().setOnes();
|
||||||
VERIFY_IS_APPROX(m2,m3);
|
VERIFY_IS_APPROX(m2,m3);
|
||||||
|
}
|
||||||
|
|
||||||
|
void selfadjoint()
|
||||||
|
{
|
||||||
|
Matrix2i m;
|
||||||
|
m << 1, 2,
|
||||||
|
3, 4;
|
||||||
|
VERIFY(m.part<SelfAdjoint>() == m);
|
||||||
|
|
||||||
|
Matrix2i m1 = Matrix2i::Zero();
|
||||||
|
m1.part<SelfAdjoint>() = m;
|
||||||
|
Matrix2i ref1;
|
||||||
|
ref1 << 1, 2,
|
||||||
|
2, 4;
|
||||||
|
VERIFY(m1 == ref1);
|
||||||
|
|
||||||
|
Matrix2i m2 = Matrix2i::Zero();
|
||||||
|
m2.part<SelfAdjoint>() = m.part<UpperTriangular>();
|
||||||
|
Matrix2i ref2;
|
||||||
|
ref2 << 1, 2,
|
||||||
|
2, 4;
|
||||||
|
VERIFY(m2 == ref2);
|
||||||
|
|
||||||
|
Matrix2i m3 = Matrix2i::Zero();
|
||||||
|
m3.part<SelfAdjoint>() = m.part<LowerTriangular>();
|
||||||
|
Matrix2i ref3;
|
||||||
|
ref3 << 1, 0,
|
||||||
|
0, 4;
|
||||||
|
VERIFY(m3 == ref3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_triangular()
|
void test_triangular()
|
||||||
{
|
{
|
||||||
|
CALL_SUBTEST( selfadjoint() );
|
||||||
for(int i = 0; i < g_repeat ; i++) {
|
for(int i = 0; i < g_repeat ; i++) {
|
||||||
CALL_SUBTEST( triangular(Matrix<float, 1, 1>()) );
|
CALL_SUBTEST( triangular(Matrix<float, 1, 1>()) );
|
||||||
CALL_SUBTEST( triangular(Matrix<float, 2, 2>()) );
|
CALL_SUBTEST( triangular(Matrix<float, 2, 2>()) );
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ void test_vectorization_logic()
|
|||||||
VERIFY(test_assign(MatrixXf(10,10),MatrixXf(20,20).block(10,10,2,3),
|
VERIFY(test_assign(MatrixXf(10,10),MatrixXf(20,20).block(10,10,2,3),
|
||||||
SliceVectorization,NoUnrolling));
|
SliceVectorization,NoUnrolling));
|
||||||
|
|
||||||
|
VERIFY(test_assign(VectorXf(10),VectorXf(10)+VectorXf(10),
|
||||||
|
LinearVectorization,NoUnrolling));
|
||||||
|
|
||||||
VERIFY(test_sum(VectorXf(10),
|
VERIFY(test_sum(VectorXf(10),
|
||||||
LinearVectorization,NoUnrolling));
|
LinearVectorization,NoUnrolling));
|
||||||
|
|||||||
Reference in New Issue
Block a user