mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-30 07:44:10 +08:00
Silenced some compilation warnings
This commit is contained in:
parent
e896c0ade7
commit
590f4b0aa3
@ -124,18 +124,18 @@ struct tuple_coeff<0> {
|
|||||||
update_value(std::get<0>(t), value);
|
update_value(std::get<0>(t), value);
|
||||||
}
|
}
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
static constexpr bool value_known_statically(const DenseIndex i, const std::tuple<T...>& t) {
|
static constexpr bool value_known_statically(const DenseIndex i, const std::tuple<T...>&) {
|
||||||
// eigen_assert (i == 0); // gcc fails to compile assertions in constexpr
|
// eigen_assert (i == 0); // gcc fails to compile assertions in constexpr
|
||||||
return is_compile_time_constant<typename std::tuple_element<0, std::tuple<T...> >::type>::value & (i == 0);
|
return is_compile_time_constant<typename std::tuple_element<0, std::tuple<T...> >::type>::value & (i == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
static constexpr bool values_up_to_known_statically(const std::tuple<T...>& t) {
|
static constexpr bool values_up_to_known_statically(const std::tuple<T...>&) {
|
||||||
return is_compile_time_constant<typename std::tuple_element<0, std::tuple<T...> >::type>::value;
|
return is_compile_time_constant<typename std::tuple_element<0, std::tuple<T...> >::type>::value;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
static constexpr bool values_up_to_statically_known_to_increase(const std::tuple<T...>& t) {
|
static constexpr bool values_up_to_statically_known_to_increase(const std::tuple<T...>&) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -271,7 +271,7 @@ template <typename FirstType, typename... OtherTypes>
|
|||||||
struct index_statically_eq<IndexList<FirstType, OtherTypes...> > {
|
struct index_statically_eq<IndexList<FirstType, OtherTypes...> > {
|
||||||
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
||||||
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
||||||
IndexList<FirstType, OtherTypes...>()[i] == value;
|
(IndexList<FirstType, OtherTypes...>()[i] == value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ template <typename FirstType, typename... OtherTypes>
|
|||||||
struct index_statically_eq<const IndexList<FirstType, OtherTypes...> > {
|
struct index_statically_eq<const IndexList<FirstType, OtherTypes...> > {
|
||||||
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
||||||
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
||||||
IndexList<FirstType, OtherTypes...>()[i] == value;
|
(IndexList<FirstType, OtherTypes...>()[i] == value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -294,7 +294,7 @@ template <typename FirstType, typename... OtherTypes>
|
|||||||
struct index_statically_ne<IndexList<FirstType, OtherTypes...> > {
|
struct index_statically_ne<IndexList<FirstType, OtherTypes...> > {
|
||||||
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
||||||
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
||||||
IndexList<FirstType, OtherTypes...>()[i] != value;
|
(IndexList<FirstType, OtherTypes...>()[i] != value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ template <typename FirstType, typename... OtherTypes>
|
|||||||
struct index_statically_ne<const IndexList<FirstType, OtherTypes...> > {
|
struct index_statically_ne<const IndexList<FirstType, OtherTypes...> > {
|
||||||
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
||||||
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
||||||
IndexList<FirstType, OtherTypes...>()[i] != value;
|
(IndexList<FirstType, OtherTypes...>()[i] != value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ template <typename FirstType, typename... OtherTypes>
|
|||||||
struct index_statically_gt<IndexList<FirstType, OtherTypes...> > {
|
struct index_statically_gt<IndexList<FirstType, OtherTypes...> > {
|
||||||
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
||||||
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
||||||
IndexList<FirstType, OtherTypes...>()[i] > value;
|
(IndexList<FirstType, OtherTypes...>()[i] > value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ template <typename FirstType, typename... OtherTypes>
|
|||||||
struct index_statically_gt<const IndexList<FirstType, OtherTypes...> > {
|
struct index_statically_gt<const IndexList<FirstType, OtherTypes...> > {
|
||||||
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
||||||
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
||||||
IndexList<FirstType, OtherTypes...>()[i] > value;
|
(IndexList<FirstType, OtherTypes...>()[i] > value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ template <typename FirstType, typename... OtherTypes>
|
|||||||
struct index_statically_lt<IndexList<FirstType, OtherTypes...> > {
|
struct index_statically_lt<IndexList<FirstType, OtherTypes...> > {
|
||||||
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
||||||
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
||||||
IndexList<FirstType, OtherTypes...>()[i] < value;
|
(IndexList<FirstType, OtherTypes...>()[i] < value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ template <typename FirstType, typename... OtherTypes>
|
|||||||
struct index_statically_lt<const IndexList<FirstType, OtherTypes...> > {
|
struct index_statically_lt<const IndexList<FirstType, OtherTypes...> > {
|
||||||
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
constexpr bool operator() (const DenseIndex i, const DenseIndex value) const {
|
||||||
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &
|
||||||
IndexList<FirstType, OtherTypes...>()[i] < value;
|
(IndexList<FirstType, OtherTypes...>()[i] < value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,18 +55,6 @@ struct Initializer<Derived, 1> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Derived>
|
|
||||||
struct Initializer<Derived, Dynamic> {
|
|
||||||
typedef std::initializer_list<typename traits<Derived>::Scalar> InitList;
|
|
||||||
|
|
||||||
static void run(TensorEvaluator<Derived, DefaultDevice>& tensor,
|
|
||||||
Eigen::array<typename traits<Derived>::Index, traits<Derived>::NumDimensions>* indices,
|
|
||||||
const InitList& vals) {
|
|
||||||
// Static initialization not implemented for VarDims tensors.
|
|
||||||
eigen_assert(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Derived, int N>
|
template <typename Derived, int N>
|
||||||
void initialize_tensor(TensorEvaluator<Derived, DefaultDevice>& tensor,
|
void initialize_tensor(TensorEvaluator<Derived, DefaultDevice>& tensor,
|
||||||
const typename Initializer<Derived, traits<Derived>::NumDimensions>::InitList& vals) {
|
const typename Initializer<Derived, traits<Derived>::NumDimensions>::InitList& vals) {
|
||||||
|
@ -129,7 +129,7 @@ struct InnerMostDimReducer<Self, Op, true> {
|
|||||||
|
|
||||||
template <int DimIndex, typename Self, typename Op, bool vectorizable = (Self::InputPacketAccess & Op::PacketAccess)>
|
template <int DimIndex, typename Self, typename Op, bool vectorizable = (Self::InputPacketAccess & Op::PacketAccess)>
|
||||||
struct InnerMostDimPreserver {
|
struct InnerMostDimPreserver {
|
||||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const Self& self, typename Self::Index firstIndex, Op& reducer, typename Self::PacketReturnType* accum) {
|
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const Self&, typename Self::Index, Op&, typename Self::PacketReturnType*) {
|
||||||
eigen_assert(false && "should never be called");
|
eigen_assert(false && "should never be called");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user