Mentions légales du service

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

Minor changes related to eigtj.

- Changing compiler constant name about "optimization through linear combinations instead of whole product" in update_L C++ Afunctions.
- Replacing fgft_givens (deleted old alias) by eigtj in FaustFactoryTest.m.
parent 8b560917
Branches
Tags
No related merge requests found
...@@ -234,7 +234,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase ...@@ -234,7 +234,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
import matfaust.* import matfaust.*
load([this.faust_paths{1} '../../../misc/data/mat/test_GivensDiag_Lap_U_J.mat']) load([this.faust_paths{1} '../../../misc/data/mat/test_GivensDiag_Lap_U_J.mat'])
% Lap and J available % Lap and J available
[F,D] = matfaust.fact.fgft_givens(Lap, 'nGivens', J, 'enable_large_Faust', true, 'nGivens_per_fac', 1);%, 0, 'verbosity', 1); [F,D] = matfaust.fact.eigtj(Lap, 'nGivens', J, 'enable_large_Faust', true, 'nGivens_per_fac', 1);%, 0, 'verbosity', 1);
this.verifyEqual(size(F), size(Lap)) this.verifyEqual(size(F), size(Lap))
%disp('norm F: ') %disp('norm F: ')
%norm(F, 'fro') %norm(F, 'fro')
...@@ -254,7 +254,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase ...@@ -254,7 +254,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
import matfaust.* import matfaust.*
load([this.faust_paths{1} '../../../misc/data/mat/test_GivensDiag_Lap_U_J.mat']) load([this.faust_paths{1} '../../../misc/data/mat/test_GivensDiag_Lap_U_J.mat'])
% Lap and J available % Lap and J available
[F,D] = matfaust.fact.fgft_givens(sparse(Lap), 'nGivens', J, 'enable_large_Faust', true, 'nGivens_per_fac', 1);%, 0, 'verbosity', 1); [F,D] = matfaust.fact.eigtj(sparse(Lap), 'nGivens', J, 'enable_large_Faust', true, 'nGivens_per_fac', 1);%, 0, 'verbosity', 1);
this.verifyEqual(size(F), size(Lap)) this.verifyEqual(size(F), size(Lap))
%disp('norm F: ') %disp('norm F: ')
%norm(F, 'fro') %norm(F, 'fro')
...@@ -275,7 +275,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase ...@@ -275,7 +275,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
load([this.faust_paths{1} '../../../misc/data/mat/test_GivensDiag_Lap_U_J.mat']) load([this.faust_paths{1} '../../../misc/data/mat/test_GivensDiag_Lap_U_J.mat'])
% Lap and J available % Lap and J available
t = size(Lap,1)/2; t = size(Lap,1)/2;
[F,D] = matfaust.fact.fgft_givens(Lap, 'nGivens', J, 'nGivens_per_fac', t, 'enable_large_Faust', true); %, 'verbosity', 2); [F,D] = matfaust.fact.eigtj(Lap, 'nGivens', J, 'nGivens_per_fac', t, 'enable_large_Faust', true); %, 'verbosity', 2);
this.verifyEqual(size(F), size(Lap)) this.verifyEqual(size(F), size(Lap))
%disp('norm F: ') %disp('norm F: ')
%norm(F, 'fro') %norm(F, 'fro')
...@@ -296,7 +296,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase ...@@ -296,7 +296,7 @@ classdef FaustFactoryTest < matlab.unittest.TestCase
load([this.faust_paths{1} '../../../misc/data/mat/test_GivensDiag_Lap_U_J.mat']) load([this.faust_paths{1} '../../../misc/data/mat/test_GivensDiag_Lap_U_J.mat'])
% Lap and J available % Lap and J available
t = size(Lap,1)/2; t = size(Lap,1)/2;
[F,D] = matfaust.fact.fgft_givens(sparse(Lap), 'nGivens', J, 'nGivens_per_fac', t, 'enable_large_Faust', true); %, 'verbosity', 2); [F,D] = matfaust.fact.eigtj(sparse(Lap), 'nGivens', J, 'nGivens_per_fac', t, 'enable_large_Faust', true); %, 'verbosity', 2);
this.verifyEqual(size(F), size(Lap)) this.verifyEqual(size(F), size(Lap))
%disp('norm F: ') %disp('norm F: ')
%norm(F, 'fro') %norm(F, 'fro')
......
...@@ -197,8 +197,7 @@ void GivensFGFT<FPP,DEVICE,FPP2>::update_L(Faust::MatDense<FPP,Cpu> & L) ...@@ -197,8 +197,7 @@ void GivensFGFT<FPP,DEVICE,FPP2>::update_L(Faust::MatDense<FPP,Cpu> & L)
#ifdef DEBUG_GIVENS #ifdef DEBUG_GIVENS
cout << "L(p,q) before update_L():" << *this->L(p,q) << endl; cout << "L(p,q) before update_L():" << *this->L(p,q) << endl;
#endif #endif
#define OPT_UPDATE_L #ifdef NO_OPT_UPDATE_L
#ifndef OPT_UPDATE_L
this->facts[this->ite].multiply(L, 'T'); this->facts[this->ite].multiply(L, 'T');
L.multiplyRight(this->facts[this->ite]); L.multiplyRight(this->facts[this->ite]);
#else #else
......
...@@ -234,8 +234,7 @@ void GivensFGFTComplex<FPP,DEVICE,FPP2>::update_L(Faust::MatDense<FPP,Cpu> & L) ...@@ -234,8 +234,7 @@ void GivensFGFTComplex<FPP,DEVICE,FPP2>::update_L(Faust::MatDense<FPP,Cpu> & L)
//Faust::MatDense<FPP,Cpu> L_copy = L; //Faust::MatDense<FPP,Cpu> L_copy = L;
cout << "L(p,q) before update_L():" << L(this->p,this->q) << endl; cout << "L(p,q) before update_L():" << L(this->p,this->q) << endl;
#endif #endif
#define OPT_UPDATE_L_CPLX #ifdef NO_OPT_UPDATE_L_CPLX
#ifndef OPT_UPDATE_L_CPLX
this->facts[this->ite].multiply(L, 'H'); this->facts[this->ite].multiply(L, 'H');
L.multiplyRight(this->facts[this->ite]); L.multiplyRight(this->facts[this->ite]);
// facts[ite].multiply(L, 'N'); // facts[ite].multiply(L, 'N');
......
...@@ -82,8 +82,10 @@ template<typename FPP, FDevice DEVICE, typename FPP2> ...@@ -82,8 +82,10 @@ template<typename FPP, FDevice DEVICE, typename FPP2>
void GivensFGFTParallel<FPP,DEVICE,FPP2>::update_L(Faust::MatDense<FPP,Cpu> & L) void GivensFGFTParallel<FPP,DEVICE,FPP2>::update_L(Faust::MatDense<FPP,Cpu> & L)
{ {
// L = S'*L*S // L = S'*L*S
//#undef OPT_UPDATE_L #ifdef NO_OPT_UPDATE_L
#ifdef OPT_UPDATE_L this->facts[this->ite].multiply(L, 'T');
L.multiplyRight(this->facts[this->ite]);
#else
int choice_id; int choice_id;
FPP2 c,s; FPP2 c,s;
int p, q, i; int p, q, i;
...@@ -141,9 +143,6 @@ void GivensFGFTParallel<FPP,DEVICE,FPP2>::update_L(Faust::MatDense<FPP,Cpu> & L) ...@@ -141,9 +143,6 @@ void GivensFGFTParallel<FPP,DEVICE,FPP2>::update_L(Faust::MatDense<FPP,Cpu> & L)
this->update_L_second(L_vec_p, L_vec_q, c, s, p, q, L); this->update_L_second(L_vec_p, L_vec_q, c, s, p, q, L);
} }
} }
#else
this->facts[this->ite].multiply(L, 'T');
L.multiplyRight(this->facts[this->ite]);
#endif #endif
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment