linbox
ComposeOwner< _Blackbox1, _Blackbox2 > Class Template Reference

Blackbox of a product: \(C = AB\), i.e \(Cx \gets A(Bx)\). More...

#include <compose.h>

+ Inheritance diagram for ComposeOwner< _Blackbox1, _Blackbox2 >:

Data Structures

struct  rebind
 

Public Types

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

Public Member Functions

 ComposeOwner (const Blackbox1 &A, const Blackbox2 &B)
 Constructor of C := A*B from blackbox matrices A and B.
 
 ComposeOwner (const Blackbox1 *A_data, const Blackbox2 *B_data)
 Constructor of C := (A_data)(*B_data).
 
 ComposeOwner (const ComposeOwner< Blackbox1, Blackbox2 > &Mat)
 Copy constructor.
 
 ~ComposeOwner ()
 Destructor.
 
template<class OutVector, class InVector>
OutVector & apply (OutVector &y, const InVector &x) const
 Matrix * column vector product.
 
template<class OutVector, class InVector>
OutVector & applyTranspose (OutVector &y, const InVector &x) const
 row vector * matrix product \(y= (A \times B)^T \cdot x\).
 
template<typename _BBt1, typename _BBt2, typename Field>
 ComposeOwner (const Compose< _BBt1, _BBt2 > &Mat, const Field &F)
 
template<typename _BBt1, typename _BBt2, typename Field>
 ComposeOwner (const ComposeOwner< _BBt1, _BBt2 > &Mat, const Field &F)
 
size_t rowdim (void) const
 The number of rows.
 
size_t coldim (void) const
 The number of columns.
 
const Fieldfield () const
 The field.
 
const Blackbox1getLeftData () const
 
Blackbox1getLeftData ()
 
const Blackbox2getRightData () const
 
Blackbox2getRightData ()
 

Protected Attributes

Blackbox1 _A_data
 
Blackbox2 _B_data
 
BlasVector< Field_z
 

Detailed Description

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

Blackbox of a product: \(C = AB\), i.e \(Cx \gets A(Bx)\).

This is a class that multiplies two matrices by implementing an apply method that calls the apply methods of both of the consituent matrices, one after the other.

This class, like the Black Box archetype from which it is derived, is templatized by the vector type to which the matrix is applied. Both constituent matrices must also use this same vector type. For specification of the blackbox members see BlackboxArchetype.

Template parameter: must meet the vector requirement. General case

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 Blackbox2::Field Field

◆ Element

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

Constructor & Destructor Documentation

◆ ComposeOwner() [1/5]

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

Constructor of C := A*B from blackbox matrices A and B.

Build the product A*B of any two black box matrices of compatible dimensions. Requires A.coldim() equals B.rowdim().

◆ ComposeOwner() [2/5]

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

Constructor of C := (A_data)(*B_data).

This constructor creates a matrix that is a product of two black box matrices: A*B from pointers to them.

◆ ComposeOwner() [3/5]

template<class _Blackbox1, class _Blackbox2>
ComposeOwner ( const ComposeOwner< Blackbox1, Blackbox2 > & Mat)
inline

Copy constructor.

Copies the composed matrix (a small handle). The underlying two matrices are not copied.

Parameters
Mmatrix to be copied.

◆ ~ComposeOwner()

template<class _Blackbox1, class _Blackbox2>
~ComposeOwner ( )
inline

Destructor.

◆ ComposeOwner() [4/5]

template<class _Blackbox1, class _Blackbox2>
template<typename _BBt1, typename _BBt2, typename Field>
ComposeOwner ( const Compose< _BBt1, _BBt2 > & Mat,
const Field & F )
inline

◆ ComposeOwner() [5/5]

template<class _Blackbox1, class _Blackbox2>
template<typename _BBt1, typename _BBt2, typename Field>
ComposeOwner ( const ComposeOwner< _BBt1, _BBt2 > & Mat,
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

Matrix * column vector product.

\( y= (A\cdot B) \cdot x.\) Applies B, then A.

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

◆ applyTranspose()

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

row vector * matrix product \(y= (A \times B)^T \cdot x\).

Applies A^t then B^t.

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

The number of rows.

◆ coldim()

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

The number of columns.

◆ field()

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

The field.

◆ 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

Field Documentation

◆ _A_data

template<class _Blackbox1, class _Blackbox2>
Blackbox1 _A_data
protected

◆ _B_data

template<class _Blackbox1, class _Blackbox2>
Blackbox2 _B_data
protected

◆ _z

template<class _Blackbox1, class _Blackbox2>
BlasVector<Field> _z
mutableprotected

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