MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AbstractLinAlgPack::MatrixDenseMutableEncap Class Reference

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

#include <AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp>

Public Member Functions

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

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 126 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 161 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 167 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.

AbstractLinAlgPack::MatrixDenseMutableEncap::~MatrixDenseMutableEncap ( )
inline

Frees the DMatrixSlice view and commits the changes.

Definition at line 173 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 179 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.

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

Returns a const view of the DMatrixSlice view.

Definition at line 185 of file AbstractLinAlgPack_MatrixOpGetGMSMutable.hpp.

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

Member Data Documentation

MatrixOpGetGMSMutable* AbstractLinAlgPack::MatrixDenseMutableEncap::mat_get_
private
DMatrixSlice AbstractLinAlgPack::MatrixDenseMutableEncap::gms_view_
private

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