Mentions légales du service

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

Handle in gemv() the mul. A'*v with A a complex mat.

parent 35dc155f
No related branches found
No related tags found
No related merge requests found
...@@ -271,7 +271,7 @@ void Faust::gemv(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> & ...@@ -271,7 +271,7 @@ void Faust::gemv(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> &
px = &x; px = &x;
if (typeA == 'T') if (typeA == 'T' || typeA == 'H')
{ {
nbRowOpA = A.getNbCol(); nbRowOpA = A.getNbCol();
nbColOpA = A.getNbRow(); nbColOpA = A.getNbRow();
...@@ -297,7 +297,7 @@ void Faust::gemv(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> & ...@@ -297,7 +297,7 @@ void Faust::gemv(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> &
#ifdef __GEMM_WITH_OPENBLAS__ #ifdef __GEMM_WITH_OPENBLAS__
CBLAS_TRANSPOSE transA,transB; CBLAS_TRANSPOSE transA,transB;
if (typeA=='T') if (typeA=='T' || typeB == 'H')
transA = CblasTrans; transA = CblasTrans;
else else
transA = CblasNoTrans; transA = CblasNoTrans;
...@@ -314,28 +314,33 @@ void Faust::gemv(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> & ...@@ -314,28 +314,33 @@ void Faust::gemv(const Faust::MatDense<FPP,Cpu> & A,const Faust::Vect<FPP,Cpu> &
else if (typeA == 'N') else if (typeA == 'N')
{ {
y.vec.noalias() = alpha * A.mat * px->vec; y.vec.noalias() = alpha * A.mat * px->vec;
}else }else if (typeA == 'T')
{ {
y.vec.noalias() = alpha * A.mat.transpose() * px->vec; y.vec.noalias() = alpha * A.mat.transpose() * px->vec;
}else // typeA == 'H'
{
y.vec.noalias() = alpha * A.mat.adjoint() * px->vec;
} }
}else }else
{ {
if (typeA == 'N') if (typeA == 'N')
{ {
y.vec = alpha * A.mat * px->vec + beta * y.vec; y.vec = alpha * A.mat * px->vec + beta * y.vec;
}else }else if(typeA == 'T')
{ {
y.vec = alpha * A.mat.transpose() * px->vec + beta * y.vec; y.vec = alpha * A.mat.transpose() * px->vec + beta * y.vec;
} }
else // typeA == 'H'
{
y.vec = alpha * A.mat.adjoint() * px->vec + beta * y.vec;
}
} }
#else #else
Faust::cblas_gemv<FPP>(CblasColMajor,transA,A.getNbRow(),A.getNbCol(),alpha,A.getData(),A.getNbRow(),px->getData(),1,beta,y.getData(),1); Faust::cblas_gemv<FPP>(CblasColMajor,transA,A.getNbRow(),A.getNbCol(),alpha,A.getData(),A.getNbRow(),px->getData(),1,beta,y.getData(),1);
#endif #endif
if ((&x) == (&y)) if ((&x) == (&y))
delete px; delete px;
px=NULL; px=NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment