Mentions légales du service

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

nettoyage classe C++ faust_core : method push_back push_first

parent 9a361bd6
Branches
Tags
No related merge requests found
......@@ -83,11 +83,6 @@ 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();
......
......@@ -9,7 +9,7 @@
#include <iostream>
#include "faust_exception.h"
#include <fstream>
#include "faust_BlasHandle.h"
#include "faust_BlasHandle.h"
#include "faust_SpBlasHandle.h"
......@@ -271,13 +271,13 @@ Faust::MatDense<FPP,Cpu> Faust::Transform<FPP,Cpu>::get_product()const
return prod;
}
template<typename FPP>
Faust::MatDense<FPP,Cpu> Faust::Transform<FPP,Cpu>::get_product(Faust::BlasHandle<Cpu> blas_handle, Faust::SpBlasHandle<Cpu> spblas_handle)const
{
return (*this).get_product();
}
template<typename FPP>
Faust::MatDense<FPP,Cpu> Faust::Transform<FPP,Cpu>::get_product(Faust::BlasHandle<Cpu> blas_handle, Faust::SpBlasHandle<Cpu> spblas_handle)const
{
return (*this).get_product();
}
template<typename FPP>
faust_unsigned_int Faust::Transform<FPP,Cpu>::getNbRow() const
......@@ -388,69 +388,11 @@ 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