Changeset 2703


Ignore:
Timestamp:
Mar 12, 2012, 7:43:10 AM (12 years ago)
Author:
Peter
Message:

merge release 0.8.1 into trunk

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/NEWS

    r2673 r2703  
    99
    1010yat 0.8.x series from http://dev.thep.lu.se/yat/svn/branches/0.8-stable
     11
     12version 0.8.1 (released 12 March 2012)
     13  - Fixed bug that GFF::attribute was only loaded first time (see bug #697)
     14
     15  A complete list of closed tickets can be found here [[br]]
     16  http://dev.thep.lu.se/yat/query?status=closed&milestone=yat+0.8.1
     17
    1118
    1219version 0.8 (released 2 December 2011)
     
    239246Copyright (C) 2003, 2006 Jari Häkkinen
    240247Copyright (C) 2007, 2008, 2009 Jari Häkkinen, Peter Johansson
    241 Copyright (C) 2010, 2011 Peter Johansson
     248Copyright (C) 2010, 2011, 2012 Peter Johansson
    242249
    243250This file is part of yat library, http://dev.thep.lu.se/yat
  • trunk/build_support/tag_and_release.sh.in

    r2673 r2703  
    5757@AUTOCONF@ --version | head -n 1 | sed -e 's/.*(//' -e 's/)//'
    5858@AUTOMAKE@ --version | head -n 1 | sed -e 's/.*(//' -e 's/)//'
    59 @LIBTOOL@ --version | head -n 1 | sed -e 's/.*(//' -e 's/)//'
     59@srcdir@/libtool --version | head -n 1 | sed -e 's/.*(//' -e 's/)//'
    6060cat <<EOF
    6161
  • trunk/doc/deprecated.doxygen

    r2579 r2703  
    2020
    2121/**
    22 \page yat_deprecated YAT_DEPRECATED
     22\page yat_deprecate YAT_DEPRECATE
    2323
    2424Sometimes it may be necassary to remove a function or a class. In this
  • trunk/m4/version.m4

    r2673 r2703  
    22#
    33# Copyright (C) 2008, 2009 Jari Häkkinen, Peter Johansson
    4 # Copyright (C) 2010, 2011 Peter Johansson
     4# Copyright (C) 2010, 2011, 2012 Peter Johansson
    55#
    66# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    7070# yat-0.7.3  4:3:0
    7171# yat-0.8.0  5:0:0
     72# yat-0.8.1  5:1:0
    7273#
    7374# *Accidently, the libtool number was not updated for yat 0.5
  • trunk/test/commandline.cc

    r2673 r2703  
    33/*
    44  Copyright (C) 2007, 2008, 2009 Jari Häkkinen, Peter Johansson
    5   Copyright (C) 2010, 2011 Peter Johansson
     5  Copyright (C) 2010, 2011, 2012 Peter Johansson
    66
    77  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    736736
    737737  suite.err() << "Testing OptionFile '" << perm << "' ... ";
     738  if (yat::test::run_as_root()) {
     739    suite.err() << "skipped because user is root\n";
     740    return true;
     741  }
    738742  try {
    739743    int ac = 3;
  • trunk/test/gff.cc

    r2483 r2703  
    22
    33/*
    4   Copyright (C) 2011 Peter Johansson
     4  Copyright (C) 2011, 2012 Peter Johansson
    55
    66  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    3939template<class T>
    4040void test_gff(test::Suite&, GFF&);
     41void test_ticket697(test::Suite&);
    4142
    4243int main(int argc, char* argv[])
     
    4647  gff2(suite);
    4748  gff3(suite);
     49  test_ticket697(suite);
    4850
    4951  return suite.return_value();
     
    9597  is.close();
    9698}
     99
     100
     101void test_ticket697(test::Suite& suite)
     102{
     103  suite.out() << "test ticket 697\n";
     104  GFF2 gff;
     105  std::ifstream is(test::filename("data/small.gff2").c_str());
     106  assert(is);
     107  getline(is, gff);
     108  if (gff.attribute("genotype")!="T or C") {
     109    suite.add(false);
     110    suite.err() << "error: incorrect genotype: '" << gff.attribute("genotype")
     111                << "'; expected: 'T or C'\n";
     112  }
     113  getline(is, gff);
     114  if (gff.attribute("genotype")!="T") {
     115    suite.add(false);
     116    suite.err() << "error: incorrect genotype: '" << gff.attribute("genotype")
     117                << "'; expected: 'T'\n";
     118  }
     119  is.close();
     120}
  • trunk/yat/omic/GFF.cc

    r2596 r2703  
    22
    33/*
    4   Copyright (C) 2011 Peter Johansson
     4  Copyright (C) 2011, 2012 Peter Johansson
    55
    66  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    165165    gff.vec_.clear();
    166166    utility::split(gff.vec_, line, '\t');
     167    gff.attributes_.clear();
    167168    return true;
    168169  }
  • trunk/yat/utility/SegmentMap.h

    r2362 r2703  
    55
    66/*
    7   Copyright (C) 2010 Peter Johansson
     7  Copyright (C) 2010, 2012 Peter Johansson
    88
    99  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    4141   */
    4242  template<typename T, typename Tp, class Compare = std::less<T> >
    43   class SegmentMap 
    44     : public SegmentTree<std::map<Segment<T, Compare>, Tp, 
     43  class SegmentMap
     44    : public SegmentTree<std::map<Segment<T, Compare>, Tp,
    4545                                  SegmentCompare<T, Compare> >,
    4646                   Compare,
     
    5050    /// mapped type
    5151    typedef Tp mapped_type;
    52    
     52
    5353    /**
    5454       \brief creates a set with no segments
  • trunk/yat/utility/SegmentTree.h

    r2613 r2703  
    55
    66/*
    7   Copyright (C) 2010, 2011 Peter Johansson
     7  Copyright (C) 2010, 2011, 2012 Peter Johansson
    88
    99  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    4343   */
    4444  template<class Container, class Compare, class Value2Key>
    45   class SegmentTree 
     45  class SegmentTree
    4646  {
    4747  public:
    48     /// \brief key type
     48    /**
     49       \brief key type is same as \c Container 's \c key_type.
     50
     51       Typically Segment<element_type>.
     52    */
    4953    typedef typename Container::key_type key_type;
    50     /// \brief value type
     54
     55    /**
     56       \brief value type is same as \c Container 's \c value_type.
     57
     58       Typically a Segment<element_type> or pair<const
     59       Segment<element_type>, Data>.
     60    */
    5161    typedef typename Container::value_type value_type;
    52     /// \brief element type
     62
     63    /**
     64       \brief element type is same as \c key_type 's value_type.
     65
     66       If the key held is \c Segment<T>, \c value_type is \c T.
     67    */
    5368    typedef typename key_type::value_type element_type;
    5469
    55     /// \brief key compare
     70    ///  \brief key compare
    5671    typedef typename Container::key_compare key_compare;
    5772    /// \brief value compare
     
    7691
    7792    /**
    78        \brief creates a container with no segments
     93       \brief creates a SegmentTree with no segments
    7994     */
    8095    SegmentTree(void) {}
     
    86101
    87102    /**
    88        \return const iterator to first Segment
     103       \return const iterator pointing to beginning of container
    89104     */
    90105    const_iterator begin(void) const { return container_.begin(); }
    91106
    92107    /**
    93        \return iterator to first Segment
     108       \return iterator pointing to beginning of container
    94109     */
    95110    iterator begin(void) { return container_.begin(); }
    96111
    97112    /**
    98        \brief erases all segments
     113       \brief erases all values
    99114     */
    100115    void clear(void) { container_.clear(); }
    101116
    102117    /**
    103        \return 1 if there is a set that overlaps with \a element
     118       \return 1 if there is a Segment that overlaps with \a element
    104119     */
    105120    size_type count(const element_type& element) const;
     
    111126
    112127    /**
    113        \return end of set
     128       \return a const_iterator pointing to the end of container
    114129     */
    115130    const_iterator end(void) const { return container_.end(); }
    116131
    117132    /**
    118        \return end of set
     133       \return end of container
    119134     */
    120135    iterator end(void) { return container_.end(); }
    121136
    122137    /**
    123        erase segments in range [first, last)
     138       \brief erase values in range [first, last)
    124139
    125140       \since New in yat 0.8
     
    128143
    129144    /**
    130        erase segment pointed to by \a pos
     145       erase value pointed to by \a pos
    131146
    132147       \since New in yat 0.8
     
    135150
    136151    /**
     152       \return iterator pointing to value containing \a element
     153
     154       If no value contains \a element, end() is returned.
     155     */
     156    iterator find(const element_type& element);
     157
     158    /**
     159       \return const iterator pointing to value containing \a element
     160
     161       If no value contains \a element, end() is returned.
     162
    137163       \return an iterator pointing to the Segment that contains \a
    138164       vt. If no Segment contains \a vt, end() is returned.
    139 
    140        \since New in yat 0.8
    141      */
    142     iterator find(const element_type& vt);
    143 
    144     /**
    145        \return an iterator pointing to the Segment that contains \a
    146        vt. If no Segment contains \a vt, end() is returned.
    147165     */
    148166    const_iterator find(const element_type& vt) const;
    149167
    150168    /**
    151        \brief insert value 
    152 
    153        if \a segment does not overlap with any segment in set, insert
     169       \brief insert value
     170
     171       if \a value does not overlap with container, insert
    154172       segment; otherwise do nothing.
    155173
    156        \return a pair where pair.first points to the added \a segment
    157        or if \a segment was not added it points to a Segment in set
    158        that overlaps with \a segment; pair.second is true if \a
    159        segment was added.
    160      */
    161     std::pair<iterator, bool> insert(const value_type& segment);
    162 
    163     /**
    164        \return Comparison functor to compare to segments
    165      */
    166     key_compare key_comp(void) const 
    167     { 
     174       \return a pair where pair.first points to the inserted \a value
     175       or if \a value was not inserted it points to a value in
     176       container that overlaps with \a value; pair.second is true if
     177       \a value was inserted.
     178     */
     179    std::pair<iterator, bool> insert(const value_type& value);
     180
     181    /**
     182       \return Comparison functor to compare two keys (Segment)
     183     */
     184    key_compare key_comp(void) const
     185    {
    168186      return key_compare(compare);
    169187    }
    170188
    171189    /**
    172        \return iterator pointing to first segment that overlaps with
    173        \a element or is greater than \a element.
     190       \brief similar to lower_bound in std::set and std::map
     191
     192       \return iterator pointing to first value whose key overlaps
     193       with \a element or is greater than \a element.
    174194     */
    175195    iterator lower_bound(const element_type& element);
    176196
    177197    /**
    178        \return iterator pointing to first segment that overlaps with
    179        \a element or is greater than \a element.
     198       \brief similar to lower_bound in std::set and std::map
     199
     200       \return const iterator pointing to first value whose key
     201       overlaps with \a element or is greater than \a element.
    180202     */
    181203    const_iterator lower_bound(const element_type& element) const;
    182204
    183205    /**
    184        \return number of segments in set
     206       \return number of values in container
    185207     */
    186208    size_type size(void) const { return container_.size(); }
     
    193215
    194216    /**
    195        \return iterator pointing to first segment that is greater than
    196        \a segment.
     217       \brief similar to upper_bound in std::set and std::map
     218
     219       \return iterator pointing to first value whose key is greater
     220       than \a element.
    197221     */
    198222    const_iterator upper_bound(const element_type& element) const;
    199223
    200224    /**
    201        \return Comparison functor to compare to segments
     225       \brief similar to upper_bound in std::set and std::map
     226
     227       \return iterator pointing to first value whose key is greater
     228       than \a element.
    202229     */
    203230    value_compare value_comp(void) const { return key_comp(); }
     
    212239       overlap with \a segment.
    213240     */
    214     std::pair<iterator, iterator> overlap_range(const key_type& segment) 
     241    std::pair<iterator, iterator> overlap_range(const key_type& segment)
    215242    {
    216243      iterator first = container_.lower_bound(segment);
     
    233260
    234261  template<class Container, class Compare, class Value2Key>
    235   typename SegmentTree<Container, Compare, Value2Key>::size_type 
     262  typename SegmentTree<Container, Compare, Value2Key>::size_type
    236263  SegmentTree<Container,Compare,Value2Key>::count(const element_type& element) const
    237264  {
     
    243270
    244271  template<class Container, class Compare, class Value2Key>
    245   typename SegmentTree<Container, Compare, Value2Key>::const_iterator 
     272  typename SegmentTree<Container, Compare, Value2Key>::const_iterator
    246273  SegmentTree<Container, Compare, Value2Key>::find(const element_type& vt) const
    247274  {
     
    256283
    257284  template<class Container, class Compare, class Value2Key>
    258   typename SegmentTree<Container, Compare, Value2Key>::iterator 
     285  typename SegmentTree<Container, Compare, Value2Key>::iterator
    259286  SegmentTree<Container, Compare, Value2Key>::find(const element_type& vt)
    260287  {
     
    268295
    269296  template<typename T, class Compare, class Value2Key>
    270   std::pair<typename SegmentTree<T, Compare, Value2Key>::iterator, bool> 
     297  std::pair<typename SegmentTree<T, Compare, Value2Key>::iterator, bool>
    271298  SegmentTree<T, Compare,Value2Key>::insert(const value_type& segment)
    272299  {
     
    282309    iterator result = container_.lower_bound(segment);
    283310    // result is larger or overlapping with segment (i.e.! result<segment)
    284     YAT_ASSERT(result==end() 
     311    YAT_ASSERT(result==end()
    285312               || !compare(Value2Key()(*result),segment));
    286313    return result;
     
    295322    const_iterator result = container_.lower_bound(segment);
    296323    // result is larger or overlapping with segment (i.e.! result<segment)
    297     YAT_ASSERT(result==end() 
     324    YAT_ASSERT(result==end()
    298325               || !compare(Value2Key()(*result),segment));
    299326    return result;
Note: See TracChangeset for help on using the changeset viewer.