Commit 3149b23f authored by MIJIEUX Thomas's avatar MIJIEUX Thomas

Revert "set indentation and remove trailing whitespace"

This reverts commit 02d6fd3d.
parent 02d6fd3d
......@@ -59,7 +59,7 @@ typedef void (*Callback_RightCond)(void * preCond,int nbVectInBlock,
* @brief Function to perform dot product between a set of vector and a vector:
* vectRes = A^{H} * vectB
*
* @param sizeVect : size of vectors in A and vectB
* @param sizeVect : size of vectors in A and vectB
* @param nbVect : number of vector in A
* @param A : matrix of sizeVect lines and nbVect cols to be transconjugate (or
* transposed in real case)
......
This diff is collapsed.
......@@ -12,101 +12,101 @@
template<typename T,typename S=T>
class UserMatrix{
private:
//Definition of user callbacks
typedef void (*Callback_MatBlockVect)(void * ,int , void * ,void **,void*);
typedef void (*Callback_RightCond)(void * ,int , void * ,void ** , void *);
typedef void (*Callback_DotProduct)(int,int,void *,void*,void*,void*);
//Definition of user callbacks
typedef void (*Callback_MatBlockVect)(void * ,int , void * ,void **,void*);
typedef void (*Callback_RightCond)(void * ,int , void * ,void ** , void *);
typedef void (*Callback_DotProduct)(int,int,void *,void*,void*,void*);
Callback_MatBlockVect userProduct;
Callback_RightCond rightPreCond;
Callback_DotProduct dotProduct;
Callback_MatBlockVect userProduct;
Callback_RightCond rightPreCond;
Callback_DotProduct dotProduct;
int dim;
void* userPtrMat;
void* userPtrPreCond;
void* userEnv;
bool usingRightPreCond;
int dim;
void* userPtrMat;
void* userPtrPreCond;
void* userEnv;
bool usingRightPreCond;
public:
UserMatrix() : userProduct(nullptr),
rightPreCond(nullptr),
dotProduct(nullptr),
dim(0), //Do nothing
userPtrMat(nullptr),
userPtrPreCond(nullptr),
userEnv(nullptr),
usingRightPreCond(false){
}
//Return number of col
int size(){
return dim;
}
UserMatrix(void * inUserEnv, void * userPtrMatrix, int inDim) :
userProduct(nullptr),
dim(inDim),
userPtrMat(userPtrMatrix),
userPtrPreCond(nullptr),
userEnv(inUserEnv),
usingRightPreCond(false){
}
~UserMatrix(){
}
void MatBlockVect(Block<T,S>& input, Block<T,S>& output, int idxToWrite=0){
void* toWrite = output.getPtr(idxToWrite);
std::cout<<"MatBlockVect : Input is "<<input.getSizeBlock()<<" x "
<<input.getLeadingDim()<<"\n";
std::cout<<" : Output is "<<output.getSizeBlock()<<" x "
<<output.getLeadingDim()<<"\n";
userProduct(userPtrMat,input.getSizeBlock(),input.getPtr(),&toWrite,
userEnv);
}
void MatBaseProduct(T * ptrToRead,int nbRHS,void * ptrToWrite){
userProduct(userPtrMat,nbRHS,ptrToRead,&ptrToWrite,
userEnv);
}
void setMatBlockVect(Callback_MatBlockVect inUserProduct){
userProduct = inUserProduct;
}
//Right Pre Conditionner
//Since it is set by the user, we use the same structure to hold it
void setRightPreCond(Callback_RightCond inRightPreCond, void * usrPtrRightpreCond){
rightPreCond = inRightPreCond;
userPtrPreCond = usrPtrRightpreCond;
usingRightPreCond = true;
}
//set Dot product
void setDotProduct(Callback_DotProduct dotProduct){
this->dotProduct = dotProduct;
}
bool useRightPreCond(){
return usingRightPreCond;
}
void preCondBlockVect(Block<T,S>& input, Block<T,S>& output){
void* toWrite = output.getPtr();
rightPreCond(userPtrPreCond,input.getSizeBlock(),input.getPtr(),&toWrite,
userEnv);
}
void preCondBaseProduct(T * ptrToRead,Block<T,S>& output){
void* toWrite = output.getPtr();
rightPreCond(userPtrPreCond,output.getSizeBlock(),ptrToRead,&toWrite,
userEnv);
}
void DotProduct(int size, int nbVect, T* vectA, T*vectB, T*res){
dotProduct(size,nbVect, vectA,vectB,res,userEnv);
}
UserMatrix() : userProduct(nullptr),
rightPreCond(nullptr),
dotProduct(nullptr),
dim(0), //Do nothing
userPtrMat(nullptr),
userPtrPreCond(nullptr),
userEnv(nullptr),
usingRightPreCond(false){
}
//Return number of col
int size(){
return dim;
}
UserMatrix(void * inUserEnv, void * userPtrMatrix, int inDim) :
userProduct(nullptr),
dim(inDim),
userPtrMat(userPtrMatrix),
userPtrPreCond(nullptr),
userEnv(inUserEnv),
usingRightPreCond(false){
}
~UserMatrix(){
}
void MatBlockVect(Block<T,S>& input, Block<T,S>& output, int idxToWrite=0){
void* toWrite = output.getPtr(idxToWrite);
std::cout<<"MatBlockVect : Input is "<<input.getSizeBlock()<<" x "
<<input.getLeadingDim()<<"\n";
std::cout<<" : Output is "<<output.getSizeBlock()<<" x "
<<output.getLeadingDim()<<"\n";
userProduct(userPtrMat,input.getSizeBlock(),input.getPtr(),&toWrite,
userEnv);
}
void MatBaseProduct(T * ptrToRead,int nbRHS,void * ptrToWrite){
userProduct(userPtrMat,nbRHS,ptrToRead,&ptrToWrite,
userEnv);
}
void setMatBlockVect(Callback_MatBlockVect inUserProduct){
userProduct = inUserProduct;
}
//Right Pre Conditionner
//Since it is set by the user, we use the same structure to hold it
void setRightPreCond(Callback_RightCond inRightPreCond, void * usrPtrRightpreCond){
rightPreCond = inRightPreCond;
userPtrPreCond = usrPtrRightpreCond;
usingRightPreCond = true;
}
//set Dot product
void setDotProduct(Callback_DotProduct dotProduct){
this->dotProduct = dotProduct;
}
bool useRightPreCond(){
return usingRightPreCond;
}
void preCondBlockVect(Block<T,S>& input, Block<T,S>& output){
void* toWrite = output.getPtr();
rightPreCond(userPtrPreCond,input.getSizeBlock(),input.getPtr(),&toWrite,
userEnv);
}
void preCondBaseProduct(T * ptrToRead,Block<T,S>& output){
void* toWrite = output.getPtr();
rightPreCond(userPtrPreCond,output.getSizeBlock(),ptrToRead,&toWrite,
userEnv);
}
void DotProduct(int size, int nbVect, T* vectA, T*vectB, T*res){
dotProduct(size,nbVect, vectA,vectB,res,userEnv);
}
};
......
......@@ -45,9 +45,9 @@ void dot_product(int size, int nbVect, void * A, void * vectB , void * res, void
for(int k=0 ; k<nbVect; ++k){
for(int i=0 ; i<size ; ++i){
vectRes[k] += inA[i + k*size] * v[i];
}
for(int i=0 ; i<size ; ++i){
vectRes[k] += inA[i + k*size] * v[i];
}
}
}
......@@ -131,9 +131,9 @@ int main(int ac, char ** av){
double * logs = ibgmresdr_get_logs(&nbIte,handle);
{//Display of the convergence
for(int i=0 ; i<nbIte ; ++i){
printf("Ite[%d] -- {%f,%f}\n",i,logs[i*3],logs[i*3+1]);
}
for(int i=0 ; i<nbIte ; ++i){
printf("Ite[%d] -- {%f,%f}\n",i,logs[i*3],logs[i*3+1]);
}
}
ibgmresdr_dealloc(handle);
......
......@@ -89,17 +89,17 @@ void load_datas(Matrix * mat,FILE * fd){
//Dot product callback
void dot_product(int size, int nbVect, void * A, void * vectB , void * res, void * env){
Env * inEnv = (Env *) env; //Not used
//cast arrays ::
double complex * inA = (double complex*) A;
double complex * v = (double complex*) vectB;
double complex * vectRes = (double complex*) res;
for(int k=0 ; k<nbVect; ++k){
for(int i=0 ; i<size ; ++i){
vectRes[k] += conj(inA[i + size*k]) * v[i];
}
Env * inEnv = (Env *) env; //Not used
//cast arrays ::
double complex * inA = (double complex*) A;
double complex * v = (double complex*) vectB;
double complex * vectRes = (double complex*) res;
for(int k=0 ; k<nbVect; ++k){
for(int i=0 ; i<size ; ++i){
vectRes[k] += conj(inA[i + size*k]) * v[i];
}
}
}
......
......@@ -88,39 +88,39 @@ CBLAS_INDEX cblas_izamax(const int N, const void *X, const int incX);
* ===========================================================================
*/
/*
/*
* Routines with standard 4 prefixes (s, d, c, z)
*/
void cblas_sswap(const int N, float *X, const int incX,
void cblas_sswap(const int N, float *X, const int incX,
float *Y, const int incY);
void cblas_scopy(const int N, const float *X, const int incX,
void cblas_scopy(const int N, const float *X, const int incX,
float *Y, const int incY);
void cblas_saxpy(const int N, const float alpha, const float *X,
const int incX, float *Y, const int incY);
void cblas_dswap(const int N, double *X, const int incX,
void cblas_dswap(const int N, double *X, const int incX,
double *Y, const int incY);
void cblas_dcopy(const int N, const double *X, const int incX,
void cblas_dcopy(const int N, const double *X, const int incX,
double *Y, const int incY);
void cblas_daxpy(const int N, const double alpha, const double *X,
const int incX, double *Y, const int incY);
void cblas_cswap(const int N, void *X, const int incX,
void cblas_cswap(const int N, void *X, const int incX,
void *Y, const int incY);
void cblas_ccopy(const int N, const void *X, const int incX,
void cblas_ccopy(const int N, const void *X, const int incX,
void *Y, const int incY);
void cblas_caxpy(const int N, const void *alpha, const void *X,
const int incX, void *Y, const int incY);
void cblas_zswap(const int N, void *X, const int incX,
void cblas_zswap(const int N, void *X, const int incX,
void *Y, const int incY);
void cblas_zcopy(const int N, const void *X, const int incX,
void cblas_zcopy(const int N, const void *X, const int incX,
void *Y, const int incY);
void cblas_zaxpy(const int N, const void *alpha, const void *X,
const int incX, void *Y, const int incY);
/*
/*
* Routines with S and D prefix only
*/
void cblas_srotg(float *a, float *b, float *c, float *s);
......@@ -138,7 +138,7 @@ void cblas_drotm(const int N, double *X, const int incX,
double *Y, const int incY, const double *P);
/*
/*
* Routines with S D C Z CS and ZD prefixes
*/
void cblas_sscal(const int N, const float alpha, float *X, const int incX);
......@@ -154,7 +154,7 @@ void cblas_zdscal(const int N, const double alpha, void *X, const int incX);
* ===========================================================================
*/
/*
/*
* Routines with standard 4 prefixes (S, D, C, Z)
*/
void cblas_sgemv(const CBLAS_LAYOUT layout,
......@@ -169,11 +169,11 @@ void cblas_sgbmv(CBLAS_LAYOUT layout,
const int incX, const float beta, float *Y, const int incY);
void cblas_strmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
const int N, const float *A, const int lda,
const int N, const float *A, const int lda,
float *X, const int incX);
void cblas_stbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
const int N, const int K, const float *A, const int lda,
const int N, const int K, const float *A, const int lda,
float *X, const int incX);
void cblas_stpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
......@@ -202,11 +202,11 @@ void cblas_dgbmv(CBLAS_LAYOUT layout,
const int incX, const double beta, double *Y, const int incY);
void cblas_dtrmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
const int N, const double *A, const int lda,
const int N, const double *A, const int lda,
double *X, const int incX);
void cblas_dtbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
const int N, const int K, const double *A, const int lda,
const int N, const int K, const double *A, const int lda,
double *X, const int incX);
void cblas_dtpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
......@@ -235,11 +235,11 @@ void cblas_cgbmv(CBLAS_LAYOUT layout,
const int incX, const void *beta, void *Y, const int incY);
void cblas_ctrmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
const int N, const void *A, const int lda,
const int N, const void *A, const int lda,
void *X, const int incX);
void cblas_ctbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
const int N, const int K, const void *A, const int lda,
const int N, const int K, const void *A, const int lda,
void *X, const int incX);
void cblas_ctpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
......@@ -268,11 +268,11 @@ void cblas_zgbmv(CBLAS_LAYOUT layout,
const int incX, const void *beta, void *Y, const int incY);
void cblas_ztrmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
const int N, const void *A, const int lda,
const int N, const void *A, const int lda,
void *X, const int incX);
void cblas_ztbmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
const int N, const int K, const void *A, const int lda,
const int N, const int K, const void *A, const int lda,
void *X, const int incX);
void cblas_ztpmv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag,
......@@ -290,7 +290,7 @@ void cblas_ztpsv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
const int N, const void *Ap, void *X, const int incX);
/*
/*
* Routines with S and D prefixes only
*/
void cblas_ssymv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
......@@ -352,7 +352,7 @@ void cblas_dspr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
const int incX, const double *Y, const int incY, double *A);
/*
/*
* Routines with C and Z prefixes only
*/
void cblas_chemv(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
......@@ -423,7 +423,7 @@ void cblas_zhpr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const int N,
* ===========================================================================
*/
/*
/*
* Routines with standard 4 prefixes (S, D, C, Z)
*/
void cblas_sgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA,
......@@ -547,7 +547,7 @@ void cblas_ztrsm(CBLAS_LAYOUT layout, CBLAS_SIDE Side,
void *B, const int ldb);
/*
/*
* Routines with prefixes C and Z only
*/
void cblas_chemm(CBLAS_LAYOUT layout, CBLAS_SIDE Side,
......
This diff is collapsed.
This diff is collapsed.
......@@ -74,12 +74,12 @@ struct Arnoldi_IB{
A.MatBlockVect(X0,R0); //R0 = A*X0
for(int i=0 ; i<SizeBlock ; ++i){ //R0 = B - R0
for(int k=0 ; k<dim ; ++k){
R0.getPtr(i)[k] = B.getPtr(i)[k] - R0.getPtr(i)[k];
R0.getPtr(i)[k] = B.getPtr(i)[k] - R0.getPtr(i)[k];
}
}
Block<Scalar,Primary> q0(SizeBlock,dim);
Block<Scalar,Primary> r0(SizeBlock,SizeBlock);
//Q-R Decomposition of (R0)
R0.ComputeQRFacto_own(q0,r0,A);
......@@ -108,8 +108,8 @@ struct Arnoldi_IB{
if(1 == epsilon.size()){
nbKDir = r0_cpy.DecompositionSVD(U,epsilon.front());
}else{
r0_cpy.ScaleBlock(inv_epsilon);
nbKDir = r0_cpy.DecompositionSVD(U,Primary(1));
r0_cpy.ScaleBlock(inv_epsilon);
nbKDir = r0_cpy.DecompositionSVD(U,Primary(1));
}
std::cout<<"U.getSizeBlock() : "<<U.getSizeBlock()
......@@ -282,7 +282,7 @@ struct Arnoldi_IB{
L.UpdateBottomLine(Directions);
}
sumOfSizeOfEachBlock.push_back(U.getSizeBlock()+sumOfSizeOfEachBlock.back());
std::cout<<"################## End of Iteration ##################\n\n";
log.add_ite(ite_meter,WP.getSizeW(),evalConv.Min,evalConv.Max,timestamp);
j+=WP.getSizeW();
......
This diff is collapsed.
......@@ -10,10 +10,10 @@
*/
enum class OrthoChoice{
MGS = 0, /*!< Modified Gram Schmidt*/
CGS = 1, /*!< Classical Gram Schmidt*/
IMGS = 2, /*!< Iterated Modified Gram Schmidt*/
ICGS = 3 /*!< Iterated Classical Gram Schmidt*/
};
CGS = 1, /*!< Classical Gram Schmidt*/
IMGS = 2, /*!< Iterated Modified Gram Schmidt*/
ICGS = 3 /*!< Iterated Classical Gram Schmidt*/
};
/**
* Overloading operator << for Enum in order to display the name of
......@@ -407,7 +407,7 @@ public:
//input.displayBlock("Y, before base.ComputeProduct");
int minLine = std::min(sumNbVectInBlock[currentBlockUsed],
input.getLeadingDim());
call_gemm<Scalar>(ldBase,input.getSizeBlock(),minLine,
getPtr(),ldBase,
input.getPtr(),input.getLeadingDim(),
......@@ -438,7 +438,7 @@ public:
for(int i=0 ; i<nbVect ; ++i){
A.getPtr(i)[i] -= Scalar(1);
}
std::cout<<"Base*Base^{H} is "<<nbVect<<" x "<<nbVect<<"\n";
std::pair<Primary,Primary> minmax = A.getMinMaxNorm();
std::cout<<"V^{T}*V - In = \t\tMin :: "<<minmax.first<<"\tMax :: "<<minmax.second<<"\n";
......
......@@ -301,7 +301,7 @@ public:
/**
*@brief Return the min and max norm over the vectors
*/
std::pair<Primary,Primary> getMinMaxNorm(){
std::pair<Primary,Primary> getMinMaxNorm(){
std::pair<Primary,Primary> minmax{std::numeric_limits<Primary>::max(),0};
for(int i=0 ; i<SizeBlock ; ++i){
Primary norm = getNorm(i);
......@@ -334,19 +334,19 @@ public:
return {pair.first,pair.second,(pair.second < epsilon.front())};
}
}
template<class Matrix>
EvalConv CheckPrecision(std::vector<Primary>& epsilon, Matrix & A){
auto pair = getMinMaxNorm(A);
std::cout<<"\tResidual computed\t";
std::cout<<"\tMin "<<pair.first
<<"\tMax "<<pair.second<<"\n";
if(epsilon.size() > 1){
return {pair.first,pair.second,CheckMultiPrecision(epsilon)};
}else{
return {pair.first,pair.second,(pair.second < epsilon.front())};
}
template<class Matrix>
EvalConv CheckPrecision(std::vector<Primary>& epsilon, Matrix & A){
auto pair = getMinMaxNorm(A);
std::cout<<"\tResidual computed\t";
std::cout<<"\tMin "<<pair.first
<<"\tMax "<<pair.second<<"\n";
if(epsilon.size() > 1){
return {pair.first,pair.second,CheckMultiPrecision(epsilon)};
}else{
return {pair.first,pair.second,(pair.second < epsilon.front())};
}
}
/**
*@brief Check if all the vectors have a norm lesser than the
*vector of epsilon given
......@@ -359,19 +359,19 @@ public:
return true;
}
/**
*@brief Check if all the vectors have a norm lesser than the
*vector of epsilon given
*/
template<class Matrix>
bool CheckMultiPrecision(std::vector<Primary>& epsilon,Matrix & A){
for(int i=0 ; i<SizeBlock ; ++i){
if (getNorm(i,A) > epsilon[i])
return false;
}
return true;
/**
*@brief Check if all the vectors have a norm lesser than the
*vector of epsilon given
*/
template<class Matrix>
bool CheckMultiPrecision(std::vector<Primary>& epsilon,Matrix & A){
for(int i=0 ; i<SizeBlock ; ++i){
if (getNorm(i,A) > epsilon[i])
return false;
}
return true;
}
/**
* @brief Normalize all the column vectors of block and store the
......@@ -387,21 +387,21 @@ public:
}
}
/**
* @brief Normalize all the column vectors of block and store the
* norm inside input norms.
*/
template<class Matrix>
void Normalize(std::vector<Primary>& norms, Matrix& A){
for(int i=0 ; i< SizeBlock ; ++i){
Primary currNorm = getNorm(i,A);
norms.push_back(currNorm);
for(int j=0 ; j< getLeadingDim() ; ++j){
getPtr(i)[j] /= currNorm;
}
}
/**
* @brief Normalize all the column vectors of block and store the
* norm inside input norms.
*/
template<class Matrix>
void Normalize(std::vector<Primary>& norms, Matrix& A){
for(int i=0 ; i< SizeBlock ; ++i){
Primary currNorm = getNorm(i,A);
norms.push_back(currNorm);
for(int j=0 ; j< getLeadingDim() ; ++j){
getPtr(i)[j] /= currNorm;
}
}
}
/**
* @brief Apply a primary coeff different for each vector inside
* Block.
......
......@@ -112,9 +112,9 @@ public:
}
/**
* @brief Compute the product between [P,W] and input block and
* write the result in place of P. (obviously used to update P)
*/
* @brief Compute the product between [P,W] and input block and
* write the result in place of P. (obviously used to update P)
*/
void ComputeProduct(Block<Scalar,Primary>& input,
int nbKeptDir){ //Correspond to the start of
//discarded directions
......
......@@ -163,7 +163,7 @@ void CheckEigenResults(Block<Scalar,Primary> & A,Block<Scalar,Primary> & B,
Block<Scalar,Primary> & beta){
int dim = A.getLeadingDim();
Block<Scalar,Primary> res{dim,dim};
for(int i=0 ; i< dim ; i++){
for(int i=0 ; i< dim ; i++){
Scalar theta_i = alpha.getPtr()[i]/beta.getPtr()[i];
//res_i = A*vr_i
call_gemm<>(dim,1,dim,
......
......@@ -20,11 +20,11 @@ protected:
Scalar * datas;
public:
HessGeneric(int inMaxKSize,int inSizeBlock) : totalSize(0),
SizeBlock(inSizeBlock),
MaxKSize(inMaxKSize),
nbTotCols(0),
ldh(0),
datas(nullptr){
SizeBlock(inSizeBlock),
MaxKSize(inMaxKSize),
nbTotCols(0),
ldh(0),
datas(nullptr){
ldh = MaxKSize + SizeBlock;
nbTotCols = MaxKSize;
totalSize = ldh*nbTotCols;
......
......@@ -14,8 +14,8 @@
*/
enum class ArnOrtho{
RUHE = 0, /*!< Arnoldi-Ruhe : otrtho vector by vector*/
BLOCK = 1 /*!< Block Arnoldi Ortho block wise followed by a a QR factorization*/
};
BLOCK = 1 /*!< Block Arnoldi Ortho block wise followed by a a QR factorization*/
};
/**
* Overloading operator << for Enum in order to display the name of
......@@ -106,8 +106,8 @@ bool CheckCurrentSolution(Matrix&A, Block<Scalar,Primary>& B,
auto evalRes = AxSol.CheckPrecision(epsilon,A);
std::cout<<"\t\\t\tReal Residual : Min\t"<<evalRes.Min<<" Max\t"<<evalRes.Max<<"\n";
if(evalRes.hasConverged){
std::cout<<"Convergence !\n";
X0.CopyBlock(Sol);
std::cout<<"Convergence !\n";
X0.CopyBlock(Sol);
}
return evalRes.hasConverged;
}
......
......@@ -101,7 +101,7 @@ public:
}
}
}
void DotProduct(int size, int nbVect, Scalar* vectA, Scalar*vectB, Scalar*res){
void DotProduct(int size, int nbVect, Scalar* vectA, Scalar*vectB, Scalar*res){
call_Tgemm<>(nbVect,1,size,
vectA,size,
vectB,size,
......
......@@ -102,8 +102,8 @@ public:
}
}
}
void DotProduct(int size, int nbVect, Scalar* vectA, Scalar*vectB, Scalar*res){
call_Tgemm<>(nbVect,1,size,
void DotProduct(int size, int nbVect, Scalar* vectA, Scalar*vectB, Scalar*res){
call_Tgemm<>(nbVect,1,size,
vectA,size,
vectB,size,
res,nbVect,
......
......@@ -101,13 +101,13 @@ public:
}
}
}
void DotProduct(int size,int nbVect, Scalar* vectA, Scalar*vectB, Scalar*res){
std::cout<<"Ting\n";
call_Tgemm<>(nbVect,1,size,
vectA,size,
vectB,size,
res,nbVect,
Scalar(1),Scalar(0));
void DotProduct(int size,int nbVect, Scalar* vectA, Scalar*vectB, Scalar*res){
std::cout<<"Ting\n";
call_Tgemm<>(nbVect,1,size,
vectA,size,
vectB,size,
res,nbVect,
Scalar(1),Scalar(0));
}
};
......
......@@ -6,7 +6,7 @@
template<class Scalar>
struct A{
void DotProduct(int size, int nbVect, Scalar* vectA, Scalar*vectB, Scalar*res){
void DotProduct(int size, int nbVect, Scalar* vectA, Scalar*vectB, Scalar*res){
call_Tgemm<>(nbVect,1,size,
vectA,size,
vectB,size,
......