Opened 14 years ago
Closed 14 years ago
#453 closed enhancement (wontfix)
avoid self-assignment of weights in 1D-normalizers
Reported by: | Peter | Owned by: | Peter |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | normalizer | Version: | trunk |
Keywords: | Cc: |
Description
All current 1D-normalizers: Centralizer, Gauss, Spearman, and Zscore, all include an assignment of the weights in which the weights are not modified but only copied from input to output. As it is quite common that input range is the same as output range, it makes sense if we could avoid self assignment of the weight part.
Change History (2)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Milestone: | yat 0.x+ |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
This seems difficult to accomplish in constant time, and if it can't be done in constant time there is no point in doing it.
The problem boils down to the following: Say that we have some function
and we want to check if
[first1, last1)
are pointing to same elements as[first2, first2+ last1-first1)
. A naive attempt would be to check 'first1==first2
', which would work in most cases. Not in all cases though. For example, when having aStrideIterator
the strides could be different so although the first element are the same, the following elements are different. Similarly having aboost::permutation_iterator
could cause problems.One could, of course, implement this speed-up and leave this weakness as a documented requirement on input ranges. Of note is that there are already requirements on how the input ranges may overlap: first2+n is not permitted to be pointing to same element as any of (first1+n, last1) (it may be same as first1+n).