dlr::numeric::Slice Class Reference

A simple Slice class to work with SubArrays. More...

#include <slice.h>

List of all members.

Public Member Functions

 Slice ()
 Default constructor initializes everything to zero.
 Slice (int start, int stop)
 This constructor sets start and stop as specified, and defaults stride to 1.
 Slice (int start, int stop, int stride)
 This constructor lets the caller specify all three values.
int start () const
 Accessor function for the value of start.
int stop () const
 Accessor function for the value of stop.
int stride () const
 Accessor function for the value of stride.


Detailed Description

A simple Slice class to work with SubArrays.

This is modeled after std::slice, but has "stop" instead of "size," and permits negative indexing.

Definition at line 27 of file slice.h.


Constructor & Destructor Documentation

dlr::numeric::Slice::Slice (  )  [inline]

Default constructor initializes everything to zero.

Some classes interpret this as meaning "every row" or "every column."

Definition at line 34 of file slice.h.

dlr::numeric::Slice::Slice ( int  start,
int  stop 
) [inline]

This constructor sets start and stop as specified, and defaults stride to 1.

Parameters:
start This argument specifies the desired first element.
stop This argument specifies an element one beyond the desired last element.

Definition at line 44 of file slice.h.

dlr::numeric::Slice::Slice ( int  start,
int  stop,
int  stride 
) [inline]

This constructor lets the caller specify all three values.

Parameters:
start This argument specifies the desired first element.
stop This argument specifies an element one beyond the desired last element.
stride This argument specifies how many elements to skip with each step.

Definition at line 55 of file slice.h.


Member Function Documentation

int dlr::numeric::Slice::start (  )  const [inline]

Accessor function for the value of start.

Returns:
The index of the first element in the slice.

Definition at line 63 of file slice.h.

int dlr::numeric::Slice::stop (  )  const [inline]

Accessor function for the value of stop.

Returns:
The index of an element one beyond the last element in the slice.

Definition at line 71 of file slice.h.

int dlr::numeric::Slice::stride (  )  const [inline]

Accessor function for the value of stride.

Returns:
The value of stride, where the slice accesses every stride'th element from start to just before stop.

Definition at line 79 of file slice.h.


The documentation for this class was generated from the following file:

Generated on Wed Nov 25 00:42:49 2009 for dlrUtilities Utility Library by  doxygen 1.5.8