Changement d'appelation entre les poids MinWeight et MaxWeight

This commit is contained in:
Thibaud Balem 2018-06-05 16:28:48 +02:00
parent 9d76b1ad03
commit 4776043ad6
2 changed files with 12 additions and 11 deletions

View File

@ -47,13 +47,12 @@ namespace otb {
/*! Structure intégrant la façon dont est géré un poids pour un MinTree */
template <typename PixelT, typename WeightT> struct MaxWeight : public WeightBase<PixelT, WeightT> {
typedef WeightBase<PixelT, WeightT> WB;
inline bool getDecr () const;
static inline bool isWeightInf (const WeightT &a, const WeightT &b);
static inline bool isEdgeInf (const Edge<WeightT> &a, const Edge<WeightT> &b);
static inline void sort (Edge<WeightT> *edges, DimEdge count);
inline MaxWeight ();
inline MaxWeight();
inline MaxWeight (const PixelT *pixels, const Size &size);
inline MaxWeight (const MaxWeight &model, const PixelT *pixels, const Size &size);
@ -66,6 +65,8 @@ namespace otb {
template <typename PixelT, typename WeightT> struct MinWeight : public WeightBase<PixelT, WeightT> {
typedef WeightBase<PixelT, WeightT> WB;
inline bool getDecr () const;
inline MinWeight ();
inline MinWeight (const PixelT *pixels, const Size &size);
inline MinWeight (const MinWeight &model, const PixelT *pixels, const Size &size);

View File

@ -99,12 +99,6 @@ WeightBase<PixelT, WeightT>::weight2valueBound (PixelT *compAPTree, const Weight
}
// ========================================
template <typename PixelT, typename WeightT>
inline bool
MaxWeight<PixelT, WeightT>::getDecr () const {
return true;
}
template <typename PixelT, typename WeightT>
inline bool
MaxWeight<PixelT, WeightT>::isWeightInf (const WeightT &a, const WeightT &b) {
@ -150,11 +144,17 @@ MaxWeight<PixelT, WeightT>::getWeight (const DimImg &idx) const {
template <typename PixelT, typename WeightT>
inline WeightT
MaxWeight<PixelT, WeightT>::getWeight (const Point &a, const Point &b) const {
return std::min (getWeight (WB::pointIdx (a)),
return std::max (getWeight (WB::pointIdx (a)),
getWeight (WB::pointIdx (b)));
}
// ========================================
template <typename PixelT, typename WeightT>
inline bool
MinWeight<PixelT, WeightT>::getDecr () const {
return true;
}
template <typename PixelT, typename WeightT>
inline
MinWeight<PixelT, WeightT>::MinWeight ()
@ -182,7 +182,7 @@ MinWeight<PixelT, WeightT>::getWeight (const DimImg &idx) const {
template <typename PixelT, typename WeightT>
inline WeightT
MinWeight<PixelT, WeightT>::getWeight (const Point &a, const Point &b) const {
return std::max (getWeight (WB::pointIdx (a)),
return std::min (getWeight (WB::pointIdx (a)),
getWeight (WB::pointIdx (b)));
}