Mentions légales du service

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

Minor change.

Comment in prox_sp.
parent 43fd166a
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ Faust::TransformHelper<FPP,DEVICE>* Faust::hierarchical(const Faust::MatDense<FP
id_dims[0] = res_cons->get_rows();
id_dims[1] = res_cons->get_cols();
}
else //if(! is_update_way_R2L && is_fact_side_left && is_update_way_R2L && ! is_fact_side_left)
else //if(! is_update_way_R2L && is_fact_side_left || is_update_way_R2L && ! is_fact_side_left)
{
zero_dims[0] = res_cons->get_rows();
zero_dims[1] = res_cons->get_cols();
......
......@@ -15,8 +15,8 @@ void Faust::palm4msa2(const Faust::MatDense<FPP,DEVICE>& A,
const bool on_gpu /*=false*/)
{
double norm1, norm2;
std::cout << "palm4msa2 "<< std::endl;
std::cout << "on_gpu: " << on_gpu << std::endl;
// std::cout << "palm4msa2 "<< std::endl;
// std::cout << "on_gpu: " << on_gpu << std::endl;
if(constraints.size() == 0)
throw out_of_range("No constraint passed to palm4msa.");
const Real<FPP> lipschitz_multiplicator = 1.001;
......
......@@ -74,20 +74,20 @@ void Faust::prox_sp(Faust::MatDense<FPP,Cpu> & M,faust_unsigned_int k, const boo
const faust_unsigned_int dim2 = M.getNbCol();
const faust_unsigned_int nb_elt_mat = dim1*dim2;
if(pos) Faust::pre_prox_pos(M);
if (k<=0)
if (k<=0) // it can't be < 0, k is a faust_unsigned_int
M.setZeros();
else
{
if (k<nb_elt_mat /* && k < M.getNonZeros()*/)
{
const std::vector<FPP> vec(M.getData(), M.getData()+nb_elt_mat);
std::vector<int> index;
Faust::sort_idx(vec, index, k);
index.erase(index.begin()+k, index.end());
const std::vector<FPP> vec(M.getData(), M.getData()+nb_elt_mat);
std::vector<int> index;
Faust::sort_idx(vec, index, k);
index.erase(index.begin()+k, index.end());
M.setZeros();
for (int i=0 ; i<index.size() ; i++)
M.getData()[index[i]] = vec[index[i]];
M.setZeros();
for (int i=0 ; i<index.size() ; i++)
M.getData()[index[i]] = vec[index[i]];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment