Atlfast::Cslice_iter< T > Class Template Reference

#include <Cslice_iter.h>

List of all members.

Public Member Functions

 Cslice_iter (valarray< T > *vv, slice ss)
Cslice_iter end () const
const Cslice_iteroperator++ ()
Cslice_iter operator++ (int)
const T & operator[] (size_t i) const
const T & operator() (size_t i) const
const T & operator * () const

Private Member Functions

T & ref (size_t i) const

Private Attributes

valarray< T > * v
slice s
size_t curr

Friends

bool operator== (const Cslice_iter< T > &p, const Cslice_iter< T > &q)
bool operator!= (const Cslice_iter &p, const Cslice_iter &q)
bool operator< (const Cslice_iter &p, const Cslice_iter &q)


Detailed Description

template<class T>
class Atlfast::Cslice_iter< T >

Definition at line 17 of file Cslice_iter.h.


Constructor & Destructor Documentation

template<class T>
Atlfast::Cslice_iter< T >::Cslice_iter ( valarray< T > *  vv,
slice  ss 
) [inline]

Definition at line 23 of file Cslice_iter.h.

00023 : v(vv), s(ss), curr(0){}


Member Function Documentation

template<class T>
T& Atlfast::Cslice_iter< T >::ref ( size_t  i  )  const [inline, private]

Definition at line 21 of file Cslice_iter.h.

00021 {return (*v)[s.start()+i*s.stride()];}

template<class T>
Cslice_iter Atlfast::Cslice_iter< T >::end (  )  const [inline]

Definition at line 24 of file Cslice_iter.h.

00024                            {
00025       Cslice_iter t = *this;
00026       t.curr=s.size();
00027       return t;
00028     }

template<class T>
const Cslice_iter& Atlfast::Cslice_iter< T >::operator++ (  )  [inline]

Definition at line 29 of file Cslice_iter.h.

00029 {curr++; return *this;}

template<class T>
Cslice_iter Atlfast::Cslice_iter< T >::operator++ ( int   )  [inline]

Definition at line 30 of file Cslice_iter.h.

00030 {Cslice_iter t=*this; curr++; return t;}

template<class T>
const T& Atlfast::Cslice_iter< T >::operator[] ( size_t  i  )  const [inline]

Definition at line 32 of file Cslice_iter.h.

00032 {return ref(i); }//C style subscript  

template<class T>
const T& Atlfast::Cslice_iter< T >::operator() ( size_t  i  )  const [inline]

Definition at line 33 of file Cslice_iter.h.

00033 {return ref(i); }    //Fortran style subsc  

template<class T>
const T& Atlfast::Cslice_iter< T >::operator * (  )  const [inline]

Definition at line 34 of file Cslice_iter.h.

00034 {return ref(curr); } //current element


Friends And Related Function Documentation

template<class T>
bool operator== ( const Cslice_iter< T > &  p,
const Cslice_iter< T > &  q 
) [friend]

Definition at line 37 of file Cslice_iter.h.

00037                                                                          {
00038       //      bool operator ==<> (const Cslice_iter<T>& p, const Cslice_iter<T>& q){
00039       return 
00040         p.curr==q.curr && 
00041         p.s.stride()==q.s.stride() && 
00042         p.s.start() == q.s.start();
00043     }

template<class T>
bool operator!= ( const Cslice_iter< T > &  p,
const Cslice_iter< T > &  q 
) [friend]

Definition at line 47 of file Cslice_iter.h.

00047                                                                    {
00048       return  (!p==q);
00049     }

template<class T>
bool operator< ( const Cslice_iter< T > &  p,
const Cslice_iter< T > &  q 
) [friend]

Definition at line 52 of file Cslice_iter.h.

00052                                                                   {
00053       //      bool operator < <>(const Cslice_iter& p, const Cslice_iter& q){
00054       return 
00055         p.curr<q.curr && 
00056         p.s.stride() == q.s.stride() && 
00057         p.s.start()  == q.s.start();
00058     }


Member Data Documentation

template<class T>
valarray<T>* Atlfast::Cslice_iter< T >::v [private]

Definition at line 18 of file Cslice_iter.h.

template<class T>
slice Atlfast::Cslice_iter< T >::s [private]

Definition at line 19 of file Cslice_iter.h.

template<class T>
size_t Atlfast::Cslice_iter< T >::curr [private]

Definition at line 20 of file Cslice_iter.h.


The documentation for this class was generated from the following file:
Generated on Fri Sep 21 13:20:56 2007 for AtlfastUtils by  doxygen 1.5.1