linbox
SumOwner< _Blackbox1, _Blackbox2 > Class Template Reference

blackbox of a matrix sum without copying. More...

#include <sum.h>

+ Inheritance diagram for SumOwner< _Blackbox1, _Blackbox2 >:

Data Structures

struct  rebind
 

Public Types

typedef _Blackbox1 Blackbox1
 
typedef _Blackbox2 Blackbox2
 
typedef Blackbox1::Field Field
 
typedef Blackbox1::Element Element
 

Public Member Functions

 SumOwner (const Blackbox1 &A, const Blackbox2 &B)
 Constructor from black box matrices.
 
 SumOwner (const Blackbox1 *A_data, const Blackbox2 *B_data)
 Constructor from black box pointers.
 
 SumOwner (const SumOwner< Blackbox1, Blackbox2 > &M)
 Copy constructor.
 
 ~SumOwner (void)
 Destructor.
 
template<class OutVector, class InVector>
OutVector & apply (OutVector &y, const InVector &x) const
 Application of BlackBox matrix.
 
template<class OutVector, class InVector>
OutVector & applyTranspose (OutVector &y, const InVector &x) const
 Application of BlackBox matrix transpose.
 
template<typename _BBt1, typename _BBt2, typename Field>
 SumOwner (const Sum< _BBt1, _BBt2 > &M, const Field &F)
 
template<typename _BBt1, typename _BBt2, typename Field>
 SumOwner (const SumOwner< _BBt1, _BBt2 > &M, const Field &F)
 
size_t rowdim (void) const
 Retreive row dimensions of BlackBox matrix.
 
size_t coldim (void) const
 Retreive column dimensions of BlackBox matrix.
 
const Fieldfield () const
 
const Blackbox1getLeftData () const
 
Blackbox1getLeftData ()
 
const Blackbox2getRightData () const
 
Blackbox2getRightData ()
 
std::ostream & write (std::ostream &os) const
 

Protected Attributes

Blackbox1 _A_data
 
Blackbox2 _B_data
 
std::vector< Element_z1
 
std::vector< Element_z2
 
VectorDomain< FieldVD
 

Detailed Description

template<class _Blackbox1, class _Blackbox2>
class LinBox::SumOwner< _Blackbox1, _Blackbox2 >

blackbox of a matrix sum without copying.

Adds only at apply time. Given two black boxes A and B of the same dimensions, form a black box representing A+B, i.e., SumOwner(A,B)x=(A+B)x=Ax+Bx

Member Typedef Documentation

◆ Blackbox1

template<class _Blackbox1, class _Blackbox2>
typedef _Blackbox1 Blackbox1

◆ Blackbox2

template<class _Blackbox1, class _Blackbox2>
typedef _Blackbox2 Blackbox2

◆ Field

template<class _Blackbox1, class _Blackbox2>
typedef Blackbox1::Field Field

◆ Element

template<class _Blackbox1, class _Blackbox2>
typedef Blackbox1::Element Element

Constructor & Destructor Documentation

◆ SumOwner() [1/5]

template<class _Blackbox1, class _Blackbox2>
SumOwner ( const Blackbox1 & A,
const Blackbox2 & B )
inline

Constructor from black box matrices.

This constructor creates a matrix that is the sum, A + B, of black box matrices.

Parameters
A,Bblack box matrices.

◆ SumOwner() [2/5]

template<class _Blackbox1, class _Blackbox2>
SumOwner ( const Blackbox1 * A_data,
const Blackbox2 * B_data )
inline

Constructor from black box pointers.

This constructor creates a matrix that is the sum, A + B, of black box matrices.

Parameters
A_data,B_datapointers to black box matrices.

◆ SumOwner() [3/5]

template<class _Blackbox1, class _Blackbox2>
SumOwner ( const SumOwner< Blackbox1, Blackbox2 > & M)
inline

Copy constructor.

Creates new black box objects in dynamic memory.

Parameters
Mconstant reference to compose black box matrix

◆ ~SumOwner()

template<class _Blackbox1, class _Blackbox2>
~SumOwner ( void )
inline

Destructor.

◆ SumOwner() [4/5]

template<class _Blackbox1, class _Blackbox2>
template<typename _BBt1, typename _BBt2, typename Field>
SumOwner ( const Sum< _BBt1, _BBt2 > & M,
const Field & F )
inline

◆ SumOwner() [5/5]

template<class _Blackbox1, class _Blackbox2>
template<typename _BBt1, typename _BBt2, typename Field>
SumOwner ( const SumOwner< _BBt1, _BBt2 > & M,
const Field & F )
inline

Member Function Documentation

◆ apply()

template<class _Blackbox1, class _Blackbox2>
template<class OutVector, class InVector>
OutVector & apply ( OutVector & y,
const InVector & x ) const
inline

Application of BlackBox matrix.

\( y= (A+B) \cdot x\). Requires one vector conforming to the LinBox vector archetype. Required by abstract base class.

Returns
reference to vector y containing output.
Parameters
xconstant reference to vector to contain input
y

◆ applyTranspose()

template<class _Blackbox1, class _Blackbox2>
template<class OutVector, class InVector>
OutVector & applyTranspose ( OutVector & y,
const InVector & x ) const
inline

Application of BlackBox matrix transpose.

\( y= (A+B)^T \cdot x\). Requires one vector conforming to the LinBox vector archetype. Required by abstract base class.

Returns
reference to vector y containing output.
Parameters
xconstant reference to vector to contain input
y

◆ rowdim()

template<class _Blackbox1, class _Blackbox2>
size_t rowdim ( void ) const
inline

Retreive row dimensions of BlackBox matrix.

This may be needed for applying preconditioners. Required by abstract base class.

Returns
integer number of rows of black box matrix.

◆ coldim()

template<class _Blackbox1, class _Blackbox2>
size_t coldim ( void ) const
inline

Retreive column dimensions of BlackBox matrix.

Required by abstract base class.

Returns
integer number of columns of black box matrix.

◆ field()

template<class _Blackbox1, class _Blackbox2>
const Field & field ( ) const
inline

◆ getLeftData() [1/2]

template<class _Blackbox1, class _Blackbox2>
const Blackbox1 & getLeftData ( ) const
inline

◆ getLeftData() [2/2]

template<class _Blackbox1, class _Blackbox2>
Blackbox1 & getLeftData ( )
inline

◆ getRightData() [1/2]

template<class _Blackbox1, class _Blackbox2>
const Blackbox2 & getRightData ( ) const
inline

◆ getRightData() [2/2]

template<class _Blackbox1, class _Blackbox2>
Blackbox2 & getRightData ( )
inline

◆ write()

template<class _Blackbox1, class _Blackbox2>
std::ostream & write ( std::ostream & os) const
inline

Field Documentation

◆ _A_data

template<class _Blackbox1, class _Blackbox2>
Blackbox1 _A_data
protected

◆ _B_data

template<class _Blackbox1, class _Blackbox2>
Blackbox2 _B_data
protected

◆ _z1

template<class _Blackbox1, class _Blackbox2>
std::vector<Element> _z1
mutableprotected

◆ _z2

template<class _Blackbox1, class _Blackbox2>
std::vector<Element> _z2
mutableprotected

◆ VD

template<class _Blackbox1, class _Blackbox2>
VectorDomain<Field> VD
protected

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