Mentions légales du service

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

revert faust_Transform

parent a1a9c5d5
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
//modif AL AL
#include "faust_transform_algebra.h"
//#include "faust_Vect.h"
......@@ -83,6 +84,11 @@ namespace Faust
void init_from_file(const char* filename);
long long int get_total_nnz()const{return totalNonZeros;}
void clear(){data.resize(0);totalNonZeros=0;}
void push_back(const Faust::MatSparse<FPP,Cpu>& S);
void push_first(const Faust::MatSparse<FPP,Cpu>& S);
void pop_back(Faust::MatSparse<FPP,Cpu>& S);
void pop_first(Faust::MatSparse<FPP,Cpu>& S);
void pop_first(Faust::MatSparse<FPP,Cpu>& S) const;
void Display()const;
void transpose();
void updateNonZeros();
......
#ifndef __FAUSTCORE_HPP__
#define __FAUSTCORE_HPP__
#include "faust_Vect.h"
//#include "faust_HierarchicalFact.h"
//#include "faust_Params.h"
......@@ -388,11 +389,69 @@ Faust::MatSparse<FPP,Cpu> Faust::Transform<FPP,Cpu>::get_fact(int id)const
return data[id];
}
template<typename FPP>
void Faust::Transform<FPP,Cpu>::push_back(const Faust::MatSparse<FPP,Cpu>& S)
{
if (size()>0)
{
if(data[size()-1].getNbCol()!=S.getNbRow() || S.getNbRow()<1)
{
handleError(m_className,"push_back : incorrect dimensions");
}
}
data.push_back(S);
totalNonZeros += S.getNonZeros();
}
template<typename FPP>
void Faust::Transform<FPP,Cpu>::push_first(const Faust::MatSparse<FPP,Cpu>& S)
{
if (size()>0)
if(data[0].getNbRow()!=S.getNbCol() || S.getNbRow()<1)
{
handleError(m_className,"push_first : incorrect dimensions");
}
data.insert(data.begin(),S);
totalNonZeros += S.getNonZeros();
}
template<typename FPP>
void Faust::Transform<FPP,Cpu>::pop_back(Faust::MatSparse<FPP,Cpu>& S)
{
if (size()>0)
{
S = data[size()-1];
data.pop_back();
totalNonZeros -= S.getNonZeros();
}
handleWarning("Faust::Transform<FPP,Cpu>::pop_back : empty Faust::Transform");
}
template<typename FPP>
void Faust::Transform<FPP,Cpu>::pop_first(Faust::MatSparse<FPP,Cpu>& S)
{
if (size()>0)
{
S = data[0];
data.erase(data.begin());
totalNonZeros -= S.getNonZeros();
}
handleWarning("Faust::Transform<FPP,Cpu>::pop_back : empty Faust::Transform");
}
template<typename FPP>
void Faust::Transform<FPP,Cpu>::pop_first(Faust::MatSparse<FPP,Cpu>& S) const
{
if (size()>0)
{
S = data[0];
//data.erase(data.begin());
//totalNonZeros -= S.getNonZeros();
}
}
template<typename FPP>
void Faust::Transform<FPP,Cpu>::transpose()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment