AbstractLinAlgPack::MatrixDenseMutableEncap Class Reference

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

#include <AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp>

List of all members.

Public Member Functions

 MatrixDenseMutableEncap (MatrixOpGetGMSMutable *mat_get)
 Construct a DMatrixSlice view from a MatrixOpGetGMSMutable object.
 MatrixDenseMutableEncap (MatrixOp *mat)
 Construct a DMatrixSlice view from a MatrixOp object.
 ~MatrixDenseMutableEncap ()
 Frees the DMatrixSlice view and commits the changes.
DMatrixSlice operator() ()
 Returns a non-const view of the DMatrixSlice view.
const DMatrixSlice operator() () const
 Returns a const view of the DMatrixSlice view.

Private Member Functions

 MatrixDenseMutableEncap ()
 MatrixDenseMutableEncap (const MatrixDenseMutableEncap &)
MatrixDenseMutableEncapoperator= (const MatrixDenseMutableEncap &)

Private Attributes

MatrixOpGetGMSMutablemat_get_
DMatrixSlice gms_view_


Detailed Description

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

This takes care of worrying about if the MatrixOpGetGMSMutable 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 set the matrix to a scalar one could write a function like:

 void assign( const value_type alpha, MatrixOpGetGMSMutable* mat_inout ) {
     MatrixDenseMutableEncap  gms_inout(*mat_inout);
   gms_inout() = alpha;
 }
In the above code, if the underlying MatrixOpGetGMSMutable object does not have to perform any dynamic memory allocations and copy in the method MatrixOpGetGMSMutable::get_gms_view() then the above code will only have a constant time overhead.

Definition at line 113 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.


Constructor & Destructor Documentation

AbstractLinAlgPack::MatrixDenseMutableEncap::MatrixDenseMutableEncap ( MatrixOpGetGMSMutable mat_get  )  [inline]

Construct a DMatrixSlice view from a MatrixOpGetGMSMutable object.

Definition at line 148 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.

AbstractLinAlgPack::MatrixDenseMutableEncap::MatrixDenseMutableEncap ( MatrixOp mat  )  [inline]

Construct a DMatrixSlice view from a MatrixOp object.

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

Definition at line 154 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.

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

Frees the DMatrixSlice view and commits the changes.

Definition at line 160 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.

AbstractLinAlgPack::MatrixDenseMutableEncap::MatrixDenseMutableEncap (  )  [private]

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


Member Function Documentation

DMatrixSlice AbstractLinAlgPack::MatrixDenseMutableEncap::operator() (  )  [inline]

Returns a non-const view of the DMatrixSlice view.

Definition at line 166 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.

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

Returns a const view of the DMatrixSlice view.

Definition at line 172 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.

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


Member Data Documentation

MatrixOpGetGMSMutable* AbstractLinAlgPack::MatrixDenseMutableEncap::mat_get_ [private]

Definition at line 134 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.

DMatrixSlice AbstractLinAlgPack::MatrixDenseMutableEncap::gms_view_ [private]

Definition at line 135 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.


The documentation for this class was generated from the following file:
Generated on Wed May 12 21:57:06 2010 for MOOCHO (Single Doxygen Collection) by  doxygen 1.4.7