Mentions légales du service

Skip to content
Snippets Groups Projects
Commit f885c19d authored by Nicolas Bellot's avatar Nicolas Bellot Committed by hhakim
Browse files

attribut de faust_Transform redevient public, remise des friend function

parent 7a19fff3
Branches
Tags
No related merge requests found
......@@ -30,6 +30,14 @@ namespace Faust
template<Device DEVICE> class BlasHandle;
template<Device DEVICE> class SpBlasHandle;
// forward definition of friend function
template<typename FPP>
Faust::Vect<FPP,Cpu> operator*(const Transform<FPP,Cpu>& f, const Faust::Vect<FPP,Cpu>& v);
template<typename FPP>
Faust::MatDense<FPP,Cpu> operator*(const Transform<FPP,Cpu>& f, const Faust::MatDense<FPP,Cpu>& M);
template<typename FPP>
class Transform<FPP,Cpu> : public Faust::LinearOperator<FPP,Cpu>
{
......@@ -102,37 +110,29 @@ namespace Faust
// WARNING
// MODIF AL AL data must be private...
std::vector<Faust::MatSparse<FPP,Cpu> > data;
private:
long long int totalNonZeros;
static const char * class_name;
std::vector<Faust::MatSparse<FPP,Cpu> > data;
// modif AL
//friend Faust::Vect<FPP,Cpu> operator*<>(const Transform<FPP,Cpu>& f, const Faust::Vect<FPP,Cpu>& v);
// friend Faust::Vect<FPP,Cpu> operator*<>(const Transform<FPP,Cpu>& f, const Faust::Vect<FPP,Cpu>& v);
//friend Faust::MatDense<FPP,Cpu> operator*<>(const Transform<FPP,Cpu>& f, const Faust::MatDense<FPP,Cpu>& M);
//friend Faust::MatDense<FPP,Cpu> operator*<>(const Transform<FPP,Cpu>& f, const Faust::MatDense<FPP,Cpu>& M);
friend void Faust::multiply<>(const Transform<FPP,Cpu> & A, const Faust::MatDense<FPP,Cpu> & B, Faust::MatDense<FPP,Cpu> & C,const FPP & alpha, char typeA, char typeMult);
// friend function
friend Faust::Vect<FPP,Cpu> Faust::operator*<>(const Transform<FPP,Cpu>& f, const Faust::Vect<FPP,Cpu>& v);
friend Faust::MatDense<FPP,Cpu> Faust::operator*<>(const Transform<FPP,Cpu>& f, const Faust::MatDense<FPP,Cpu>& M);
};
}
//// modif AL en premier avt classe Transform mais déja défini dans faust_transform_algebra.h
//template<typename FPP,Device DEVICE> class MatDense;
//template<typename FPP,Device DEVICE> class Vect;
//template<typename FPP,Device DEVICE> class Transform;
//
//template<typename FPP>
//Faust::Vect<FPP,Cpu> operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::Vect<FPP,Cpu>& v);
//template<typename FPP>
//Faust::MatDense<FPP,Cpu> operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::MatDense<FPP,Cpu>& M);
#include "faust_Transform.hpp"
......
......@@ -6,49 +6,49 @@
#include <vector>
#include <iterator>
#include "faust_exception.h"
// modif AL
//#include "faust_linear_algebra.h"
// modif AL
//#include "faust_linear_algebra.h"
#ifdef __COMPILE_TIMERS__
#include "faust_Timer.h"
#endif
//! \class Faust::Vect faust_Vect.h
//! \brief Class template representing dense vector <br>
//! This class implements basic linear algebra operation (addition, multiplication, frobenius and spectral norm...) <br>
//template<typename FPP,Device DEVICE>
//class Vect;
//template<typename FPP,Device DEVICE>
//class MatDense;
//template<typename FPP>
//void Faust::gemv(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> & x,Faust::Vect<FPP,Cpu> & y,const FPP & alpha, const FPP & beta, char typeA);
//! \namespace Faust
//! \brief Faust namespace contains the principal class of the project.
namespace Faust
//template<typename FPP>
//
//! \namespace Faust
//! \brief Faust namespace contains the principal class of the project.
namespace Faust
{
template<typename FPP,Device DEVICE>
class Vect;
//// modif AL AL
template<typename FPP,Device DEVICE>
class MatDense;
template<typename FPP,Device DEVICE>
class MatSparse;
template<typename FPP>
Vect<FPP,Cpu> solve(const Faust::MatDense<FPP,Cpu> & A, const Vect<FPP,Cpu> & v);
template<typename FPP>
template<typename FPP,Device DEVICE>
class Vect;
template<typename FPP,Device DEVICE>
class MatDense;
template<typename FPP,Device DEVICE>
class MatSparse;
// friend function of faust_linear_algebra.h
template<typename FPP>
void gemv(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> & x,Faust::Vect<FPP,Cpu> & y,const FPP & alpha, const FPP & beta, char typeA);
template<typename FPP>
class Vect<FPP,Cpu>
{
template<class,Device> friend class Vect;
......@@ -78,13 +78,13 @@ namespace Faust
void normalize(){scalarMultiply(1/norm());}
// multiply (*this) = A * (*this)
// multiply (*this) = A * (*this)
// modif AL AL
//void multiplyLeft(Faust::MatDense<FPP,Cpu> const& A){Faust::gemv(A, *this, *this, 1.0, 0.0, 'N');}
//! \brief
//! \brief Vect::multiplyLeft is used to replace this by A * (*this)
//! \param A is a matrix (dense or sparse).
void multiplyLeft(Faust::MatDense<FPP,Cpu> const& A); //{Faust::gemv(A, *this, *this, 1.0, 0.0, 'N');}
//void multiplyLeft(Faust::MatDense<FPP,Cpu> const& A){Faust::gemv(A, *this, *this, 1.0, 0.0, 'N');}
//! \brief
//! \brief Vect::multiplyLeft is used to replace this by A * (*this)
//! \param A is a matrix (dense or sparse).
void multiplyLeft(Faust::MatDense<FPP,Cpu> const& A); //{Faust::gemv(A, *this, *this, 1.0, 0.0, 'N');}
void multiplyLeft(Faust::MatSparse<FPP,Cpu> const& A);
FPP sum()const{return vec.sum();}
......@@ -109,11 +109,11 @@ namespace Faust
const FPP& operator()(faust_unsigned_int i)const{return vec(i);}
bool equality(Vect<FPP,Cpu> const &x, FPP precision) const;
// MODIF AL AL AL
// friend algebra
//friend void Faust::gemv(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> & x,Faust::Vect<FPP,Cpu> & y,const FPP & alpha, const FPP & beta, char typeA);
friend void Faust::gemv<>(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> & x,Faust::Vect<FPP,Cpu> & y,const FPP & alpha, const FPP & beta, char typeA);
private:
faust_unsigned_int dim;
......@@ -125,16 +125,11 @@ namespace Faust
Faust::Timer t_local_multiplyLeft;
#endif
};
}
//template<typename FPP,Device DEVICE>
//class MatDense;
// function sp_solve is used to ?? nothing not defined
//template<typename FPP>
//void sp_solve(const Faust::MatDense<FPP,Cpu> & A,Faust::Vect<FPP,Cpu> & x, const Faust::Vect<FPP,Cpu> & y);
};
}
#include "faust_Vect.hpp"
......
......@@ -4,20 +4,26 @@
#include "faust_constant.h"
#include "faust_MatSparse.h"
template<typename FPP,Device DEVICE> class MatDense;
template<typename FPP,Device DEVICE> class Vect;
template<typename FPP,Device DEVICE> class Transform;
namespace Faust
{
template<typename FPP>
FPP Faust::power_iteration(const Faust::Transform<FPP,Cpu> & A, const int nbr_iter_max,FPP threshold, int & flag);
template<typename FPP,Device DEVICE> class MatDense;
template<typename FPP,Device DEVICE> class Vect;
template<typename FPP,Device DEVICE> class Transform;
template<typename FPP>
Faust::Vect<FPP,Cpu> operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::Vect<FPP,Cpu> & v);
template<typename FPP>
FPP power_iteration(const Faust::Transform<FPP,Cpu> & A, const int nbr_iter_max,FPP threshold, int & flag);
template<typename FPP>
Faust::MatDense<FPP,Cpu> operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::MatDense<FPP,Cpu> & M);
template<typename FPP>
Faust::Vect<FPP,Cpu> operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::Vect<FPP,Cpu> & v);
template<typename FPP>
Faust::MatDense<FPP,Cpu> operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::MatDense<FPP,Cpu> & M);
}
#include "faust_transform_algebra.hpp"
......
......@@ -169,7 +169,7 @@ FPP Faust::power_iteration(const Faust::Transform<FPP,Cpu> & A, const int nbr_i
template<typename FPP>
Faust::Vect<FPP,Cpu> operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::Vect<FPP,Cpu>& v)
Faust::Vect<FPP,Cpu> Faust::operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::Vect<FPP,Cpu>& v)
{
Faust::Vect<FPP,Cpu> vec(v);
if (f.size() == 0)
......@@ -181,7 +181,7 @@ Faust::Vect<FPP,Cpu> operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::
}
template<typename FPP>
Faust::MatDense<FPP,Cpu> operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::MatDense<FPP,Cpu>& M)
Faust::MatDense<FPP,Cpu> Faust::operator*(const Faust::Transform<FPP,Cpu>& f, const Faust::MatDense<FPP,Cpu>& M)
{
Faust::MatDense<FPP,Cpu> A(M);
if (f.size() == 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment