AbstractLinAlgPack::MatrixDenseEncap Class Reference

Helper class type that simplifies the usage of the MatrixOpGetGMS interface for clients. More...

#include <AbstractLinAlgPack_MatrixOpGetGMS.hpp>

List of all members.

Public Member Functions

 MatrixDenseEncap (const MatrixOpGetGMS &mat_get)
 Construct a DMatrixSlice view from a MatrixOpGetGMS object.
 MatrixDenseEncap (const MatrixOp &mat)
 Construct a DMatrixSlice view from a MatrixOp object.
 ~MatrixDenseEncap ()
 Frees the DMatrixSlice view.
const DMatrixSlice operator() () const
 Returns a constant view of the DMatrixSlice view.

Private Member Functions

 MatrixDenseEncap ()
 MatrixDenseEncap (const MatrixDenseEncap &)
MatrixDenseEncapoperator= (const MatrixDenseEncap &)

Private Attributes

const MatrixOpGetGMSmat_get_
const DMatrixSlice gms_view_


Detailed Description

Helper class type that simplifies the usage of the MatrixOpGetGMS interface for clients.

This takes care of worrying about if the MatrixOpGetGMS interface is supported or not and remembering to free the DMatrixSlice view properly.

This class is only to be used on the stack as an automatic variable. For example, to extract a DMatrixSlice view of an abstract vector and use it to copy to a DMatrix object you could write a function like:

 void copy(const MatrixOpGetGMS& mat_in, GenMatrixClass* gms_out ) {
     MatrixDenseEncap  gms_in(mat_in);
   *gms_out = gms_in();
 }
In the above code, if the underlying MatrixOpGetGMS object does not have to perform any dynamic memory allocations and copy in the method MatrixOpGetGMS::get_gms_view() then the above code will only have a constant time overhead.

Definition at line 112 of file AbstractLinAlgPack_MatrixOpGetGMS.hpp.


Constructor & Destructor Documentation

AbstractLinAlgPack::MatrixDenseEncap::MatrixDenseEncap ( const MatrixOpGetGMS mat_get  )  [inline]

Construct a DMatrixSlice view from a MatrixOpGetGMS object.

Definition at line 145 of file AbstractLinAlgPack_MatrixOpGetGMS.hpp.

AbstractLinAlgPack::MatrixDenseEncap::MatrixDenseEncap ( const MatrixOp mat  )  [inline]

Construct a DMatrixSlice view from a MatrixOp object.

If dynamic_cast<const MatrixOpGetGMS*>(&mat) == NULL then a ??? exception is thrown.

Definition at line 151 of file AbstractLinAlgPack_MatrixOpGetGMS.hpp.

AbstractLinAlgPack::MatrixDenseEncap::~MatrixDenseEncap (  )  [inline]

Frees the DMatrixSlice view.

Definition at line 157 of file AbstractLinAlgPack_MatrixOpGetGMS.hpp.

AbstractLinAlgPack::MatrixDenseEncap::MatrixDenseEncap (  )  [private]

AbstractLinAlgPack::MatrixDenseEncap::MatrixDenseEncap ( const MatrixDenseEncap  )  [private]


Member Function Documentation

const DMatrixSlice AbstractLinAlgPack::MatrixDenseEncap::operator() (  )  const [inline]

Returns a constant view of the DMatrixSlice view.

Definition at line 163 of file AbstractLinAlgPack_MatrixOpGetGMS.hpp.

MatrixDenseEncap& AbstractLinAlgPack::MatrixDenseEncap::operator= ( const MatrixDenseEncap  )  [private]


Member Data Documentation

const MatrixOpGetGMS& AbstractLinAlgPack::MatrixDenseEncap::mat_get_ [private]

Definition at line 131 of file AbstractLinAlgPack_MatrixOpGetGMS.hpp.

const DMatrixSlice AbstractLinAlgPack::MatrixDenseEncap::gms_view_ [private]

Definition at line 132 of file AbstractLinAlgPack_MatrixOpGetGMS.hpp.


The documentation for this class was generated from the following file:
Generated on Tue Jul 13 09:35:40 2010 for MOOCHO (Single Doxygen Collection) by  doxygen 1.4.7