linbox
Data Structures | Namespaces | Functions
mul.h File Reference

BLAS3 multiplication algorithms. More...

#include <vector>
#include "linbox/integer.h"
#include <givaro/extension.h>
#include <linbox/matrix/dense-matrix.h>
#include "linbox/algorithms/matrix-blas3/mul-toomcook.inl"
#include "linbox/algorithms/matrix-blas3/mul-naive.inl"
#include "linbox/algorithms/matrix-blas3/mul-cra.inl"
+ Include dependency graph for mul.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  naive
 Toom-Cook method. More...
 

Namespaces

 LinBox
 Namespace in which all linbox code resides.
 
 LinBox::BLAS3::mulMethod
 BLAS3 Multiplication methods.
 

Functions

template<class Zpz >
BlasMatrix< Zpz > & ToomCook (BlasMatrix< Zpz > &TC, BlasMatrix< Zpz > &iTC)
 Build the Toom-Cook matrix helper. More...
 
template<class Zpz , class GFq >
std::vector< BlasMatrix< Zpz > > & mul (std::vector< BlasMatrix< Zpz > > &C, const std::vector< BlasMatrix< Zpz > > &A, const std::vector< BlasMatrix< Zpz > > &B, const mulMethod::ToomCook< GFq > &T)
 Toom-Cook multiplication for GF(p^e) A matrix over GF(p^e) is represented by a polynomial of Z/pZ matrices. More...
 
template<class Zpz >
BlasMatrix< Givaro::Extension< Zpz > > & mul (BlasMatrix< Givaro::Extension< Zpz > > &C, const BlasMatrix< Givaro::Extension< Zpz > > &A, const BlasMatrix< Givaro::Extension< Zpz > > &B, const mulMethod::ToomCook< Givaro::Extension< Zpz > > &T)
 Toom-Cook multiplication for GF(p^e) More...
 
template<class _anyMatrix , class _otherMatrix1 , class _otherMatrix2 >
_anyMatrix & mul (_anyMatrix &C, const _otherMatrix1 &A, const _otherMatrix2 &B, const mulMethod::naive &)
 Triple loop ! just a simple triple loop. More...
 

Detailed Description

BLAS3 multiplication algorithms.

Function Documentation

◆ ToomCook()

BlasMatrix< Zpz > & ToomCook ( BlasMatrix< Zpz > &  TC,
BlasMatrix< Zpz > &  iTC 
)

Build the Toom-Cook matrix helper.

We only provide this function for dense matrices (Blas for the moment) over Z/pZ.

Parameters
[out]TCmatrix of Fp(i^j)
[out]iTCinverse of TC
Returns
TC

◆ mul() [1/3]

std::vector<BlasMatrix<Zpz> >& LinBox::BLAS3::mul ( std::vector< BlasMatrix< Zpz > > &  C,
const std::vector< BlasMatrix< Zpz > > &  A,
const std::vector< BlasMatrix< Zpz > > &  B,
const mulMethod::ToomCook< GFq > &  T 
)

Toom-Cook multiplication for GF(p^e) A matrix over GF(p^e) is represented by a polynomial of Z/pZ matrices.

Template Parameters
Zpzis some modular field, GFq is Givaro::Extension (or the like)
Parameters
[out]Cresult
Amatrix
Bmatrix
Returns
C=AB
Warning
p should not be too small, and e>1 (you've been warned...)

◆ mul() [2/3]

BlasMatrix< Givaro::Extension< Zpz > > & mul ( BlasMatrix< Givaro::Extension< Zpz > > &  C,
const BlasMatrix< Givaro::Extension< Zpz > > &  A,
const BlasMatrix< Givaro::Extension< Zpz > > &  B,
const mulMethod::ToomCook< Givaro::Extension< Zpz > > &  T 
)

Toom-Cook multiplication for GF(p^e)

Template Parameters
Zpzis some modular field, GFq is Givaro::Extension (or the like)
Parameters
[out]Cresult
Amatrix
Bmatrix
Returns
C=AB
Warning
p should not be too small, and e>1 (you've been warned...)

◆ mul() [3/3]

_anyMatrix & mul ( _anyMatrix &  C,
const _otherMatrix1 &  A,
const _otherMatrix2 &  B,
const mulMethod::naive  
)

Triple loop ! just a simple triple loop.

Precondition
works if _anyMatrix has setEntry and _otherMatrix has getEntry
Parameters
[out]Cresult
[in]Amatrix
[in]Bmatrix
Returns
C=AB