Mentions légales du service

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

Add C++ hankel prox test.

parent 66bd3edd
Branches
Tags
No related merge requests found
#include "faust_MatDense.h"
#include "faust_prox.h"
#include <iostream>
/** \brief unitary test for MatDense conjugate
*/
typedef @TEST_FPP@ FPP;
using namespace Faust;
using namespace std;
int main(int argc, char* argv[])
{
faust_unsigned_int dim1 = 10;
faust_unsigned_int dim2 = 10;
/* initilisation of the factors of the Faust */
// factor 1
MatDense<FPP,Cpu>* M;
MatDense<FPP,Cpu> M_copy;
M = MatDense<FPP,Cpu>::randMat(dim1,dim2);
Faust::Vect<FPP,Cpu> ad0 = M->adiagonal(0);
cout << "ad0:" << endl;
ad0.Display();
Faust::Vect<FPP,Cpu> ad1 = M->adiagonal(1);
cout << "ad1:" << endl;
ad1.Display();
Faust::Vect<FPP,Cpu> ad_minus1 = M->adiagonal(-1);
cout << "ad_minus1:" << endl;
ad_minus1.Display();
Faust::Vect<FPP,Cpu> ad_minus2 = M->adiagonal(-2);
cout << "ad_minus2:" << endl;
ad_minus2.Display();
//
M_copy = *M;
cout<<"mat value"<<endl;
M->Display();
prox_hankel(M_copy);
M_copy.Display();
cout << "M:" << endl;
for(int i=0;i<M->getNbRow();i++)
{
for(int j=0;j<M->getNbCol();j++)
cout << (*M)(i,j) << " ";
cout << endl;
}
cout << "M_p:" << endl;
for(int i=0;i<M->getNbRow();i++)
{
for(int j=0;j<M->getNbCol();j++)
cout << M_copy(i,j) << " ";
cout << endl;
}
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment