/trunk/src/qep/impls/linear/linear.c
124,7 → 124,7
| /* Transfer the trackall option from qep to eps */ |
| ierr = QEPGetTrackAll(qep,&trackall);CHKERRQ(ierr); |
| ierr = EPSSetTrackAll(ctx->eps,trackall);CHKERRQ(ierr); |
| if (ctx->setfromoptionscalled == PETSC_TRUE) { |
| if (ctx->setfromoptionscalled) { |
| ierr = EPSSetFromOptions(ctx->eps);CHKERRQ(ierr); |
| ctx->setfromoptionscalled = PETSC_FALSE; |
| } |
/trunk/src/st/impls/precond/precond.c
68,8 → 68,7
| } else { |
| t1 = PETSC_TRUE; |
| } |
| ierr = PCSetType(pc, (t0 == PETSC_TRUE && t1 == PETSC_TRUE)? |
| PCJACOBI:PCNONE); CHKERRQ(ierr); |
| ierr = PCSetType(pc, (t0 && t1)? PCJACOBI:PCNONE); CHKERRQ(ierr); |
| } |
| } |
| |
96,7 → 95,7
| ierr = KSPGetPC(st->ksp, &pc); CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)pc, PCNONE, &t0); CHKERRQ(ierr); |
| ierr = STPrecondGetKSPHasMat(st, &setmat); CHKERRQ(ierr); |
| if (t0 == PETSC_TRUE && setmat == PETSC_FALSE) PetscFunctionReturn(0); |
| if (t0 && !setmat) PetscFunctionReturn(0); |
| |
| /* Check if a user matrix is set */ |
| ierr = STPrecondGetMatForPC(st, &P); CHKERRQ(ierr); |
140,19 → 139,18
| ierr = PCSetType(pc, PCNONE); CHKERRQ(ierr); |
| |
| /* If some matrix has to be set to ksp, set ksp to KSPPREONLY */ |
| if (setmat == PETSC_TRUE) { |
| if (setmat) { |
| ierr = STMatShellCreate(st, &P);CHKERRQ(ierr); |
| destroyP = PETSC_TRUE; |
| ierr = KSPSetType(st->ksp, KSPPREONLY); CHKERRQ(ierr); |
| } |
| } |
| |
| ierr = KSPSetOperators(st->ksp, setmat==PETSC_TRUE?P:PETSC_NULL, P, |
| DIFFERENT_NONZERO_PATTERN); CHKERRQ(ierr); |
| ierr = KSPSetOperators(st->ksp,setmat?P:PETSC_NULL,P,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); |
| |
| if (destroyP == PETSC_TRUE) { |
| if (destroyP) { |
| ierr = MatDestroy(P); CHKERRQ(ierr); |
| } else if (st->shift_matrix == ST_MATMODE_INPLACE && builtP == PETSC_TRUE) { |
| } else if (st->shift_matrix == ST_MATMODE_INPLACE && builtP) { |
| if (st->sigma != 0.0 && PetscAbsScalar(st->sigma) < PETSC_MAX) { |
| if (st->B) { |
| ierr = MatAXPY(st->A,st->sigma,st->B,st->str);CHKERRQ(ierr); |
285,7 → 283,7
| |
| ierr = KSPGetPC(st->ksp, &pc); CHKERRQ(ierr); |
| ierr = PCGetOperatorsSet(pc, PETSC_NULL, &flag); CHKERRQ(ierr); |
| if (flag == PETSC_TRUE) { |
| if (flag) { |
| ierr = PCGetOperators(pc, PETSC_NULL, mat, PETSC_NULL); CHKERRQ(ierr); |
| } else |
| *mat = PETSC_NULL; |
/trunk/src/eps/interface/opts.c
641,7 → 641,7
| if (eps->adaptive != adaptive) { |
| eps->adaptive = adaptive; |
| eps->setupcalled = 0; |
| if (adaptive==PETSC_TRUE) SETERRQ(PETSC_ERR_SUP,"Sorry, adaptive norms are not implemented in this release."); |
| if (adaptive) SETERRQ(PETSC_ERR_SUP,"Sorry, adaptive norms are not implemented in this release."); |
| } |
| PetscFunctionReturn(0); |
| } |
/trunk/src/eps/impls/external/blopex/blopex.c
148,10 → 148,10
| |
| ierr = STSetUp(eps->OP); CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)eps->OP, STPRECOND, &isPrecond); CHKERRQ(ierr); |
| if (isPrecond == PETSC_FALSE) SETERRQ(PETSC_ERR_SUP, "blopex only works with precond spectral transformation"); |
| if (!isPrecond) SETERRQ(PETSC_ERR_SUP, "blopex only works with precond spectral transformation"); |
| ierr = STGetKSP(eps->OP, &blopex->ksp); CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)blopex->ksp, KSPPREONLY, &isPreonly); CHKERRQ(ierr); |
| if (isPreonly == PETSC_FALSE) |
| if (!isPreonly) |
| SETERRQ(PETSC_ERR_SUP, "blopex only works with preonly ksp of the spectral transformation"); |
| |
| eps->ncv = eps->nev = PetscMin(eps->nev,eps->n); |
/trunk/src/eps/impls/external/primme/primme.c
116,7 → 116,7
| |
| ierr = STSetUp(eps->OP); CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)eps->OP, STPRECOND, &t); CHKERRQ(ierr); |
| if (t == PETSC_FALSE) SETERRQ(PETSC_ERR_SUP, "PRIMME only works with precond spectral transformation"); |
| if (!t) SETERRQ(PETSC_ERR_SUP, "PRIMME only works with precond spectral transformation"); |
| |
| /* Transfer SLEPc options to PRIMME options */ |
| primme->n = eps->n; |
166,7 → 166,7
| if (primme->correctionParams.precondition) { |
| ierr = STGetKSP(eps->OP, &ops->ksp); CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)ops->ksp, KSPPREONLY, &t); CHKERRQ(ierr); |
| if (t == PETSC_FALSE) SETERRQ(PETSC_ERR_SUP, "PRIMME only works with preonly ksp of the spectral transformation"); |
| if (!t) SETERRQ(PETSC_ERR_SUP, "PRIMME only works with preonly ksp of the spectral transformation"); |
| primme->preconditioner = PETSC_NULL; |
| primme->applyPreconditioner = applyPreconditioner_PRIMME; |
| } |
/trunk/src/eps/impls/davidson/common/dvd_blas.c
87,8 → 87,8
| ierr = PetscLogEventBegin(SLEPC_SlepcDenseMatProd,0,0,0,0);CHKERRQ(ierr); |
| |
| /* Transpose if needed */ |
| if (At == PETSC_TRUE) tmp = rA, rA = cA, cA = tmp, qA = T; |
| if (Bt == PETSC_TRUE) tmp = rB, rB = cB, cB = tmp, qB = T; |
| if (At) tmp = rA, rA = cA, cA = tmp, qA = T; |
| if (Bt) tmp = rB, rB = cB, cB = tmp, qB = T; |
| |
| /* Check size */ |
| if (cA != rB) { |
143,8 → 143,8
| if ((rA == 0) || (cB == 0)) { PetscFunctionReturn(0); } |
| |
| /* Transpose if needed */ |
| if (At == PETSC_TRUE) tmp = rA, rA = cA, cA = tmp; |
| if (Bt == PETSC_TRUE) tmp = rB, rB = cB, cB = tmp; |
| if (At) tmp = rA, rA = cA, cA = tmp; |
| if (Bt) tmp = rB, rB = cB, cB = tmp; |
| |
| /* Check size */ |
| if (cA != rB) SETERRQ(1, "Matrix dimensions doesn't match!"); |
152,17 → 152,17
| |
| /* Optimized version: trivial case */ |
| if ((rA == 1) && (cA == 1) && (cB == 1)) { |
| if ((At == PETSC_FALSE) && (Bt == PETSC_FALSE)) *C = *A * *B; |
| else if ((At == PETSC_TRUE) && (Bt == PETSC_FALSE)) *C = PetscConj(*A) * *B; |
| else if ((At == PETSC_FALSE) && (Bt == PETSC_TRUE)) *C = *A * PetscConj(*B); |
| else if ((At == PETSC_TRUE) && (Bt == PETSC_TRUE)) *C = PetscConj(*A) * PetscConj(*B); |
| if (!At && !Bt) *C = *A * *B; |
| else if (At && !Bt) *C = PetscConj(*A) * *B; |
| else if (!At && Bt) *C = *A * PetscConj(*B); |
| else if (At && Bt) *C = PetscConj(*A) * PetscConj(*B); |
| PetscFunctionReturn(0); |
| } |
| |
| /* Optimized versions: sA == 0 && sB == 0 */ |
| if ((sA == 0) && (sB == 0)) { |
| if (At == PETSC_TRUE) tmp = rA, rA = cA, cA = tmp; |
| if (Bt == PETSC_TRUE) tmp = rB, rB = cB, cB = tmp; |
| if (At) tmp = rA, rA = cA, cA = tmp; |
| if (Bt) tmp = rB, rB = cB, cB = tmp; |
| ierr = SlepcDenseMatProd(C, ldC, 0.0, 1.0, A, ldA, rA, cA, At, B, ldB, rB, |
| cB, Bt); CHKERRQ(ierr); |
| PetscFunctionReturn(ierr); |
1217,7 → 1217,7
| /* Else orthogonalize first against DS, and then against cX and V */ |
| ierr = IPOrthogonalize(ip, size_DS, DS, size_cX, PETSC_NULL, cX, |
| V[i], auxS0, PETSC_NULL, &lindep); CHKERRQ(ierr); |
| if(lindep == PETSC_FALSE) { |
| if(!lindep) { |
| ierr = IPOrthogonalize(ip, 0, PETSC_NULL, i, PETSC_NULL, V, |
| V[i], auxS0, &norm, &lindep); CHKERRQ(ierr); |
| } |
1226,11 → 1226,11
| ierr = IPOrthogonalize(ip, size_cX, cX, i, PETSC_NULL, V, |
| V[i], auxS0, &norm, &lindep); CHKERRQ(ierr); |
| } |
| if((lindep == PETSC_FALSE) && (norm > PETSC_MACHINE_EPSILON)) break; |
| if(!lindep && (norm > PETSC_MACHINE_EPSILON)) break; |
| ierr = PetscInfo1(ip, "Orthonormalization problems adding the vector %d to the searching subspace\n", i); |
| CHKERRQ(ierr); |
| } |
| if((lindep == PETSC_TRUE) || (norm < PETSC_MACHINE_EPSILON)) { |
| if(lindep || (norm < PETSC_MACHINE_EPSILON)) { |
| SETERRQ(1, "Error during the orthonormalization of the eigenvectors!"); |
| } |
| ierr = VecScale(V[i], 1.0/norm); CHKERRQ(ierr); |
1284,7 → 1284,7
| if (!pX) ldpX = 1; |
| if (!pY) ldpY = 1; |
| |
| howmny = (doProd == PETSC_TRUE)?"B":"A"; |
| howmny = doProd?"B":"A"; |
| |
| Sc = auxS; auxS+= n*n; size_auxS-= n*n; |
| if (T) Tc = auxS, auxS+= n*n, size_auxS-= n*n; |
1308,7 → 1308,7
| alphar = auxS; auxS+= n; size_auxS-= n; |
| alphai = auxS; auxS+= n; size_auxS-= n; |
| beta = auxS; auxS+= n; size_auxS-= n; |
| if (doProd == PETSC_TRUE) { |
| if (doProd) { |
| if (pX) pA = auxS, auxS+= n*n, size_auxS-= n*n, ldpA = n; |
| else pA = PETSC_NULL, ldpA = 0; |
| if (pY) pB = auxS, auxS+= n*n, size_auxS-= n*n, ldpB = n; |
1323,7 → 1323,7
| SETERRQ(PETSC_ERR_LIB,"Insufficient auxiliar memory for xGGEV"); |
| LAPACKggev_(pY?"V":"N",pX?"V":"N",&n,Sc,&n,Tc,&n,alphar,alphai,beta,pB,&ldpB,pA,&ldpA,auxS,&n1,&info); |
| if (info) SETERRQ1(PETSC_ERR_LIB,"Error in Lapack xGGEV %i",info); |
| if (doProd == PETSC_TRUE) { |
| if (doProd) { |
| if (pX) { |
| /* pX <- pX * pA */ |
| ierr = SlepcDenseCopy(Sc, n, pX, ldpX, n, n); CHKERRQ(ierr); |
/trunk/src/eps/impls/davidson/common/dvd_calcpairs.c
539,7 → 539,7
| } |
| |
| /* nX[i] <- ||X[i]|| */ |
| if (d->correctXnorm == PETSC_TRUE) for(i=0; i<r_e-r_s; i++) { |
| if (d->correctXnorm) for(i=0; i<r_e-r_s; i++) { |
| ierr = VecNorm(X[i], NORM_2, &d->nX[r_s+i]); CHKERRQ(ierr); |
| } else for(i=0; i<r_e-r_s; i++) { |
| d->nX[r_s+i] = 1.0; |
661,7 → 661,7
| ierr = IPOrthogonalize(d->ipI, 0, PETSC_NULL, d->size_cX, PETSC_NULL, |
| cX, R[i], PETSC_NULL, &d->nR[r_s+i], &lindep); |
| CHKERRQ(ierr); |
| if((lindep == PETSC_TRUE) || (d->nR[r_s+i] < PETSC_MACHINE_EPSILON)) { |
| if(lindep || (d->nR[r_s+i] < PETSC_MACHINE_EPSILON)) { |
| SETERRQ(1, "Error during the residual computation of the eigenvectors!"); |
| } |
| |
/trunk/src/eps/impls/davidson/common/dvd_updatev.c
101,12 → 101,12
| max_size_V*b->max_size_X /* testConv:res_0 */ ); |
| b->max_size_V = mpd; |
| b->size_V = max_size_V; |
| b->own_vecs+= max_size_V*(harm==PETSC_TRUE?2:1); /* V, W? */ |
| b->own_vecs+= max_size_V*(harm?2:1); /* V, W? */ |
| b->own_scalars+= max_size_V*2 /* eigr, eigr */ + |
| max_size_V /* nR */ + |
| max_size_V /* nX */ + |
| max_size_V /* errest */ + |
| 2*b->max_size_V*b->max_size_V*(harm==PETSC_TRUE?2:1) |
| 2*b->max_size_V*b->max_size_V*(harm?2:1) |
| /* MTX,MTY?,oldU,oldV? */; |
| // b->max_size_oldX = plusk; |
| |
147,7 → 147,7
| d->W = PETSC_NULL; |
| d->MTY = PETSC_NULL; |
| d->ldMTY = 0; |
| if (harm == PETSC_TRUE) { |
| if (harm) { |
| d->W = b->free_vecs; b->free_vecs+= max_size_V; |
| d->MTY = b->free_scalars; b->free_scalars+= b->max_size_V*b->max_size_V; |
| data->oldV = b->free_scalars; b->free_scalars+= b->max_size_V*b->max_size_V; |
189,7 → 189,7
| #undef ONE |
| |
| /* Check old isRestarting function */ |
| if ((restart == PETSC_FALSE) && (data->old_isRestarting)) |
| if (!restart && data->old_isRestarting) |
| restart = data->old_isRestarting(d); |
| |
| PetscFunctionReturn(restart); |
235,7 → 235,7
| ierr = d->calcpairs_selectPairs(d, data->min_size_V); CHKERRQ(ierr); |
| |
| /* If the subspaces doesn't need restart, add new vector */ |
| if (d->isRestarting(d) == PETSC_FALSE) { |
| if (!d->isRestarting(d)) { |
| i = d->size_V; |
| ierr = dvd_updateV_update_gen(d); CHKERRQ(ierr); |
| |
326,9 → 326,7
| ierr = IPOrthogonalize(d->ipI, 0, PETSC_NULL, d->size_cX+i, PETSC_NULL, |
| d->BcX, d->BcX[d->size_cX+i], PETSC_NULL, |
| &norm, &lindep); CHKERRQ(ierr); |
| if(lindep == PETSC_TRUE) { |
| SETERRQ(1, "Error during orth(BcX, B*cX(new))!"); |
| } |
| if(lindep) SETERRQ(1, "Error during orth(BcX, B*cX(new))!"); |
| ierr = VecScale(d->BcX[d->size_cX+i], 1.0/norm); CHKERRQ(ierr); |
| } |
| |
582,7 → 580,7
| |
| /* Get the converged pairs */ |
| ierr = dvd_updateV_testConv(d, 0, size_D, |
| data->allResiduals==PETSC_TRUE?d->size_V:size_D, d->auxV, d->auxS, |
| data->allResiduals?d->size_V:size_D, d->auxV, d->auxS, |
| &d->npreconv); CHKERRQ(ierr); |
| |
| /* Notify the changes in V */ |
626,7 → 624,7
| |
| *nConv = s; |
| for(i=s, conv=PETSC_TRUE; |
| (conv == PETSC_TRUE || data->allResiduals == PETSC_TRUE) && (i < e); |
| (conv || data->allResiduals) && (i < e); |
| i++) { |
| if (i >= pre) { |
| ierr = d->calcpairs_X(d, i, i+1, &auxV[1]); CHKERRQ(ierr); |
638,7 → 636,7
| } |
| norm = d->nR[i]/d->nX[i]; |
| c = d->testConv(d, d->eigr[i], d->eigi[i], norm, &d->errest[i]); |
| if (conv == PETSC_TRUE && c == PETSC_TRUE) *nConv = i+1; |
| if (conv && c) *nConv = i+1; |
| else conv = PETSC_FALSE; |
| } |
| pre = PetscMax(pre, i); |
/trunk/src/eps/impls/davidson/common/dvd_improvex.c
121,7 → 121,7
| d->improveX_data = data; |
| data->old_improveX = d->improveX; |
| ierr = PetscTypeCompare((PetscObject)ksp, KSPPREONLY, &t); CHKERRQ(ierr); |
| data->ksp = t==PETSC_TRUE?0:ksp; |
| data->ksp = t?0:ksp; |
| data->d = d; |
| d->improveX = dvd_improvex_jd_gen; |
| |
/trunk/src/eps/impls/davidson/common/davidson.c
129,8 → 129,7
| /* Davidson solvers only support STPRECOND */ |
| ierr = STSetUp(eps->OP); CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)eps->OP, STPRECOND, &t); CHKERRQ(ierr); |
| if (t == PETSC_FALSE) |
| SETERRQ1(PETSC_ERR_SUP, "%s only works with precond spectral transformation", |
| if (!t) SETERRQ1(PETSC_ERR_SUP, "%s only works with precond spectral transformation", |
| ((PetscObject)eps)->type_name); |
| |
| /* Extract pc from st->ksp */ |
138,7 → 137,7
| ierr = STGetKSP(eps->OP, &ksp); CHKERRQ(ierr); |
| ierr = KSPGetPC(ksp, &pc); CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)pc, PCNONE, &t); CHKERRQ(ierr); |
| if (t == PETSC_TRUE) { |
| if (t) { |
| pc = 0; |
| } else { |
| ierr = PetscObjectReference((PetscObject)pc); CHKERRQ(ierr); |
152,28 → 151,23
| /* Setup problem specification in dvd */ |
| ierr = STGetOperators(eps->OP, &A, &B); CHKERRQ(ierr); |
| ierr = PetscMemzero(dvd, sizeof(dvdDashboard)); CHKERRQ(ierr); |
| dvd->A = A; dvd->B = (eps->isgeneralized==PETSC_TRUE) ? B : PETSC_NULL; |
| dvd->A = A; dvd->B = eps->isgeneralized? B : PETSC_NULL; |
| ispositive = eps->ispositive; |
| dvd->sA = DVD_MAT_IMPLICIT | |
| (eps->ishermitian == PETSC_TRUE ? DVD_MAT_HERMITIAN : 0) | |
| (((ispositive == PETSC_TRUE) && |
| (eps->isgeneralized == PETSC_FALSE)) ? DVD_MAT_POS_DEF : 0); |
| (eps->ishermitian? DVD_MAT_HERMITIAN : 0) | |
| ((ispositive && !eps->isgeneralized) ? DVD_MAT_POS_DEF : 0); |
| /* Asume -eps_hermitian means hermitian-definite in generalized problems */ |
| if ((ispositive == PETSC_FALSE) && |
| (eps->isgeneralized == PETSC_FALSE) && |
| (eps->ishermitian == PETSC_TRUE)) ispositive = PETSC_TRUE; |
| if (eps->isgeneralized == PETSC_FALSE) |
| if (!ispositive && !eps->isgeneralized && eps->ishermitian) ispositive = PETSC_TRUE; |
| if (!eps->isgeneralized) |
| dvd->sB = DVD_MAT_IMPLICIT | DVD_MAT_HERMITIAN | DVD_MAT_IDENTITY | |
| DVD_MAT_UNITARY | DVD_MAT_POS_DEF; |
| else |
| dvd->sB = DVD_MAT_IMPLICIT | |
| (eps->ishermitian == PETSC_TRUE ? DVD_MAT_HERMITIAN : 0) | |
| (ispositive == PETSC_TRUE ? DVD_MAT_POS_DEF : 0); |
| (eps->ishermitian? DVD_MAT_HERMITIAN : 0) | |
| (ispositive? DVD_MAT_POS_DEF : 0); |
| ipB = DVD_IS(dvd->sB, DVD_MAT_POS_DEF)?PETSC_TRUE:PETSC_FALSE; |
| dvd->sEP = ((eps->isgeneralized == PETSC_FALSE) || |
| ( (eps->isgeneralized == PETSC_TRUE) && |
| (ipB == PETSC_TRUE) ) ? DVD_EP_STD : 0) | |
| (ispositive == PETSC_TRUE ? DVD_EP_HERMITIAN : 0); |
| dvd->sEP = ((!eps->isgeneralized || (eps->isgeneralized && ipB))? DVD_EP_STD : 0) | |
| (ispositive? DVD_EP_HERMITIAN : 0); |
| dvd->nev = eps->nev; |
| dvd->which = eps->which; |
| switch(eps->which) { |
214,10 → 208,10
| |
| /* Setup the type of starting subspace */ |
| ierr = EPSDAVIDSONGetKrylovStart_DAVIDSON(eps, &t); CHKERRQ(ierr); |
| init = t==PETSC_FALSE ? DVD_INITV_CLASSIC : DVD_INITV_KRYLOV; |
| init = (!t)? DVD_INITV_CLASSIC : DVD_INITV_KRYLOV; |
| |
| /* Setup IP */ |
| if ((ipB == PETSC_TRUE) && (dvd->B)) { |
| if (ipB && dvd->B) { |
| ierr = IPSetBilinearForm(eps->ip, dvd->B, IP_INNER_HERMITIAN); CHKERRQ(ierr); |
| } else { |
| ierr = IPSetBilinearForm(eps->ip, 0, IP_INNER_HERMITIAN); CHKERRQ(ierr); |
373,7 → 367,7
| ierr = EPSDAVIDSONGetBlockSize_DAVIDSON(eps, &opi); CHKERRQ(ierr); |
| ierr = PetscViewerASCIIPrintf(viewer,"block size: %d\n", opi);CHKERRQ(ierr); |
| ierr = EPSDAVIDSONGetKrylovStart_DAVIDSON(eps, &opb); CHKERRQ(ierr); |
| if(opb == PETSC_FALSE) { |
| if(!opb) { |
| ierr = PetscViewerASCIIPrintf(viewer,"type of the initial subspace: non-Krylov\n");CHKERRQ(ierr); |
| } else { |
| ierr = PetscViewerASCIIPrintf(viewer,"type of the initial subspace: Krylov\n");CHKERRQ(ierr); |
/trunk/src/eps/impls/davidson/common/dvd_utils.c
122,16 → 122,16
| |
| /* Check if the problem matrices support GetDiagonal */ |
| ierr = MatHasOperation(d->A, MATOP_GET_DIAGONAL, &t); CHKERRQ(ierr); |
| if ((t == PETSC_TRUE) && d->B) { |
| if (t && d->B) { |
| ierr = MatHasOperation(d->B, MATOP_GET_DIAGONAL, &t); CHKERRQ(ierr); |
| } |
| |
| /* Setting configuration constrains */ |
| b->own_vecs+= t==PETSC_TRUE?( (d->B == 0)?1:2 ) : 0; |
| b->own_vecs+= t?( (d->B == 0)?1:2 ) : 0; |
| |
| /* Setup the step */ |
| if (b->state >= DVD_STATE_CONF) { |
| if (t == PETSC_TRUE) { |
| if (t) { |
| ierr = PetscMalloc(sizeof(dvdJacobiPrecond), &dvdjp); CHKERRQ(ierr); |
| dvdjp->diagA = *b->free_vecs; b->free_vecs++; |
| ierr = MatGetDiagonal(d->A,dvdjp->diagA); CHKERRQ(ierr); |
415,7 → 415,7
| ierr = PetscMalloc(sizeof(dvdHarmonic), &dvdh); CHKERRQ(ierr); |
| dvdh->withTarget = fixedTarget; |
| dvdh->mode = mode; |
| if (fixedTarget == PETSC_TRUE) dvd_harm_transf(dvdh, t); |
| if (fixedTarget) dvd_harm_transf(dvdh, t); |
| d->calcpairs_W_data = dvdh; |
| d->calcpairs_W = dvd_harm_updateW; |
| d->calcpairs_proj_trans = dvd_harm_proj; |
520,7 → 520,7
| PetscFunctionBegin; |
| |
| /* Update the target if it is necessary */ |
| if (data->withTarget == PETSC_FALSE) dvd_harm_transf(data, d->eigr[0]); |
| if (!data->withTarget) dvd_harm_transf(data, d->eigr[0]); |
| |
| for(i=d->V_new_s; i<d->V_new_e; i++) { |
| /* W(i) <- Wa*AV(i) - Wb*BV(i) */ |
/trunk/src/eps/impls/davidson/gd/gd.c
85,7 → 85,7
| ierr = STSetUp(eps->OP); CHKERRQ(ierr); |
| ierr = STGetKSP(eps->OP, &ksp); CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)ksp, KSPPREONLY, &t); CHKERRQ(ierr); |
| if (t == PETSC_FALSE) SETERRQ(PETSC_ERR_SUP, "gd only works with preonly ksp of the spectral transformation"); |
| if (!t) SETERRQ(PETSC_ERR_SUP, "gd only works with preonly ksp of the spectral transformation"); |
| |
| PetscFunctionReturn(0); |
| } |
/trunk/src/eps/impls/davidson/jd/jd.c
90,7 → 90,7
| ierr = STSetUp(eps->OP); CHKERRQ(ierr); |
| ierr = STGetKSP(eps->OP, &ksp); CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)ksp, KSPPREONLY, &t); CHKERRQ(ierr); |
| if (t == PETSC_TRUE) SETERRQ(PETSC_ERR_SUP, "jd does not work with preonly ksp of the spectral transformation"); |
| if (t) SETERRQ(PETSC_ERR_SUP, "jd does not work with preonly ksp of the spectral transformation"); |
| |
| PetscFunctionReturn(0); |
| } |
/trunk/src/svd/impls/cyclic/cyclic.c
185,7 → 185,7
| svd->IS = PETSC_NULL; |
| svd->nini = 0; |
| } |
| if (cyclic->setfromoptionscalled == PETSC_TRUE) { |
| if (cyclic->setfromoptionscalled) { |
| ierr = EPSSetFromOptions(cyclic->eps);CHKERRQ(ierr); |
| cyclic->setfromoptionscalled = PETSC_FALSE; |
| } |
/trunk/src/svd/impls/cross/cross.c
138,7 → 138,7
| /* Transfer the trackall option from svd to eps */ |
| ierr = SVDGetTrackAll(svd,&trackall);CHKERRQ(ierr); |
| ierr = EPSSetTrackAll(cross->eps,trackall);CHKERRQ(ierr); |
| if (cross->setfromoptionscalled == PETSC_TRUE) { |
| if (cross->setfromoptionscalled) { |
| ierr = EPSSetFromOptions(cross->eps);CHKERRQ(ierr); |
| cross->setfromoptionscalled = PETSC_FALSE; |
| } |
/trunk/src/examples/ex2.c
43,7 → 43,7
| |
| ierr = PetscOptionsGetInt(PETSC_NULL,"-n",&n,PETSC_NULL);CHKERRQ(ierr); |
| ierr = PetscOptionsGetInt(PETSC_NULL,"-m",&m,&flag);CHKERRQ(ierr); |
| if( flag==PETSC_FALSE ) m=n; |
| if(!flag) m=n; |
| N = n*m; |
| ierr = PetscPrintf(PETSC_COMM_WORLD,"\n2-D Laplacian Eigenproblem, N=%d (%dx%d grid)\n\n",N,n,m);CHKERRQ(ierr); |
| |
/trunk/src/examples/ex11.c
46,7 → 46,7
| |
| ierr = PetscOptionsGetInt(PETSC_NULL,"-n",&n,PETSC_NULL);CHKERRQ(ierr); |
| ierr = PetscOptionsGetInt(PETSC_NULL,"-m",&m,&flag);CHKERRQ(ierr); |
| if( flag==PETSC_FALSE ) m=n; |
| if(!flag) m=n; |
| N = n*m; |
| ierr = PetscPrintf(PETSC_COMM_WORLD,"\nFiedler vector of a 2-D regular mesh, N=%d (%dx%d grid)\n\n",N,n,m);CHKERRQ(ierr); |
| |
/trunk/src/examples/ex13.c
48,7 → 48,7
| |
| ierr = PetscOptionsGetInt(PETSC_NULL,"-n",&n,PETSC_NULL);CHKERRQ(ierr); |
| ierr = PetscOptionsGetInt(PETSC_NULL,"-m",&m,&flag);CHKERRQ(ierr); |
| if( flag==PETSC_FALSE ) m=n; |
| if(!flag) m=n; |
| N = n*m; |
| ierr = PetscOptionsGetInt(PETSC_NULL,"-nulldim",&nulldim,PETSC_NULL);CHKERRQ(ierr); |
| ierr = PetscPrintf(PETSC_COMM_WORLD,"\nGeneralized Symmetric Eigenproblem, N=%d (%dx%d grid), null(B)=%d\n\n",N,n,m,nulldim);CHKERRQ(ierr); |
/trunk/src/examples/ex16.c
43,7 → 43,7
| |
| ierr = PetscOptionsGetInt(PETSC_NULL,"-n",&n,PETSC_NULL);CHKERRQ(ierr); |
| ierr = PetscOptionsGetInt(PETSC_NULL,"-m",&m,&flag);CHKERRQ(ierr); |
| if( flag==PETSC_FALSE ) m=n; |
| if(!flag) m=n; |
| N = n*m; |
| ierr = PetscPrintf(PETSC_COMM_WORLD,"\nQuadratic Eigenproblem, N=%d (%dx%d grid)\n\n",N,n,m);CHKERRQ(ierr); |
| |
/trunk/src/examples/ex18.c
269,7 → 269,7
| if (da < db) *r = -1; |
| else if (da > db) *r = 1; |
| else *r = 0; |
| } else if ((aisright == PETSC_TRUE) && (bisright == PETSC_FALSE)) |
| } else if (aisright && !bisright) |
| *r = -1; /* 'a' is on the right */ |
| else |
| *r = 1; /* 'b' is on the right */ |
.
Property changes :
Modified: svn:mergeinfo
Merged /branches/slepc-3_1-branch:r2176