Changeset 2703
- Timestamp:
- Mar 12, 2012, 7:43:10 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/0.8-stable merged: 2674-2676,2681-2685,2699-2701
- Property svn:mergeinfo changed
-
trunk/NEWS
r2673 r2703 9 9 10 10 yat 0.8.x series from http://dev.thep.lu.se/yat/svn/branches/0.8-stable 11 12 version 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 11 18 12 19 version 0.8 (released 2 December 2011) … … 239 246 Copyright (C) 2003, 2006 Jari Häkkinen 240 247 Copyright (C) 2007, 2008, 2009 Jari Häkkinen, Peter Johansson 241 Copyright (C) 2010, 2011 Peter Johansson248 Copyright (C) 2010, 2011, 2012 Peter Johansson 242 249 243 250 This file is part of yat library, http://dev.thep.lu.se/yat -
trunk/build_support/tag_and_release.sh.in
r2673 r2703 57 57 @AUTOCONF@ --version | head -n 1 | sed -e 's/.*(//' -e 's/)//' 58 58 @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/)//' 60 60 cat <<EOF 61 61 -
trunk/doc/deprecated.doxygen
r2579 r2703 20 20 21 21 /** 22 \page yat_deprecate d YAT_DEPRECATED22 \page yat_deprecate YAT_DEPRECATE 23 23 24 24 Sometimes it may be necassary to remove a function or a class. In this -
trunk/m4/version.m4
r2673 r2703 2 2 # 3 3 # Copyright (C) 2008, 2009 Jari Häkkinen, Peter Johansson 4 # Copyright (C) 2010, 2011 Peter Johansson4 # Copyright (C) 2010, 2011, 2012 Peter Johansson 5 5 # 6 6 # This file is part of the yat library, http://dev.thep.lu.se/yat … … 70 70 # yat-0.7.3 4:3:0 71 71 # yat-0.8.0 5:0:0 72 # yat-0.8.1 5:1:0 72 73 # 73 74 # *Accidently, the libtool number was not updated for yat 0.5 -
trunk/test/commandline.cc
r2673 r2703 3 3 /* 4 4 Copyright (C) 2007, 2008, 2009 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2010, 2011 Peter Johansson5 Copyright (C) 2010, 2011, 2012 Peter Johansson 6 6 7 7 This file is part of the yat library, http://dev.thep.lu.se/yat … … 736 736 737 737 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 } 738 742 try { 739 743 int ac = 3; -
trunk/test/gff.cc
r2483 r2703 2 2 3 3 /* 4 Copyright (C) 2011 Peter Johansson4 Copyright (C) 2011, 2012 Peter Johansson 5 5 6 6 This file is part of the yat library, http://dev.thep.lu.se/yat … … 39 39 template<class T> 40 40 void test_gff(test::Suite&, GFF&); 41 void test_ticket697(test::Suite&); 41 42 42 43 int main(int argc, char* argv[]) … … 46 47 gff2(suite); 47 48 gff3(suite); 49 test_ticket697(suite); 48 50 49 51 return suite.return_value(); … … 95 97 is.close(); 96 98 } 99 100 101 void 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 2 2 3 3 /* 4 Copyright (C) 2011 Peter Johansson4 Copyright (C) 2011, 2012 Peter Johansson 5 5 6 6 This file is part of the yat library, http://dev.thep.lu.se/yat … … 165 165 gff.vec_.clear(); 166 166 utility::split(gff.vec_, line, '\t'); 167 gff.attributes_.clear(); 167 168 return true; 168 169 } -
trunk/yat/utility/SegmentMap.h
r2362 r2703 5 5 6 6 /* 7 Copyright (C) 2010 Peter Johansson7 Copyright (C) 2010, 2012 Peter Johansson 8 8 9 9 This file is part of the yat library, http://dev.thep.lu.se/yat … … 41 41 */ 42 42 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, 45 45 SegmentCompare<T, Compare> >, 46 46 Compare, … … 50 50 /// mapped type 51 51 typedef Tp mapped_type; 52 52 53 53 /** 54 54 \brief creates a set with no segments -
trunk/yat/utility/SegmentTree.h
r2613 r2703 5 5 6 6 /* 7 Copyright (C) 2010, 2011 Peter Johansson7 Copyright (C) 2010, 2011, 2012 Peter Johansson 8 8 9 9 This file is part of the yat library, http://dev.thep.lu.se/yat … … 43 43 */ 44 44 template<class Container, class Compare, class Value2Key> 45 class SegmentTree 45 class SegmentTree 46 46 { 47 47 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 */ 49 53 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 */ 51 61 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 */ 53 68 typedef typename key_type::value_type element_type; 54 69 55 /// \brief key compare70 /// \brief key compare 56 71 typedef typename Container::key_compare key_compare; 57 72 /// \brief value compare … … 76 91 77 92 /** 78 \brief creates a containerwith no segments93 \brief creates a SegmentTree with no segments 79 94 */ 80 95 SegmentTree(void) {} … … 86 101 87 102 /** 88 \return const iterator to first Segment103 \return const iterator pointing to beginning of container 89 104 */ 90 105 const_iterator begin(void) const { return container_.begin(); } 91 106 92 107 /** 93 \return iterator to first Segment108 \return iterator pointing to beginning of container 94 109 */ 95 110 iterator begin(void) { return container_.begin(); } 96 111 97 112 /** 98 \brief erases all segments113 \brief erases all values 99 114 */ 100 115 void clear(void) { container_.clear(); } 101 116 102 117 /** 103 \return 1 if there is a set that overlaps with \a element118 \return 1 if there is a Segment that overlaps with \a element 104 119 */ 105 120 size_type count(const element_type& element) const; … … 111 126 112 127 /** 113 \return end of set128 \return a const_iterator pointing to the end of container 114 129 */ 115 130 const_iterator end(void) const { return container_.end(); } 116 131 117 132 /** 118 \return end of set133 \return end of container 119 134 */ 120 135 iterator end(void) { return container_.end(); } 121 136 122 137 /** 123 erase segments in range [first, last)138 \brief erase values in range [first, last) 124 139 125 140 \since New in yat 0.8 … … 128 143 129 144 /** 130 erase segmentpointed to by \a pos145 erase value pointed to by \a pos 131 146 132 147 \since New in yat 0.8 … … 135 150 136 151 /** 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 137 163 \return an iterator pointing to the Segment that contains \a 138 164 vt. If no Segment contains \a vt, end() is returned. 139 140 \since New in yat 0.8141 */142 iterator find(const element_type& vt);143 144 /**145 \return an iterator pointing to the Segment that contains \a146 vt. If no Segment contains \a vt, end() is returned.147 165 */ 148 166 const_iterator find(const element_type& vt) const; 149 167 150 168 /** 151 \brief insert value 152 153 if \a segment does not overlap with any segment in set, insert169 \brief insert value 170 171 if \a value does not overlap with container, insert 154 172 segment; otherwise do nothing. 155 173 156 \return a pair where pair.first points to the added \a segment157 or if \a segment was not added it points to a Segment in set158 that overlaps with \a segment; pair.second is true if \a159 segment was added.160 */ 161 std::pair<iterator, bool> insert(const value_type& segment);162 163 /** 164 \return Comparison functor to compare t o segments165 */ 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 { 168 186 return key_compare(compare); 169 187 } 170 188 171 189 /** 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. 174 194 */ 175 195 iterator lower_bound(const element_type& element); 176 196 177 197 /** 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. 180 202 */ 181 203 const_iterator lower_bound(const element_type& element) const; 182 204 183 205 /** 184 \return number of segments in set206 \return number of values in container 185 207 */ 186 208 size_type size(void) const { return container_.size(); } … … 193 215 194 216 /** 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. 197 221 */ 198 222 const_iterator upper_bound(const element_type& element) const; 199 223 200 224 /** 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. 202 229 */ 203 230 value_compare value_comp(void) const { return key_comp(); } … … 212 239 overlap with \a segment. 213 240 */ 214 std::pair<iterator, iterator> overlap_range(const key_type& segment) 241 std::pair<iterator, iterator> overlap_range(const key_type& segment) 215 242 { 216 243 iterator first = container_.lower_bound(segment); … … 233 260 234 261 template<class Container, class Compare, class Value2Key> 235 typename SegmentTree<Container, Compare, Value2Key>::size_type 262 typename SegmentTree<Container, Compare, Value2Key>::size_type 236 263 SegmentTree<Container,Compare,Value2Key>::count(const element_type& element) const 237 264 { … … 243 270 244 271 template<class Container, class Compare, class Value2Key> 245 typename SegmentTree<Container, Compare, Value2Key>::const_iterator 272 typename SegmentTree<Container, Compare, Value2Key>::const_iterator 246 273 SegmentTree<Container, Compare, Value2Key>::find(const element_type& vt) const 247 274 { … … 256 283 257 284 template<class Container, class Compare, class Value2Key> 258 typename SegmentTree<Container, Compare, Value2Key>::iterator 285 typename SegmentTree<Container, Compare, Value2Key>::iterator 259 286 SegmentTree<Container, Compare, Value2Key>::find(const element_type& vt) 260 287 { … … 268 295 269 296 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> 271 298 SegmentTree<T, Compare,Value2Key>::insert(const value_type& segment) 272 299 { … … 282 309 iterator result = container_.lower_bound(segment); 283 310 // result is larger or overlapping with segment (i.e.! result<segment) 284 YAT_ASSERT(result==end() 311 YAT_ASSERT(result==end() 285 312 || !compare(Value2Key()(*result),segment)); 286 313 return result; … … 295 322 const_iterator result = container_.lower_bound(segment); 296 323 // result is larger or overlapping with segment (i.e.! result<segment) 297 YAT_ASSERT(result==end() 324 YAT_ASSERT(result==end() 298 325 || !compare(Value2Key()(*result),segment)); 299 326 return result;
Note: See TracChangeset
for help on using the changeset viewer.