Changeset 2155


Ignore:
Timestamp:
Jan 18, 2010, 12:22:10 AM (12 years ago)
Author:
Peter
Message:

Spearman now works with mixed iterators. refs #498

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r2152 r2155  
    425425             boost::random_access_iterator_archetype<DataWeight>(),
    426426             boost::mutable_random_access_iterator_archetype<DataWeight>());
     427    spearman(boost::random_access_iterator_archetype<double>(),
     428             boost::random_access_iterator_archetype<double>(),
     429             boost::mutable_random_access_iterator_archetype<DataWeight>());
     430    spearman(boost::random_access_iterator_archetype<DataWeight>(),
     431             boost::random_access_iterator_archetype<DataWeight>(),
     432             boost::mutable_random_access_iterator_archetype<double>());
    427433  }
    428434
  • trunk/yat/normalizer/Makefile.am

    r2121 r2155  
    2727include_normalizer_HEADERS = Centralizer.h ColumnNormalizer.h \
    2828  Gauss.h qQuantileNormalizer.h QuantileNormalizer.h RowNormalizer.h  \
    29   Spearman.h Zscore.h
     29  Spearman.h utility.h Zscore.h
    3030
    3131DISTCLEANFILES = doxygen.mk
  • trunk/yat/normalizer/Spearman.h

    r2154 r2155  
    2323  along with yat. If not, see <http://www.gnu.org/licenses/>.
    2424*/
     25
     26#include "utility.h"
    2527
    2628#include "yat/utility/DataIterator.h"
     
    7274      BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<RandomAccessIter1>));
    7375      BOOST_CONCEPT_ASSERT((boost::Mutable_RandomAccessIterator<RandomAccessIter2>));
    74       typename utility::weighted_iterator_traits<RandomAccessIter1>::type tag;
     76      using utility::weighted_if_any2;
     77      typename weighted_if_any2<RandomAccessIter1,RandomAccessIter2>::type tag;
    7578      normalize(first, last, result, tag);
    7679    }
     
    105108                   utility::weighted_iterator_tag) const
    106109    {
    107       std::copy(utility::weight_iterator(first),
    108                 utility::weight_iterator(last),
    109                 utility::weight_iterator(result));
     110      detail::copy_weight_if_weighted(first, last, result);
    110111      std::vector<double> input_vec;
    111112      input_vec.reserve(last-first);
Note: See TracChangeset for help on using the changeset viewer.