Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 2773c152 authored by hhakim's avatar hhakim
Browse files

Fix namespace issues due to the choice to avoid 'using namespace' in cpp headers.

parent 836902ac
Branches
Tags
No related merge requests found
......@@ -163,11 +163,11 @@ Faust::MatDense<FPP,Cpu> Faust::MatDense<FPP,Cpu>::lower_tri(const bool diag) co
else
tri.mat = mat.template triangularView<Eigen::StrictlyLower>();
#ifdef DEBUG_TRI
cout << "MatDense::lower_tri(" << diag << ")" << endl;
cout << "orig. mat.:" << endl;
cout << mat << endl;
cout << "tri. mat.:" << endl;
cout << tri.mat << endl;
std::cout << "MatDense::lower_tri(" << diag << ")" <<std::endl;
std::cout << "orig. mat.:" <<std::endl;
std::cout << mat <<std::endl;
std::cout << "tri. mat.:" <<std::endl;
std::cout << tri.mat <<std::endl;
#endif
return tri;
}
......@@ -181,23 +181,23 @@ Faust::MatDense<FPP,Cpu> Faust::MatDense<FPP,Cpu>::upper_tri(const bool diag) co
else
tri.mat = mat.template triangularView<Eigen::StrictlyUpper>();
#ifdef DEBUG_TRI
cout << "MatDense::upper_tri(" << diag << ")" << endl;
cout << "orig. mat.:" << endl;
cout << mat << endl;
cout << "tri. mat.:" << endl;
cout << tri.mat << endl;
std::cout << "MatDense::upper_tri(" << diag << ")" <<std::endl;
std::cout << "orig. mat.:" <<std::endl;
std::cout << mat <<std::endl;
std::cout << "tri. mat.:" <<std::endl;
std::cout << tri.mat <<std::endl;
#endif
return tri;
}
template<typename FPP>
list<pair<int,int>> Faust::MatDense<FPP,Cpu>::nonzeros_indices() const
std::list<std::pair<int,int>> Faust::MatDense<FPP,Cpu>::nonzeros_indices() const
{
list<pair<int,int>> nz_inds;
std::list<std::pair<int,int>> nz_inds;
if(this->is_identity)
for(int i=0;i<std::min(this->dim1, this->dim2);i++)
nz_inds.push_back(make_pair(i,i));
nz_inds.push_back(std::make_pair(i,i));
else if(! isZeros)
{
int i,j;
......@@ -206,7 +206,7 @@ list<pair<int,int>> Faust::MatDense<FPP,Cpu>::nonzeros_indices() const
{
j = k/this->dim1;
i = k-j*this->dim1;
nz_inds.push_back(make_pair(i,j));
nz_inds.push_back(std::make_pair(i,j));
}
}
return nz_inds;
......@@ -708,7 +708,7 @@ std::string Faust::MatDense<FPP,Cpu>::to_string(const bool transpose /* set to f
str<<" DENSE, "; //number of trailing spaces matters to align with SPARSE to_string()
str << Faust::MatGeneric<FPP,Cpu>::to_string(transpose);
if(isZeros)
str <<"zeros matrix flag" << endl;
str <<"zeros matrix flag" <<std::endl;
else
{
if (displaying_small_mat_elts && this->dim1*this->dim2 < 100)
......@@ -717,7 +717,7 @@ std::string Faust::MatDense<FPP,Cpu>::to_string(const bool transpose /* set to f
{
for(int j=0 ; j<this->dim2 ; j++)
str << (*this)(i,j) << " " ;
str << endl;
str << std::endl;
}
}
}
......@@ -736,13 +736,13 @@ void Faust::MatDense<FPP,Cpu>::Display() const
template<typename FPP>
void Faust::MatDense<FPP,Cpu>::print_file(const char* filename)const
{
ofstream fichier;
std::ofstream fichier;
fichier.open(filename);
for (int i=0 ; i<this->getNbRow() ; i++)
{
for (int j=0 ; j<this->getNbCol() ; j++)
fichier << setprecision(20) <<mat(i,j) << " ";
fichier << endl;
fichier << std::setprecision(20) <<mat(i,j) << " ";
fichier << std::endl;
}
fichier.close();
}
......@@ -907,11 +907,11 @@ void Faust::MatDense<FPP,Cpu>::init_from_file(const char* filename)
// chacune des autres lignes contient une valeur par ligne
// suivant la premiere dimension puis la deuxieme
ifstream* vec_stream;
vec_stream = new ifstream(filename);
std::ifstream* vec_stream;
vec_stream = new std::ifstream(filename);
if (!vec_stream->is_open())
handleError(m_className, "init_from_file : unable to open file");
istream_iterator<FPP> start(*vec_stream), eos;
std::istream_iterator<FPP> start(*vec_stream), eos;
std::vector<FPP> vec(start, eos);
if((vec[0]*vec[1]+2) != vec.size())
......@@ -1272,29 +1272,29 @@ Faust::Timer Faust::MatDense<FPP,Cpu>::t_power_iteration;
template<typename FPP>
void Faust::MatDense<FPP,Cpu>::print_timers()const
{
cout << "timers in Faust::MatDense :" << endl;
cout << "t_constr = " << t_constr.get_time() << " s for "<< t_constr.get_nb_call() << " calls" << endl;
cout << "t_get_coeff = " << t_get_coeff.get_time() << " s for "<< t_get_coeff.get_nb_call() << " calls" << endl;
cout << "t_get_coeffs = " << t_get_coeffs.get_time() << " s for "<< t_get_coeffs.get_nb_call() << " calls" << endl;
cout << "t_set_coeff = " << t_set_coeff.get_time() << " s for "<< t_set_coeff.get_nb_call() << " calls" << endl;
cout << "t_set_coeffs = " << t_set_coeffs.get_time() << " s for "<< t_set_coeffs.get_nb_call() << " calls" << endl;
cout << "t_set_coeffs2 = " << t_set_coeffs2.get_time() << " s for "<< t_set_coeffs2.get_nb_call() << " calls" << endl;
cout << "t_resize = " << t_resize.get_time() << " s for "<< t_resize.get_nb_call() << " calls" << endl;
cout << "t_check_dim = " << t_check_dim.get_time() << " s for "<< t_check_dim.get_nb_call() << " calls" << endl;
cout << "t_max = " << t_max.get_time() << " s for "<< t_max.get_nb_call() << " calls" << endl;
cout << "t_transpose = " << t_transpose.get_time() << " s for "<< t_transpose.get_nb_call() << " calls" << endl;
cout << "t_mult_right = " << t_mult_right.get_time() << " s for "<< t_mult_right.get_nb_call() << " calls" << endl;
cout << "t_mult_left = " << t_mult_left.get_time() << " s for "<< t_mult_left.get_nb_call() << " calls" << endl;
cout << "t_scalar_multiply = " << t_scalar_multiply.get_time() << " s for "<< t_scalar_multiply.get_nb_call() << " calls" << endl;
cout << "t_add = " << t_add.get_time() << " s for "<< t_add.get_nb_call() << " calls" << endl;
cout << "t_sub = " << t_sub.get_time() << " s for "<< t_sub.get_nb_call() << " calls" << endl;
cout << "t_print_file = " << t_print_file.get_time() << " s for "<< t_print_file.get_nb_call() << " calls" << endl<<endl;
cout << "timers in Faust::MatDense / LinearAlgebra :" << endl;
cout << "t_multiply = " << t_multiply.get_time() << " s for "<< t_multiply.get_nb_call() << " calls" << endl;
cout << "t_gemm = " << t_gemm.get_time() << " s for "<< t_gemm.get_nb_call() << " calls" << endl;
cout << "t_add_ext = " << t_add_ext.get_time() << " s for "<< t_add_ext.get_nb_call() << " calls" << endl<<endl<<endl;
std::cout << "timers in Faust::MatDense :" << std::endl;
std::cout << "t_constr = " << t_constr.get_time() << " s for "<< t_constr.get_nb_call() << " calls" << std::endl;
std::cout << "t_get_coeff = " << t_get_coeff.get_time() << " s for "<< t_get_coeff.get_nb_call() << " calls" << std::endl;
std::cout << "t_get_coeffs = " << t_get_coeffs.get_time() << " s for "<< t_get_coeffs.get_nb_call() << " calls" << std::endl;
std::cout << "t_set_coeff = " << t_set_coeff.get_time() << " s for "<< t_set_coeff.get_nb_call() << " calls" << std::endl;
std::cout << "t_set_coeffs = " << t_set_coeffs.get_time() << " s for "<< t_set_coeffs.get_nb_call() << " calls" << std::endl;
std::cout << "t_set_coeffs2 = " << t_set_coeffs2.get_time() << " s for "<< t_set_coeffs2.get_nb_call() << " calls" << std::endl;
std::cout << "t_resize = " << t_resize.get_time() << " s for "<< t_resize.get_nb_call() << " calls" << std::endl;
std::cout << "t_check_dim = " << t_check_dim.get_time() << " s for "<< t_check_dim.get_nb_call() << " calls" << std::endl;
std::cout << "t_max = " << t_max.get_time() << " s for "<< t_max.get_nb_call() << " calls" << std::endl;
std::cout << "t_transpose = " << t_transpose.get_time() << " s for "<< t_transpose.get_nb_call() << " calls" << std::endl;
std::cout << "t_mult_right = " << t_mult_right.get_time() << " s for "<< t_mult_right.get_nb_call() << " calls" << std::endl;
std::cout << "t_mult_left = " << t_mult_left.get_time() << " s for "<< t_mult_left.get_nb_call() << " calls" << std::endl;
std::cout << "t_scalar_multiply = " << t_scalar_multiply.get_time() << " s for "<< t_scalar_multiply.get_nb_call() << " calls" << std::endl;
std::cout << "t_add = " << t_add.get_time() << " s for "<< t_add.get_nb_call() << " calls" << std::endl;
std::cout << "t_sub = " << t_sub.get_time() << " s for "<< t_sub.get_nb_call() << " calls" << std::endl;
std::cout << "t_print_file = " << t_print_file.get_time() << " s for "<< t_print_file.get_nb_call() << " calls" << std::endl<<std::endl;
std::cout << "timers in Faust::MatDense / LinearAlgebra :" << std::endl;
std::cout << "t_multiply = " << t_multiply.get_time() << " s for "<< t_multiply.get_nb_call() << " calls" << std::endl;
std::cout << "t_gemm = " << t_gemm.get_time() << " s for "<< t_gemm.get_nb_call() << " calls" << std::endl;
std::cout << "t_add_ext = " << t_add_ext.get_time() << " s for "<< t_add_ext.get_nb_call() << " calls" << std::endl<<std::endl<<std::endl;
}
#endif
......
......@@ -79,17 +79,17 @@ namespace Faust
FPP fabs(std::complex<FPP> c);
template<typename FPP,Device DEVICE>
class Vect;
class Vect;
template<typename FPP,Device DEVICE>
class MatDense;
class MatDense;
template<typename FPP,Device DEVICE>
class MatSparse;
class MatSparse;
template<typename FPP>
class MatDiag;
template<typename FPP>
class MatDiag;
// friend function of faust_linear_algebra.h
template<typename FPP>
......@@ -103,9 +103,11 @@ template<typename FPP>
class Vect<FPP,Cpu>
{
template<class,Device> friend class Vect;
friend double Transform<FPP,Cpu>::normL1(const bool transpose) const;
friend Vect<FPP,Cpu> MatDiag<FPP>::multiply(const Vect<FPP,Cpu> & vec) const;
friend void MatDiag<FPP>::multiply(Vect<FPP,Cpu> & vec, char opThis) const;
// friend double Transform<FPP,Cpu>::normL1(const bool transpose) const;
// friend Vect<FPP,Cpu> MatDiag<FPP>::multiply(const Vect<FPP,Cpu> & vec) const;
friend class Transform<FPP,Cpu>;
friend class MatDiag<FPP>;
// friend void MatDiag<FPP>::multiply(Vect<FPP,Cpu> & vec, char opThis) const;
public :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment