Psi4
Public Member Functions | Private Member Functions | Private Attributes | List of all members
psi::Slice Class Reference

Slicing for Matrices and Vectors objects. More...

#include <dimension.h>

Public Member Functions

 Slice (const Dimension &begin, const Dimension &end)
 
 Slice (const Slice &other)
 Copy constructor. More...
 
const Dimensionbegin () const
 Get the first element of this slice. More...
 
const Dimensionend () const
 Get the past-the-end element of this slice. More...
 
Sliceoperator+= (const Dimension &increment)
 Increment the beginning and end of this slice. More...
 

Private Member Functions

bool validate_slice ()
 Check if this Slice is acceptable. More...
 

Private Attributes

Dimension begin_
 
Dimension end_
 

Detailed Description

Slicing for Matrices and Vectors objects.

Slices are pairs of Dimension objects used to manipulate parts of vectors and matrices.

Slices can be constructed from Dimension objects:

Dimension begin;
Dimension end;
Slice slice(begin,end);

or can be implicitly constructed from pairs of Dimension objects. E.g.:

Dimension begin;
Dimension end;
SharedVector v;
v->get_block({begin,end}); // same as v->get_block(slice);

Constructor & Destructor Documentation

psi::Slice::Slice ( const Dimension begin,
const Dimension end 
)

Creator Rules: begin must satisfly begin[h] >= 0 for all h end must satisfly end[h] >= begin[h] for all h

psi::Slice::Slice ( const Slice other)

Copy constructor.

Member Function Documentation

const Dimension& psi::Slice::begin ( ) const
inline

Get the first element of this slice.

const Dimension& psi::Slice::end ( ) const
inline

Get the past-the-end element of this slice.

Slice & psi::Slice::operator+= ( const Dimension increment)

Increment the beginning and end of this slice.

bool psi::Slice::validate_slice ( )
private

Check if this Slice is acceptable.

Member Data Documentation

Dimension psi::Slice::begin_
private
Dimension psi::Slice::end_
private

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