Commit 094906ea authored by Cyrille Piacibello's avatar Cyrille Piacibello

Need again to change branch ...

parent 9d30ca9c
......@@ -105,33 +105,35 @@ int BlockArnoldiIb(Matrix& A,Block<Scalar,Primary>& B, Block<Scalar,Primary>& X0
Res.DecompositionSVD(U,epsilon_R);
std::cout<<"Decomposition SVD done !\n\t\tSingular Values kept "
<<U.getSizeBlock()<<" !"<<std::endl;
//Create Block to store W
Block<Scalar,Primary> Directions(SizeBlock,SizeBlock);
//TO BE DISCARDED
Block<Scalar,Primary> tempRpart(U.getSizeBlock(),U.getSizeBlock());
//U.displayBlock("U: Kept directions");
if(U.getSizeBlock() == SizeBlock){//Thus no inexact breakdown occured
for(int i=0; i<SizeBlock ; ++i) {
Directions.getPtr(i)[i] = Scalar(1);
}
//Here : If no inexact breakdowns occured, updates procedures are easiers
if(U.getSizeBlock() == SizeBlock){
//Augment base and move on
base.addBlockDatas(WP);
}else{
//Create Block to store \W
Block<Scalar,Primary> Directions(SizeBlock,SizeBlock);
//TO BE DISCARDED
Block<Scalar,Primary> tempRpart(U.getSizeBlock(),U.getSizeBlock());
//Qr facto of bottom block of U
U.ComputeQRFacto(Directions,tempRpart,sumOfSizeOfEachBlock.back());
Directions.displayBlock("Ortho part of U after QR");
//Update
//V_{j+1} = [P_{j-1},~Wj] * Directions_1
WP.ComputeProduct(Directions,U.getSizeBlock(),
base.getLastColPtr(U.getSizeBlock()),base.getLeadingDim());
//Pj = [P_{j-1},~Wj] * Directions_2
WP.ComputeProduct(Directions,U.getSizeBlock());
//L.displayHessExtended("hess before update bottom line");
//L_{j+1,} = | Directions_1^{H} | * H_j
//Gj = | Directions_2^{H} |
L.UpdateBottomLine(Directions,U.getSizeBlock());
}
Directions.displayBlock("Q part of U after QR");
//Update
//V_{j+1} = [P_{j-1},~Wj] * Directions_1
WP.ComputeProduct(Directions,U.getSizeBlock(),
base.getLastColPtr(U.getSizeBlock()),base.getLeadingDim());
//Pj = [P_{j-1},~Wj] * Directions_2
WP.ComputeProduct(Directions,U.getSizeBlock());
//L.displayHessExtended("hess before update bottom line");
//L_{j+1,} = | Directions_1^{H} | * H_j
//Gj = | Directions_2^{H} |
L.UpdateBottomLine(Directions,U.getSizeBlock());
//L.displayHessExtended("hess after update bottom line");
sizeOfEachBlock.push_back(U.getSizeBlock());
sumOfSizeOfEachBlock.push_back(U.getSizeBlock()+sumOfSizeOfEachBlock.back());
}
......
......@@ -156,7 +156,7 @@ int main(int ac, char ** av){
}
//fill last col with one vect from solution
int last_indice = SizeBlock-1;
memcpy(X0.getPtr(last_indice),X_Exact.getPtr(last_indice),
memcpy(X0.getPtr(last_indice),X_Exact.getPtr(0),
sizeof(Scalar)*X0.getLeadingDim());
Block<Scalar,Primary> sol(SizeBlock,dim);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment