mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-09 22:39:05 +08:00
Using Index type instead of hard coded int type to prevent potential implicit integer conversion.
This commit is contained in:
parent
9a04cd307c
commit
bc34ee3365
@ -31,13 +31,13 @@ namespace internal {
|
|||||||
template <int SegSizeAtCompileTime> struct LU_kernel_bmod
|
template <int SegSizeAtCompileTime> struct LU_kernel_bmod
|
||||||
{
|
{
|
||||||
template <typename BlockScalarVector, typename ScalarVector, typename IndexVector, typename Index>
|
template <typename BlockScalarVector, typename ScalarVector, typename IndexVector, typename Index>
|
||||||
static EIGEN_DONT_INLINE void run(const int segsize, BlockScalarVector& dense, ScalarVector& tempv, ScalarVector& lusup, Index& luptr, const Index lda,
|
static EIGEN_DONT_INLINE void run(const Index segsize, BlockScalarVector& dense, ScalarVector& tempv, ScalarVector& lusup, Index& luptr, const Index lda,
|
||||||
const Index nrow, IndexVector& lsub, const Index lptr, const Index no_zeros);
|
const Index nrow, IndexVector& lsub, const Index lptr, const Index no_zeros);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int SegSizeAtCompileTime>
|
template <int SegSizeAtCompileTime>
|
||||||
template <typename BlockScalarVector, typename ScalarVector, typename IndexVector, typename Index>
|
template <typename BlockScalarVector, typename ScalarVector, typename IndexVector, typename Index>
|
||||||
EIGEN_DONT_INLINE void LU_kernel_bmod<SegSizeAtCompileTime>::run(const int segsize, BlockScalarVector& dense, ScalarVector& tempv, ScalarVector& lusup, Index& luptr, const Index lda,
|
EIGEN_DONT_INLINE void LU_kernel_bmod<SegSizeAtCompileTime>::run(const Index segsize, BlockScalarVector& dense, ScalarVector& tempv, ScalarVector& lusup, Index& luptr, const Index lda,
|
||||||
const Index nrow, IndexVector& lsub, const Index lptr, const Index no_zeros)
|
const Index nrow, IndexVector& lsub, const Index lptr, const Index no_zeros)
|
||||||
{
|
{
|
||||||
typedef typename ScalarVector::Scalar Scalar;
|
typedef typename ScalarVector::Scalar Scalar;
|
||||||
@ -45,7 +45,7 @@ EIGEN_DONT_INLINE void LU_kernel_bmod<SegSizeAtCompileTime>::run(const int segsi
|
|||||||
// The result of triangular solve is in tempv[*];
|
// The result of triangular solve is in tempv[*];
|
||||||
// The result of matric-vector update is in dense[*]
|
// The result of matric-vector update is in dense[*]
|
||||||
Index isub = lptr + no_zeros;
|
Index isub = lptr + no_zeros;
|
||||||
int i;
|
Index i;
|
||||||
Index irow;
|
Index irow;
|
||||||
for (i = 0; i < ((SegSizeAtCompileTime==Dynamic)?segsize:SegSizeAtCompileTime); i++)
|
for (i = 0; i < ((SegSizeAtCompileTime==Dynamic)?segsize:SegSizeAtCompileTime); i++)
|
||||||
{
|
{
|
||||||
@ -92,13 +92,13 @@ EIGEN_DONT_INLINE void LU_kernel_bmod<SegSizeAtCompileTime>::run(const int segsi
|
|||||||
template <> struct LU_kernel_bmod<1>
|
template <> struct LU_kernel_bmod<1>
|
||||||
{
|
{
|
||||||
template <typename BlockScalarVector, typename ScalarVector, typename IndexVector, typename Index>
|
template <typename BlockScalarVector, typename ScalarVector, typename IndexVector, typename Index>
|
||||||
static EIGEN_DONT_INLINE void run(const int /*segsize*/, BlockScalarVector& dense, ScalarVector& /*tempv*/, ScalarVector& lusup, Index& luptr,
|
static EIGEN_DONT_INLINE void run(const Index /*segsize*/, BlockScalarVector& dense, ScalarVector& /*tempv*/, ScalarVector& lusup, Index& luptr,
|
||||||
const Index lda, const Index nrow, IndexVector& lsub, const Index lptr, const Index no_zeros);
|
const Index lda, const Index nrow, IndexVector& lsub, const Index lptr, const Index no_zeros);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename BlockScalarVector, typename ScalarVector, typename IndexVector, typename Index>
|
template <typename BlockScalarVector, typename ScalarVector, typename IndexVector, typename Index>
|
||||||
EIGEN_DONT_INLINE void LU_kernel_bmod<1>::run(const int /*segsize*/, BlockScalarVector& dense, ScalarVector& /*tempv*/, ScalarVector& lusup, Index& luptr,
|
EIGEN_DONT_INLINE void LU_kernel_bmod<1>::run(const Index /*segsize*/, BlockScalarVector& dense, ScalarVector& /*tempv*/, ScalarVector& lusup, Index& luptr,
|
||||||
const Index lda, const Index nrow, IndexVector& lsub, const Index lptr, const Index no_zeros)
|
const Index lda, const Index nrow, IndexVector& lsub, const Index lptr, const Index no_zeros)
|
||||||
{
|
{
|
||||||
typedef typename ScalarVector::Scalar Scalar;
|
typedef typename ScalarVector::Scalar Scalar;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user