mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-21 05:43:21 +08:00
Use signed integers instead of unsigned ones more consistently in the codebase.
This commit is contained in:
parent
490d26e4c1
commit
f4ca8ad917
@ -495,7 +495,7 @@ struct TensorContractionEvaluatorBase
|
|||||||
internal::array_size<typename TensorEvaluator<EvalLeftArgType, Device>::Dimensions>::value;
|
internal::array_size<typename TensorEvaluator<EvalLeftArgType, Device>::Dimensions>::value;
|
||||||
static const int RDims =
|
static const int RDims =
|
||||||
internal::array_size<typename TensorEvaluator<EvalRightArgType, Device>::Dimensions>::value;
|
internal::array_size<typename TensorEvaluator<EvalRightArgType, Device>::Dimensions>::value;
|
||||||
static const unsigned int ContractDims = internal::array_size<Indices>::value;
|
static const int ContractDims = internal::array_size<Indices>::value;
|
||||||
static const int NumDims = max_n_1<LDims + RDims - 2 * ContractDims>::size;
|
static const int NumDims = max_n_1<LDims + RDims - 2 * ContractDims>::size;
|
||||||
|
|
||||||
typedef array<Index, LDims> left_dim_mapper_t;
|
typedef array<Index, LDims> left_dim_mapper_t;
|
||||||
|
@ -265,10 +265,10 @@ struct tensor_index_linearization_helper<Index, NumIndices, 0, RowMajor>
|
|||||||
|
|
||||||
|
|
||||||
// Dynamic size
|
// Dynamic size
|
||||||
template <typename DenseIndex, std::size_t NumDims>
|
template <typename DenseIndex, int NumDims>
|
||||||
struct DSizes : array<DenseIndex, NumDims> {
|
struct DSizes : array<DenseIndex, NumDims> {
|
||||||
typedef array<DenseIndex, NumDims> Base;
|
typedef array<DenseIndex, NumDims> Base;
|
||||||
static const std::size_t count = NumDims;
|
static const int count = NumDims;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t rank() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t rank() const {
|
||||||
return NumDims;
|
return NumDims;
|
||||||
@ -278,8 +278,8 @@ struct DSizes : array<DenseIndex, NumDims> {
|
|||||||
return internal::array_prod(*static_cast<const Base*>(this));
|
return internal::array_prod(*static_cast<const Base*>(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC DSizes() {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DSizes() {
|
||||||
for (std::size_t i = 0 ; i < NumDims; ++i) {
|
for (int i = 0 ; i < NumDims; ++i) {
|
||||||
(*this)[i] = 0;
|
(*this)[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -369,10 +369,10 @@ struct tensor_vsize_index_linearization_helper<Index, NumIndices, 0, RowMajor>
|
|||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <typename DenseIndex, std::size_t NumDims> struct array_size<const DSizes<DenseIndex, NumDims> > {
|
template <typename DenseIndex, int NumDims> struct array_size<const DSizes<DenseIndex, NumDims> > {
|
||||||
static const size_t value = NumDims;
|
static const size_t value = NumDims;
|
||||||
};
|
};
|
||||||
template <typename DenseIndex, std::size_t NumDims> struct array_size<DSizes<DenseIndex, NumDims> > {
|
template <typename DenseIndex, int NumDims> struct array_size<DSizes<DenseIndex, NumDims> > {
|
||||||
static const size_t value = NumDims;
|
static const size_t value = NumDims;
|
||||||
};
|
};
|
||||||
#ifndef EIGEN_EMULATE_CXX11_META_H
|
#ifndef EIGEN_EMULATE_CXX11_META_H
|
||||||
|
@ -63,7 +63,7 @@ class TensorStorage<T, FixedDimensions, Options_>
|
|||||||
|
|
||||||
|
|
||||||
// pure dynamic
|
// pure dynamic
|
||||||
template<typename T, int Options_, typename IndexType, std::size_t NumIndices_>
|
template<typename T, int Options_, typename IndexType, int NumIndices_>
|
||||||
class TensorStorage<T, DSizes<IndexType, NumIndices_>, Options_>
|
class TensorStorage<T, DSizes<IndexType, NumIndices_>, Options_>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user