Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

Sum Class Template Reference
[linbox/blackbox]

#include <sum.h>

Inheritance diagram for Sum:

BlackboxInterface

Detailed Description

template<class Blackbox1, class Blackbox2>
class LinBox::Sum< 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., Sum(A,B)x=(A+B)x=Ax+Bx

Parameters:
Vector {LinBox} dense or sparse vector of field elements


Public Types

typedef Blackbox1::Field Field
typedef Blackbox1::Element Element

Public Member Functions

 Sum (const Blackbox1 &A, const Blackbox2 &B)
 Sum (const Blackbox1 *A_ptr, const Blackbox2 *B_ptr)
 Sum (const Sum< Blackbox1, Blackbox2 > &M)
 ~Sum (void)
 Destructor.

template<class OutVector, class InVector> OutVector & apply (OutVector &y, const InVector &x) const
template<class OutVector, class InVector> OutVector & applyTranspose (OutVector &y, const InVector &x) const
size_t rowdim (void) const
size_t coldim (void) const
const Fieldfield () const

Protected Attributes

const Blackbox1 * _A_ptr
const Blackbox2 * _B_ptr
std::vector< Element_z1
std::vector< Element_z2


Member Typedef Documentation

typedef Blackbox1::Field Field
 

typedef Blackbox1::Element Element
 


Constructor & Destructor Documentation

Sum 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,B: black box matrices.

Sum const Blackbox1 *  A_ptr,
const Blackbox2 *  B_ptr
[inline]
 

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

Parameters:
A_ptr,B_ptr: pointers to black box matrices.

Sum const Sum< Blackbox1, Blackbox2 > &  M  )  [inline]
 

Copy constructor. Creates new black box objects in dynamic memory.

Parameters:
M constant reference to compose black box matrix

~Sum void   )  [inline]
 

Destructor.


Member Function Documentation

OutVector& apply OutVector &  y,
const InVector &  x
const [inline]
 

Application of BlackBox matrix. y= (A+B)*x. Requires one vector conforming to the {LinBox} vector archetype. Required by abstract base class.

Returns:
reference to vector y containing output.
Parameters:
x constant reference to vector to contain input

OutVector& applyTranspose OutVector &  y,
const InVector &  x
const [inline]
 

Application of BlackBox matrix transpose. y= transpose(A+B)*x. Requires one vector conforming to the {LinBox} vector archetype. Required by abstract base class.

Returns:
reference to vector y containing output.
Parameters:
x constant reference to vector to contain input

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.

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.

const Field& field  )  const [inline]
 


Field Documentation

const Blackbox1* _A_ptr [protected]
 

const Blackbox2* _B_ptr [protected]
 

std::vector<Element> _z1 [mutable, protected]
 

std::vector<Element> _z2 [mutable, protected]
 


Generated on Fri Jul 8 10:29:50 2005 for linbox by doxygen 1.3.7