Changeset 3290


Ignore:
Timestamp:
Jul 12, 2014, 7:59:16 PM (9 years ago)
Author:
Peter
Message:

refs #803. Correct docs and reflect that random access iterators are needed. Change test and concept schecks to use boost concepts.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization.cc

    r3289 r3290  
    374374  // compile test should not be run
    375375  if (false) {
    376     gauss(boost::random_access_iterator_archetype<double>(),
    377           boost::random_access_iterator_archetype<double>(),
    378           boost::mutable_random_access_iterator_archetype<double>());
    379     using utility::DataWeight;
    380     gauss(boost::random_access_iterator_archetype<DataWeight>(),
    381           boost::random_access_iterator_archetype<DataWeight>(),
    382           boost::mutable_random_access_iterator_archetype<DataWeight>());
    383     gauss(boost::random_access_iterator_archetype<DataWeight>(),
    384           boost::random_access_iterator_archetype<DataWeight>(),
    385           boost::mutable_random_access_iterator_archetype<double>());
    386     gauss(boost::random_access_iterator_archetype<double>(),
    387           boost::random_access_iterator_archetype<double>(),
    388           boost::mutable_random_access_iterator_archetype<DataWeight>());
     376    using boost::iterator_archetype;
     377    iterator_archetype<double,
     378                       boost::iterator_archetypes::readable_iterator_t,
     379                       boost::random_access_traversal_tag>
     380      readable_iterator;
     381
     382    iterator_archetype<double,
     383                       boost::iterator_archetypes::readable_writable_iterator_t,
     384                       boost::random_access_traversal_tag>
     385      writable_iterator;
     386
     387    // We have to use lvalue here because otherwise proxy classes
     388    // provided by boost kick in and they do not provide the needed
     389    // data() and weight() functions that e.g. DataWeightProxy does.
     390    iterator_archetype<utility::DataWeight,
     391                       boost::iterator_archetypes::readable_lvalue_iterator_t,
     392                       boost::random_access_traversal_tag>
     393      weighted_readable_iterator;
     394
     395    iterator_archetype<utility::DataWeight,
     396                       boost::iterator_archetypes::writable_lvalue_iterator_t,
     397                       boost::random_access_traversal_tag>
     398      weighted_writable_iterator;
     399
     400    gauss(readable_iterator, readable_iterator, writable_iterator);
     401    gauss(readable_iterator, readable_iterator, weighted_writable_iterator);
     402    gauss(weighted_readable_iterator, weighted_readable_iterator,
     403          writable_iterator);
     404    gauss(weighted_readable_iterator, weighted_readable_iterator,
     405          weighted_writable_iterator);
    389406  }
    390407}
  • trunk/yat/normalizer/Gauss.h

    r2992 r3290  
    4343     After normalization the range will follow a standard Gaussian
    4444     distribution (mean zero and unity variance).
    45      
     45
    4646     The range is first rank normalized using Spearman, after which
    4747     each element is between 0 and unity. Second each element is
    4848     replaced by inverse cumulative standard Gaussian distribution.
    49      
     49
    5050     \since New in yat 0.5
    5151   */
     
    5858       same.
    5959
    60        Type requirements:
    61        - ForwardIterator must be a \forward_iterator and a \ref
    62        concept_data_iterator.
    63        - RandomAccessIterator must be a mutable \random_access_iterator
    64          and a \ref concept_data_iterator.
     60       Type Requirements:
     61       - \c RandomAccessIter1 is \readable_iterator
     62       - \c RandomAccessIter1 is \random_access_traversal_iterator
     63       - \c RandomAccessIter1 is \ref concept_data_iterator
     64       - \c RandomAccessIter2 is \readable_iterator
     65       - \c RandomAccessIter2 is \writable_iterator
     66       - \c RandomAccessIter2 is \random_access_traversal_iterator
     67       - \c RandomAccessIter2 is \ref concept_data_iterator
    6568
    6669       \see gsl_cdf_ugaussian_Pinv
     
    7073                    RandomAccessIter2 result) const
    7174    {
    72       BOOST_CONCEPT_ASSERT((utility::DataIteratorConcept<RandomAccessIter1>));
    73       BOOST_CONCEPT_ASSERT((utility::DataIteratorConcept<RandomAccessIter2>));
    74       BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<RandomAccessIter1>));
    75       BOOST_CONCEPT_ASSERT((boost::Mutable_RandomAccessIterator<RandomAccessIter2>));
    7675      Spearman spearman;
    7776      spearman(first, last, result);
Note: See TracChangeset for help on using the changeset viewer.