[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

coordinate_iterator.hxx
1 /************************************************************************/
2 /* */
3 /* Copyright 2011-2012 by Markus Nullmeier and Ullrich Koethe */
4 /* */
5 /* This file is part of the VIGRA computer vision library. */
6 /* The VIGRA Website is */
7 /* http://hci.iwr.uni-heidelberg.de/vigra/ */
8 /* Please direct questions, bug reports, and contributions to */
9 /* ullrich.koethe@iwr.uni-heidelberg.de or */
10 /* vigra@informatik.uni-hamburg.de */
11 /* */
12 /* Permission is hereby granted, free of charge, to any person */
13 /* obtaining a copy of this software and associated documentation */
14 /* files (the "Software"), to deal in the Software without */
15 /* restriction, including without limitation the rights to use, */
16 /* copy, modify, merge, publish, distribute, sublicense, and/or */
17 /* sell copies of the Software, and to permit persons to whom the */
18 /* Software is furnished to do so, subject to the following */
19 /* conditions: */
20 /* */
21 /* The above copyright notice and this permission notice shall be */
22 /* included in all copies or substantial portions of the */
23 /* Software. */
24 /* */
25 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND */
26 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES */
27 /* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND */
28 /* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT */
29 /* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, */
30 /* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING */
31 /* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */
32 /* OTHER DEALINGS IN THE SOFTWARE. */
33 /* */
34 /************************************************************************/
35 
36 #ifndef VIGRA_COORDINATE_ITERATOR_HXX
37 #define VIGRA_COORDINATE_ITERATOR_HXX
38 
39 #include <complex>
40 
41 #include "tuple.hxx"
42 #include "accessor.hxx"
43 #include "tinyvector.hxx"
44 #include "numerictraits.hxx"
45 #include "multi_iterator.hxx"
46 #include "multi_array.hxx"
47 
48 namespace vigra {
49 
50 template<unsigned N>
51 struct StridePair
52 {
53  typedef typename MultiArrayShape<N>::type index_type;
54  typedef TinyVector<double, N> coord_type;
55  typedef coord_type deref_type;
56  typedef StridePair type;
57  typedef StridePair stride_type;
58  typedef TinyVector<type, N> stride_array_type;
59  typedef TinyVector<index_type, N> shape_array_type;
60  typedef shape_array_type shape_type;
61 
62  index_type index;
63  coord_type coord;
64 
65  StridePair(const index_type & i) : index(i), coord(i) {}
66  StridePair(const coord_type & c) : index(), coord(c) {}
67  StridePair(const index_type & i, const coord_type & c)
68  : index (i), coord(c) {}
69  StridePair( MultiArrayIndex i, const coord_type & c)
70  : index(index_type(i)), coord(c) {}
71  StridePair() {}
72 
73  // use just the coordinates for further processing ...
74  const coord_type & operator*() const
75  {
76  return this->coord;
77  }
78 
79  void operator+=(const StridePair & x)
80  {
81  index += x.index;
82  coord += x.coord;
83  }
84  void operator-=(const StridePair & x)
85  {
86  index -= x.index;
87  coord -= x.coord;
88  }
89  StridePair operator+(const StridePair & x)
90  {
91  StridePair ret = *this;
92  ret += x;
93  return ret;
94  }
95  StridePair operator-(const StridePair & x)
96  {
97  StridePair ret = *this;
98  ret -= x;
99  return ret;
100  }
101  StridePair operator*(const StridePair & x)
102  {
103  StridePair ret = *this;
104  ret.index *= x.index;
105  ret.coord *= x.coord;
106  return ret;
107  }
108  StridePair operator/(const StridePair & x)
109  {
110  StridePair ret = *this;
111  ret.index /= x.index;
112  ret.coord /= x.coord;
113  return ret;
114  }
115 
116  MultiArrayIndex & idx0()
117  {
118  return index[0];
119  }
120  const index_type & idx() const
121  {
122  return index;
123  }
124  double & dim0()
125  {
126  return coord[0];
127  }
128  double dim0() const
129  {
130  return coord[0];
131  }
132 };
133 
134 template<unsigned M>
135 struct NumericTraits<StridePair<M> >
136  : public NumericTraits<typename StridePair<M>::index_type>
137 {};
138 
139 template<unsigned N>
140 struct StridePairCoord : public TinyVector<double, N>
141 {
142  typedef TinyVector<double, N> entry_type;
143 
144  StridePairCoord(const entry_type & c) : entry_type(c) {}
145  StridePairCoord() {}
146 
147  double & dim0()
148  {
149  return (*this)[0];
150  }
151  double dim0() const
152  {
153  return (*this)[0];
154  }
155 };
156 template<unsigned M>
157 struct NumericTraits<StridePairCoord<M> >
158  : public NumericTraits<typename StridePairCoord<M>::entry_type>
159 {};
160 
161 template<unsigned N>
162 struct StridePairDiff : public StridePairCoord<N>
163 {
164  MultiArrayIndex c;
165 
166  typedef StridePairCoord<N> base_type;
167  StridePairDiff(MultiArrayIndex c_, const base_type & x)
168  : base_type(x), c(c_) {}
169  StridePairDiff(const base_type & x)
170  : base_type(x), c(0) {}
171  StridePairDiff(const TinyVector<double, N> & x)
172  : base_type(x), c(0) {}
173  StridePairDiff(const TinyVector<MultiArrayIndex, N> & x)
174  : base_type(x), c(0) {}
175  StridePairDiff() : c(0) {}
176 
177  const base_type & base() const
178  {
179  return *this;
180  }
181  StridePairDiff operator*(const StridePairDiff & x)
182  {
183  StridePairDiff ret = base() * x.base();
184  ret.c = c * x.c;
185  return ret;
186  }
187 };
188 
189 template<unsigned M>
190 struct NumericTraits<StridePairDiff<M> >
191  : public NumericTraits<StridePairCoord<M> >
192 {};
193 
194 template<unsigned N, class T>
195 struct StridePairPointer : public StridePairCoord<N>
196 {
197  typedef const T* index_type;
198  typedef StridePairCoord<N> coord_type;
199  typedef typename coord_type::entry_type coord_num_type;
200  typedef StridePairPointer type;
201  typedef type deref_type;
202  typedef StridePairDiff<N> stride_type;
203  typedef TinyVector<stride_type, N> stride_array_type;
204  typedef typename MultiArrayShape<N>::type shape_array_type;
205  typedef shape_array_type shape_type;
206 
207  index_type index;
208 
209  StridePairPointer(const index_type & i, const coord_type & c)
210  : coord_type(c), index(i) {}
211 
212  const type & operator*() const
213  {
214  return *this;
215  }
216  const T & value() const
217  {
218  return *index;
219  }
220  const coord_type & coord() const
221  {
222  return *this;
223  }
224 
225  index_type & idx0()
226  {
227  return index;
228  }
229  const index_type & idx() const
230  {
231  return index;
232  }
233 
234  void operator+=(stride_type x)
235  {
236  index += x.c;
238  }
239  void operator-=(stride_type x)
240  {
241  index -= x.c;
243  }
244 };
245 
246 template<unsigned M, class T>
247 struct NumericTraits<StridePairPointer<M, T> >
248  : public NumericTraits<typename StridePairPointer<M, T>::coord_type>
249 {};
250 
251 namespace detail {
252 
253 template<class T, bool is_complex = NumericTraits<T>::isComplex::value,
254  bool is_vector = !NumericTraits<T>::isScalar::value>
255 struct weighted_abs
256 {
257  static double get(const T & x)
258  {
259  return x;
260  }
261 };
262 
263 template<class T>
264 struct weighted_abs<T, true, false>
265 {
266  static double get(const T & x)
267  {
268  using std::abs;
269  return abs(x);
270  }
271 };
272 
273 template<class T, bool is_complex>
274 struct weighted_abs<T, is_complex, true>
275 {
276  static double get(const T & x)
277  {
278  return x.magnitude();
279  }
280 };
281 
282 template<class T>
283 struct accumulable_coord_access;
284 template<class T>
285 struct accumulable_value_access;
286 template<class T>
287 struct accumulable_weighted_access;
288 
289 template<unsigned N, class T>
290 struct accumulable_coord_access<StridePairPointer<N, T> >
291 {
292  typedef StridePairPointer<N, T> accumulable_type;
293  typedef typename accumulable_type::coord_num_type type;
294  static const type & get(const accumulable_type & v) { return v.coord(); }
295 };
296 
297 template<unsigned N, class T>
298 struct accumulable_value_access<StridePairPointer<N, T> >
299 {
300  typedef StridePairPointer<N, T> accumulable_type;
301  typedef T type;
302  static const type & get(const accumulable_type & v) { return v.value(); }
303 };
304 
305 template<unsigned N, class T>
306 struct accumulable_weighted_access<StridePairPointer<N, T> >
307 {
308  typedef StridePairPointer<N, T> accumulable_type;
309  typedef typename accumulable_type::coord_num_type type;
310  static type get(const accumulable_type & v)
311  {
312  return weighted_abs<T>::get(v.value()) * v.coord();
313  }
314 };
315 
316 template<class X>
317 void dismember(X & r, const X & x, unsigned i)
318 {
319  r[i] = x[i];
320 }
321 template<unsigned N>
322 void dismember(StridePair<N> & r, const StridePair<N> & x, unsigned i)
323 {
324  r.index[i] = x.index[i];
325  r.coord[i] = x.coord[i];
326 }
327 template<unsigned N>
328 void dismember(StridePairDiff<N> & r, const StridePairDiff<N> & x, unsigned i)
329 {
330  r.c = static_cast<MultiArrayIndex>(r[i] = x[i]);
331 }
332 
333 template<unsigned N, class X>
334 TinyVector<X, N>
335 dismember(const X & x)
336 {
337  TinyVector<X, N> ret;
338  for (unsigned i = 0; i != N; ++i)
339  dismember(ret[i], x, i);
340  return ret;
341 }
342 template<unsigned N>
343 TinyVector<StridePairDiff<N>, N>
344 dismember(const TinyVector<MultiArrayIndex, N> & x,
345  const StridePairCoord<N> & y)
346 {
347  typedef StridePairDiff<N> type;
348  TinyVector<type, N> ret;
349  for (unsigned i = 0; i != N; ++i)
350  {
351  ret[i].c = x[i];
352  ret[i][i] = y[i];
353  }
354  return ret;
355 }
356 
357 } // namespace detail
358 
359 // A fake "pointer" for MultiIterator containing coordinates.
360 // Indices (or a pointer) cannot be circumvented in coordiante iterators,
361 // since floating point addition is not associative and
362 // iterator comparison is done via via '<' or '!='. Class CoordinateStride
363 // thus forwards iterator comparison to the index or pointer part
364 // of its template parameter S.
365 template<unsigned N, class S = StridePair<N> >
366 class CoordinateStride : protected S
367 {
368  public:
369  typedef MultiArrayIndex difference_type;
370  typedef typename S::stride_type stride_type;
371  typedef typename S::deref_type deref_type;
372  typedef CoordinateStride<N> type;
373  typedef typename S::coord_type coord_type;
374  typedef typename S::index_type index_type;
375  typedef typename S::shape_array_type shape_array_type;
376 
377  protected:
378  double stride_0;
379 
380  CoordinateStride(void*) {} // used MultiIterator ctor, unused.
381 
382  public:
383  CoordinateStride(const S & x, double s0)
384  : S(x), stride_0(s0) {}
385 
386  using S::operator*;
387  using S::idx0;
388  using S::idx;
389  using S::dim0;
390  using S::operator+=;
391  using S::operator-=;
392 
393  void operator++()
394  {
395  ++idx0();
396  dim0() += stride_0;
397  }
398  void operator--()
399  {
400  --idx0();
401  dim0() -= stride_0;
402  }
403  void operator+=(difference_type n)
404  {
405  idx0() += n;
406  dim0() += n * stride_0;
407  }
408  void operator-=(difference_type n)
409  {
410  idx0() -= n;
411  dim0() -= n * stride_0;
412  }
413 
414  stride_type operator[](difference_type n) const
415  {
416  type ret = *this;
417  ret[0] += n;
418  return ret;
419  }
420 
421  stride_type operator[](stride_type x) const
422  {
423  return *this + x;
424  }
425 
426  // ... but use the idx() for comparisons:
427  bool operator!=(const CoordinateStride & y) const
428  {
429  return idx() != y.idx();
430  }
431  bool operator==(const CoordinateStride & y) const
432  {
433  if (stride_0 != y.stride_0)
434  return false;
435  return idx() == y.idx();
436  }
437  bool operator<(const CoordinateStride & y) const
438  {
439  return idx() < y.idx();
440  }
441 
442  bool operator<=(const CoordinateStride & y) const
443  {
444  if (stride_0 == y.stride_0)
445  return true;
446  return *this < y;
447  }
448  bool operator>(const CoordinateStride & y) const
449  {
450  return y < *this;
451  }
452  bool operator>=(const CoordinateStride & y) const
453  {
454  if (stride_0 == y.stride_0)
455  return true;
456  return operator>(y);
457  }
458 
459  friend std::ostream &
460  operator<<(std::ostream & os, const CoordinateStride & x)
461  {
462  os << "{" << x.stride_0 << ": " << static_cast<const S &>(x) << "}";
463  return os;
464  }
465 
466  typedef MultiIterator<N, deref_type, const deref_type &, CoordinateStride>
467  iterator_type;
468 };
469 
470 template <unsigned N, class S>
471 struct MultiIteratorStrideTraits<CoordinateStride<N, S> >
472 {
473  typedef typename S::stride_type stride_type;
474  typedef typename S::stride_array_type stride_array_type;
475  typedef typename S::shape_array_type shape_array_type;
476  static stride_array_type shift(const stride_array_type & s, unsigned d)
477  {
478  stride_array_type ret;
479  for (unsigned i = d; i != N; ++i)
480  ret[i - d] = s[i];
481  return ret;
482  }
483 };
484 
485 template <unsigned N>
486 struct CoordinateMultiIterator : public CoordinateStride<N>::iterator_type
487 {
488  typedef CoordinateStride<N> ptr_type;
489  typedef typename ptr_type::iterator_type base_type;
490  typedef typename ptr_type::stride_type stride_type;
491  typedef typename ptr_type::shape_array_type shape_array_type;
492  typedef typename ptr_type::coord_type coord_type;
493  typedef typename ptr_type::index_type index_type;
494 
495  CoordinateMultiIterator(const stride_type & origin,
496  const stride_type & stride,
497  const index_type & shape)
498 
499  : base_type(ptr_type(origin, stride.dim0()),
500  detail::dismember<N>(stride),
501  detail::dismember<N>(shape)) {}
502 
503  CoordinateMultiIterator(const base_type & x) : base_type(x) {}
504 };
505 
506 namespace detail {
507 
508 template<unsigned N>
509 struct CoordinateMultiRangeReturns
510 {
511  typedef CoordinateMultiIterator<N> iterator_type;
512  typedef typename iterator_type::coord_type coord_type;
513  typedef StridePair<N> pair_type;
514  typedef typename pair_type::type stride_type;
515  typedef typename pair_type::stride_array_type stride_array_type;
516 
517  typedef typename AccessorTraits<coord_type>::default_const_accessor
518  access_type;
519  typedef triple<iterator_type, stride_array_type, access_type> type;
520 };
521 
522 } // namespace detail
523 
524 template <unsigned N>
525 typename detail::CoordinateMultiRangeReturns<N>::type
526 coordinateMultiRange(const typename MultiArrayShape<N>::type & shape,
527  const TinyVector<double, N> & stride
528  = TinyVector<double, N>(1.0),
529  const TinyVector<double, N> & origin
530  = TinyVector<double, N>(0.0))
531 {
532  typedef typename
533  detail::CoordinateMultiRangeReturns<N>::stride_type stride_type;
534  typedef typename
535  detail::CoordinateMultiRangeReturns<N>::access_type access_type;
536 
537  return typename detail::CoordinateMultiRangeReturns<N>::type
538  (CoordinateMultiIterator<N>(stride_type(0, origin),
539  stride_type(1, stride),
540  shape),
541  detail::dismember<N>(stride_type(shape)),
542  access_type());
543 }
544 
545 template <unsigned N, class T>
546 struct CombinedMultiIterator
547  : public CoordinateStride<N, StridePairPointer<N, T> >::iterator_type
548 {
549  typedef StridePairPointer<N, T> pair_type;
550  typedef CoordinateStride<N, pair_type> ptr_type;
551  typedef typename ptr_type::iterator_type base_type;
552  typedef typename ptr_type::stride_type stride_type;
553  typedef typename ptr_type::coord_type coord_type;
554  typedef typename pair_type::shape_array_type shape_array_type;
555 
556  CombinedMultiIterator(const T* raw_pointer,
557  const stride_type & origin,
558  const TinyVector<MultiArrayIndex, N> & pointer_stride,
559  const stride_type & stride,
560  const shape_array_type & shape)
561 
562  : base_type(ptr_type(pair_type(raw_pointer, origin), stride.dim0()),
563  detail::dismember<N>(pointer_stride, stride),
564  shape) {}
565 
566  CombinedMultiIterator(const base_type & x) : base_type(x) {}
567 };
568 
569 template<unsigned N, class T>
570 struct SrcCoordinateMultiArrayRangeReturns
571 {
572  typedef CombinedMultiIterator<N, T> iterator_type;
573  typedef typename iterator_type::coord_type coord_type;
574  typedef typename iterator_type::pair_type pair_type;
575  typedef typename iterator_type::ptr_type ptr_type;
576  typedef typename ptr_type::deref_type deref_type;
577  typedef typename iterator_type::stride_type stride_type;
578  typedef typename pair_type::stride_array_type stride_array_type;
579  typedef typename pair_type::shape_array_type shape_array_type;
580 
581  typedef typename AccessorTraits<deref_type>::default_const_accessor
582  access_type;
583  typedef triple<iterator_type, stride_array_type, access_type> type;
584 };
585 
586 // work around GCC 4.4.3 template argument deduction bug:
587 template<unsigned N>
588 struct CoordinateSteps
589 {
590  typedef const TinyVector<double, N> & type;
591 };
592 
593 template <unsigned int N, class T, class StrideTag>
594 inline typename SrcCoordinateMultiArrayRangeReturns<N, T>::type
595 srcCoordinateMultiArrayRange(const MultiArrayView<N, T, StrideTag> & array,
596  typename CoordinateSteps<N>::type stride
597  = TinyVector<double, N>(1.0),
598  typename CoordinateSteps<N>::type origin
599  = TinyVector<double, N>(0.0))
600 {
601  typedef SrcCoordinateMultiArrayRangeReturns<N, T> returns;
602  typedef typename returns::type type;
603  typedef typename returns::stride_type stride_type;
604  typedef typename returns::access_type access_type;
605  typedef typename returns::iterator_type iterator_type;
606  typedef typename returns::shape_array_type shape_array_type;
607 
608  shape_array_type shape = array.shape();
609  return type(iterator_type(array.traverser_begin().get(),
610  stride_type(origin),
611  array.stride(),
612  stride_type(stride),
613  shape),
614  detail::dismember<N>(stride_type(shape)),
615  access_type());
616 }
617 
618 template <class VALUETYPE, class COORD>
619 struct AccessorCoordinatePair
620 {
621  typedef VALUETYPE value_type;
622  typedef COORD coord_type;
623  typedef AccessorCoordinatePair type;
624 
625  value_type v;
626  const coord_type & c;
627 
628  AccessorCoordinatePair(const value_type & v_, const coord_type & c_)
629  : v(v_), c(c_) {}
630 
631  const value_type & value() const
632  {
633  return v;
634  }
635  const coord_type & coord() const
636  {
637  return c;
638  }
639 };
640 
641 /** \brief Forward accessor to the value() part of the values an iterator
642  points to.
643 
644  CoordinateConstValueAccessor is a accessor that forwards
645  the underlying accessor's operator() read functions.
646  It passes its arguments <em>by value</em>.
647 
648  <b>\#include</b> <vigra/coordinate_iterator.hxx><br>
649  Namespace: vigra
650 */
651 template <class Accessor, class COORD>
653 {
654  public:
655  typedef typename Accessor::value_type forward_type;
656  typedef AccessorCoordinatePair<forward_type, COORD> value_type;
657  Accessor a;
658  CoordinateConstValueAccessor(const Accessor & a_) : a(a_) {}
659  /** Read the current data item.
660  */
661  template <class ITERATOR>
662  value_type operator()(ITERATOR const & i) const
663  {
664  const typename ITERATOR::value_type & x = *i;
665  return value_type(a(&x.value()), x.coord());
666  }
667  /** Read the data item at an offset.
668  */
669  template <class ITERATOR, class DIFFERENCE>
670  value_type operator()(ITERATOR const & i, DIFFERENCE const & diff) const
671  {
672  const typename ITERATOR::value_type & x = i[diff];
673  return value_type(a(&x.value()), x.coord());
674  }
675 };
676 
677 template<unsigned N, class T, class Accessor>
678 struct SrcCoordinateMultiArrayRangeAccessorReturns
679 {
680  typedef CombinedMultiIterator<N, T> iterator_type;
681  typedef typename iterator_type::coord_type coord_type;
682  typedef typename iterator_type::pair_type pair_type;
683  typedef typename iterator_type::ptr_type ptr_type;
684  typedef typename ptr_type::deref_type deref_type;
685  typedef typename iterator_type::stride_type stride_type;
686  typedef typename pair_type::stride_array_type stride_array_type;
687  typedef typename pair_type::shape_array_type shape_array_type;
688 
689  typedef CoordinateConstValueAccessor<Accessor, coord_type> access_type;
690  typedef triple<iterator_type, stride_array_type, access_type> type;
691 };
692 
693 template <unsigned int N, class T, class StrideTag, class Access>
694 inline typename SrcCoordinateMultiArrayRangeAccessorReturns<N, T, Access>::type
695 srcCoordinateMultiArrayRangeAccessor(const MultiArrayView<N, T, StrideTag> &
696  array,
697  Access a,
698  typename CoordinateSteps<N>::type stride
699  = TinyVector<double, N>(1.0),
700  typename CoordinateSteps<N>::type origin
701  = TinyVector<double, N>(0.0))
702 {
703  typedef SrcCoordinateMultiArrayRangeAccessorReturns<N, T, Access> returns;
704  typedef typename returns::type type;
705  typedef typename returns::stride_type stride_type;
706  typedef typename returns::access_type access_type;
707  typedef typename returns::iterator_type iterator_type;
708  typedef typename returns::shape_array_type shape_array_type;
709 
710  shape_array_type shape = array.shape();
711  return type(iterator_type(array.traverser_begin().get(),
712  stride_type(origin),
713  array.stride(),
714  stride_type(stride),
715  shape),
716  detail::dismember<N>(stride_type(shape)),
717  access_type(a));
718 }
719 
720 } // namespace vigra
721 
722 namespace std {
723 
724 template <unsigned N>
725 ostream &
726 operator<<(ostream & os, const vigra::StridePair<N> & x)
727 {
728  os << "[" << x.index << ", " << x.coord << "]";
729  return os;
730 }
731 
732 template <unsigned N>
733 ostream &
734 operator<<(ostream & os, const vigra::StridePairDiff<N> & x)
735 {
736  os << "<" << x.c << "; "
737  << static_cast<vigra::StridePairCoord<N> >(x) << ">";
738  return os;
739 }
740 
741 template <unsigned N, class T>
742 ostream &
743 operator<<(ostream & os, const vigra::StridePairPointer<N, T> & x)
744 {
745  os << "[" << x.value() << ", " << x.coord() << "]";
746  return os;
747 }
748 
749 template <class VALUETYPE, class COORD>
750 ostream &
751 operator<<(ostream & os,
752  const vigra::AccessorCoordinatePair<VALUETYPE, COORD> & x)
753 {
754  os << "[" << x.value() << ", " << x.coord() << "]";
755  return os;
756 }
757 
758 } // namespace std
759 
760 #endif // VIGRA_COORDINATE_ITERATOR_HXX

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.9.0 (Tue Oct 22 2013)