mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #877, bug #572: Introduce a global Index typedef. Rename Sparse*::Index to StorageIndex, make Dense*::StorageIndex an alias to DenseIndex. Overall this commit gets rid of all Index conversion warnings.
This commit is contained in:
@@ -26,8 +26,25 @@ namespace Eigen {
|
||||
|
||||
typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex;
|
||||
|
||||
/**
|
||||
* \brief The Index type as used for the API.
|
||||
* \details To change this, \c \#define the preprocessor symbol \c EIGEN_DEFAULT_DENSE_INDEX_TYPE.
|
||||
* \sa \ref TopicPreprocessorDirectives, StorageIndex.
|
||||
*/
|
||||
|
||||
typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE Index;
|
||||
|
||||
namespace internal {
|
||||
|
||||
template<typename IndexDest, typename IndexSrc>
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline IndexDest convert_index(const IndexSrc& idx) {
|
||||
// for sizeof(IndexDest)>=sizeof(IndexSrc) compilers should be able to optimize this away:
|
||||
eigen_internal_assert(idx <= NumTraits<IndexDest>::highest() && "Index value to big for target type");
|
||||
return IndexDest(idx);
|
||||
}
|
||||
|
||||
|
||||
//classes inheriting no_assignment_operator don't generate a default operator=.
|
||||
class no_assignment_operator
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user