| ${SOURCEC} ${SOURCEH}; \ |
| chmod -f g+w ${LOC}/docs/manualpages/${MANSEC}/* ; fi |
| slepc_manexamples: |
| -@base=`basename ${LOCDIR}`; \ |
| if [ "$${base}" = "tutorials" ] ; then \ |
| echo "Generating manual example links" ; \ |
| for i in ${EXAMPLESC} ${EXAMPLESF} foo ; do \ |
| if [ "$$i" != "foo" ] ; then \ |
| a=`cat $$i | ${MAPNAMES} -map ${LOC}/docs/manualpages/manualpages.cit \ |
| -printmatch -o /dev/null | sort | uniq` ; \ |
| for j in $$a ; do \ |
| b=`ls ${LOC}/docs/manualpages/*/$${j}.html | cut -f9` ; \ |
| l=`grep tutorials $${b} | wc -l`; \ |
| if [ $$l -le 10 ] ; then \ |
| if [ $$l -eq 0 ] ; then \ |
| echo "<P><H3><FONT COLOR=\"#883300\">Examples</FONT></H3>" >> $$b; \ |
| fi; \ |
| echo "<A HREF=\"../../../BB\">BB</A><BR>" | sed s?BB?${LOCDIR}$$i.html?g >> $$b; \ |
| grep -v /BODY $$b > ltmp; \ |
| echo "</BODY></HTML>" >> ltmp; \ |
| mv -f ltmp $$b; \ |
| fi; \ |
| done; \ |
| fi; \ |
| done; \ |
| fi |
| slepc_html: |
| -@sed -e s?man+../?man+ROOT/docs/manualpages/? ${LOC}/docs/manualpages/manualpages.cit > /tmp/$$USER.htmlmap |
| -@cat ${PETSC_DIR}/src/docs/mpi.www.index >> /tmp/$$USER.htmlmap |
| Level: intermediate |
| .seealso: QEPMonitorFirst(), QEPMonitorAll(), QEPMonitorLG(), QEPMonitorLGAll(), QEPMonitorCancel() |
| .seealso: QEPMonitorFirst(), QEPMonitorAll(), QEPMonitorCancel() |
| @*/ |
| PetscErrorCode QEPMonitorSet(QEP qep,PetscErrorCode (*monitor)(QEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,void*),void *mctx,PetscErrorCode (*monitordestroy)(void**)) |
| { |
| */ |
| #include <private/qepimpl.h> /*I "slepcqep.h" I*/ |
| #include <private/ipimpl.h> /*I "slepcip.h" I*/ |
| #include <private/ipimpl.h> |
| #undef __FUNCT__ |
| #define __FUNCT__ "QEPSetUp" |
| */ |
| #include <private/qepimpl.h> /*I "slepcqep.h" I*/ |
| #include <private/slepcimpl.h> /*I "slepcsys.h" I*/ |
| #include <slepcblaslapack.h> |
| #undef __FUNCT__ |
| dependent on the solution method. |
| The parameters ncv and mpd are intimately related, so that the user is advised |
| to set one of them at most. Normal usage is the following: |
| (a) In cases where nev is small, the user sets ncv (a reasonable default is 2*nev). |
| (b) In cases where nev is large, the user sets mpd. |
| to set one of them at most. Normal usage is that |
| (a) in cases where nev is small, the user sets ncv (a reasonable default is 2*nev); and |
| (b) in cases where nev is large, the user sets mpd. |
| The value of ncv should always be between nev and (nev+mpd), typically |
| ncv=nev+mpd. If nev is not too large, mpd=nev is a reasonable choice, otherwise |
| Level: intermediate |
| .seealso: QEPGetLeftVectorsWanted(), QEPGetEigenvectorLeft() |
| .seealso: QEPGetLeftVectorsWanted() |
| @*/ |
| PetscErrorCode QEPSetLeftVectorsWanted(QEP qep,PetscBool leftvecs) |
| { |
| PetscFunctionBegin; |
| PetscValidHeaderSpecific(qep,QEP_CLASSID,1); |
| if (!qep->ip) { ierr = QEPGetIP(qep,&qep->ip);CHKERRQ(ierr); } |
| ierr = IPSetOptionsPrefix(qep->ip,prefix);CHKERRQ(ierr); |
| ierr = PetscObjectSetOptionsPrefix((PetscObject)qep,prefix);CHKERRQ(ierr); |
| PetscFunctionReturn(0); |
| } |
| PetscErrorCode QEPAppendOptionsPrefix(QEP qep,const char *prefix) |
| { |
| PetscErrorCode ierr; |
| PetscBool flg; |
| EPS eps; |
| PetscFunctionBegin; |
| PetscValidHeaderSpecific(qep,QEP_CLASSID,1); |
| if (!qep->ip) { ierr = QEPGetIP(qep,&qep->ip);CHKERRQ(ierr); } |
| ierr = IPSetOptionsPrefix(qep->ip,prefix);CHKERRQ(ierr); |
| ierr = PetscObjectAppendOptionsPrefix((PetscObject)qep,prefix);CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)qep,QEPLINEAR,&flg);CHKERRQ(ierr); |
| if (flg) { |
| ierr = QEPLinearGetEPS(qep,&eps);CHKERRQ(ierr); |
| ierr = EPSSetOptionsPrefix(eps,((PetscObject)qep)->prefix);CHKERRQ(ierr); |
| ierr = EPSAppendOptionsPrefix(eps,"qep_");CHKERRQ(ierr); |
| } |
| PetscFunctionReturn(0); |
| } |
| ierr = EPSCreate(((PetscObject)qep)->comm,&ctx->eps);CHKERRQ(ierr); |
| ierr = EPSSetOptionsPrefix(ctx->eps,((PetscObject)qep)->prefix);CHKERRQ(ierr); |
| ierr = EPSAppendOptionsPrefix(ctx->eps,"qep_");CHKERRQ(ierr); |
| ierr = STSetOptionsPrefix(ctx->eps->OP,((PetscObject)ctx->eps)->prefix);CHKERRQ(ierr); |
| ierr = PetscObjectIncrementTabLevel((PetscObject)ctx->eps,(PetscObject)qep,1);CHKERRQ(ierr); |
| ierr = PetscLogObjectParent(qep,ctx->eps);CHKERRQ(ierr); |
| if (!qep->ip) { ierr = QEPGetIP(qep,&qep->ip);CHKERRQ(ierr); } |
| eigi - imaginary part of a computed eigenvalue |
| Level: developer |
| .seealso: EPSBackTransform() |
| @*/ |
| PetscErrorCode STBackTransform(ST st,PetscInt n,PetscScalar* eigr,PetscScalar* eigi) |
| { |
| PetscFunctionBegin; |
| PetscValidHeaderSpecific(st,ST_CLASSID,1); |
| ierr = PetscObjectAppendOptionsPrefix((PetscObject)st,prefix);CHKERRQ(ierr); |
| if (!st->ksp) { ierr = STGetKSP(st,&st->ksp);CHKERRQ(ierr); } |
| ierr = KSPSetOptionsPrefix(st->ksp,((PetscObject)st)->prefix);CHKERRQ(ierr); |
| ierr = KSPAppendOptionsPrefix(st->ksp,"st_");CHKERRQ(ierr); |
| ierr = PetscObjectAppendOptionsPrefix((PetscObject)st,prefix);CHKERRQ(ierr); |
| PetscFunctionReturn(0); |
| } |
| Collective on ST |
| Input Parameters: |
| + ST - the ST context |
| + st - the ST context |
| - viewer - optional visualization context |
| Note: |
| . st - the spectral transformation context |
| Level: beginner |
| .seealso: |
| @*/ |
| PetscErrorCode STSetFromOptions(ST st) |
| { |
| */ |
| #include <private/stimpl.h> /*I "slepcst.h" I*/ |
| #include <slepcsys.h> |
| #undef __FUNCT__ |
| #define __FUNCT__ "STAssociatedKSPSolve" |
| ierr = KSPAppendOptionsPrefix(st->ksp,"st_");CHKERRQ(ierr); |
| ierr = PetscObjectIncrementTabLevel((PetscObject)st->ksp,(PetscObject)st,1);CHKERRQ(ierr); |
| ierr = PetscLogObjectParent(st,st->ksp);CHKERRQ(ierr); |
| ierr = KSPSetTolerances(st->ksp,SLEPC_DEFAULT_TOL,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT);CHKERRQ(ierr); |
| } |
| *ksp = st->ksp; |
| PetscFunctionReturn(0); |
| if (st->shift_matrix == ST_MATMODE_INPLACE) { |
| if (st->B) { |
| ierr = MatAXPY(st->A,st->sigma,st->B,st->str);CHKERRQ(ierr); |
| } else { |
| ierr = MatShift(st->A,st->sigma);CHKERRQ(ierr); |
| } else { |
| ierr = MatShift(st->A,st->sigma);CHKERRQ(ierr); |
| } |
| st->setupcalled = 0; |
| } |
| case ST_MATMODE_INPLACE: |
| /* Undo previous operations */ |
| if (st->sigma != 0.0) { |
| if (st->B) { |
| if (st->B) { |
| ierr = MatAXPY(st->A,st->sigma,st->B,st->str);CHKERRQ(ierr); |
| } else { |
| ierr = MatShift(st->A,st->sigma);CHKERRQ(ierr); |
| } |
| /* Apply new shift */ |
| if (newshift != 0.0) { |
| if (st->B) { |
| if (st->B) { |
| ierr = MatAXPY(st->A,-newshift,st->B,st->str);CHKERRQ(ierr); |
| } else { |
| ierr = MatShift(st->A,-newshift);CHKERRQ(ierr); |
| ierr = KSPSetOperators(st->ksp,st->A,st->A,flg);CHKERRQ(ierr); |
| break; |
| case ST_MATMODE_SHELL: |
| ierr = KSPSetOperators(st->ksp,st->mat,st->mat,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); |
| ierr = KSPSetOperators(st->ksp,st->mat,st->mat,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); |
| break; |
| default: |
| ierr = MatCopy(st->A,st->mat,SUBSET_NONZERO_PATTERN);CHKERRQ(ierr); |
| ierr = MatCopy(st->A,st->mat,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); |
| if (newshift != 0.0) { |
| if (st->B) { ierr = MatAXPY(st->mat,-newshift,st->B,st->str);CHKERRQ(ierr); } |
| else { ierr = MatShift(st->mat,-newshift);CHKERRQ(ierr); } |
| #undef __FUNCT__ |
| #define __FUNCT__ "STShellSetContext" |
| /*@ |
| STShellSetContext - sets the context for a shell ST |
| STShellSetContext - Sets the context for a shell ST |
| Logically Collective on ST |
| default: |
| if (st->sigma != 0.0) { |
| ierr = MatDuplicate(st->A,MAT_COPY_VALUES,&st->mat);CHKERRQ(ierr); |
| if (st->B) { |
| ierr = MatAXPY(st->mat,-st->sigma,st->B,st->str);CHKERRQ(ierr); |
| } else { |
| ierr = MatShift(st->mat,-st->sigma);CHKERRQ(ierr); |
| } |
| if (st->B) { ierr = MatAXPY(st->mat,-st->sigma,st->B,st->str);CHKERRQ(ierr); } |
| else { ierr = MatShift(st->mat,-st->sigma);CHKERRQ(ierr); } |
| ierr = KSPSetOperators(st->ksp,st->mat,st->mat,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); |
| } else { |
| st->mat = PETSC_NULL; |
| ierr = KSPSetOperators(st->ksp,st->A,st->A,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); |
| } |
| } |
| ierr = KSPSetUp(st->ksp);CHKERRQ(ierr); |
| PetscFunctionReturn(0); |
| } |
| PetscFunctionBegin; |
| /* Nothing to be done if STSetUp has not been called yet */ |
| if (!st->setupcalled) PetscFunctionReturn(0); |
| /* Check if the new KSP matrix has the same zero structure */ |
| if (st->B && st->str == DIFFERENT_NONZERO_PATTERN && (st->sigma == 0.0 || newshift == 0.0)) { |
| flg = DIFFERENT_NONZERO_PATTERN; |
| ierr = KSPSetOperators(st->ksp,st->A,st->A,flg);CHKERRQ(ierr); |
| break; |
| case ST_MATMODE_SHELL: |
| ierr = KSPSetOperators(st->ksp,st->mat,st->mat,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); |
| ierr = KSPSetOperators(st->ksp,st->mat,st->mat,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); |
| break; |
| default: |
| if (st->mat) { |
| ierr = MatCopy(st->A,st->mat,SUBSET_NONZERO_PATTERN);CHKERRQ(ierr); |
| ierr = MatCopy(st->A,st->mat,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr); |
| } else { |
| ierr = MatDuplicate(st->A,MAT_COPY_VALUES,&st->mat);CHKERRQ(ierr); |
| } |
| if (newshift != 0.0) { |
| if (st->B) { |
| ierr = MatAXPY(st->mat,-newshift,st->B,st->str);CHKERRQ(ierr); |
| } else { |
| ierr = MatShift(st->mat,-newshift);CHKERRQ(ierr); |
| } |
| if (st->B) { ierr = MatAXPY(st->mat,-newshift,st->B,st->str);CHKERRQ(ierr); } |
| else { ierr = MatShift(st->mat,-newshift);CHKERRQ(ierr); } |
| } |
| ierr = KSPSetOperators(st->ksp,st->mat,st->mat,flg);CHKERRQ(ierr); |
| } |
| */ |
| #include <private/fortranimpl.h> |
| #include <private/epsimpl.h> /*I "slepceps.h" I*/ |
| #include <private/epsimpl.h> |
| #if defined(PETSC_HAVE_FORTRAN_CAPS) |
| #define epsdestroy_ EPSDESTROY |
| */ |
| #include <private/epsimpl.h> /*I "slepceps.h" I*/ |
| #include <private/ipimpl.h> /*I "slepcip.h" I*/ |
| #include <private/ipimpl.h> |
| #undef __FUNCT__ |
| #define __FUNCT__ "EPSSetUp" |
| else eps->nrmb = 1.0; |
| } |
| if (!eps->balance) eps->balance = EPS_BALANCE_NONE; |
| /* call specific solver setup */ |
| ierr = (*eps->ops->setup)(eps);CHKERRQ(ierr); |
| if (eps->tol==PETSC_DEFAULT) eps->tol = SLEPC_DEFAULT_TOL; |
| /* Build balancing matrix if required */ |
| if (!eps->balance) eps->balance = EPS_BALANCE_NONE; |
| if (!eps->ishermitian && (eps->balance==EPS_BALANCE_ONESIDE || eps->balance==EPS_BALANCE_TWOSIDE)) { |
| if (!eps->D) { |
| ierr = VecDuplicate(eps->V[0],&eps->D);CHKERRQ(ierr); |
| dependent on the solution method. |
| The parameters ncv and mpd are intimately related, so that the user is advised |
| to set one of them at most. Normal usage is the following: |
| (a) In cases where nev is small, the user sets ncv (a reasonable default is 2*nev). |
| (b) In cases where nev is large, the user sets mpd. |
| to set one of them at most. Normal usage is that |
| (a) in cases where nev is small, the user sets ncv (a reasonable default is 2*nev); and |
| (b) in cases where nev is large, the user sets mpd. |
| The value of ncv should always be between nev and (nev+mpd), typically |
| ncv=nev+mpd. If nev is not too large, mpd=nev is a reasonable choice, otherwise |
| PetscValidHeaderSpecific(eps,EPS_CLASSID,1); |
| if (!eps->OP) { ierr = EPSGetST(eps,&eps->OP);CHKERRQ(ierr); } |
| ierr = STSetOptionsPrefix(eps->OP,prefix);CHKERRQ(ierr); |
| if (!eps->ip) { ierr = EPSGetIP(eps,&eps->ip);CHKERRQ(ierr); } |
| ierr = IPSetOptionsPrefix(eps->ip,prefix);CHKERRQ(ierr); |
| ierr = PetscObjectSetOptionsPrefix((PetscObject)eps,prefix);CHKERRQ(ierr); |
| PetscFunctionReturn(0); |
| } |
| PetscValidHeaderSpecific(eps,EPS_CLASSID,1); |
| if (!eps->OP) { ierr = EPSGetST(eps,&eps->OP);CHKERRQ(ierr); } |
| ierr = STAppendOptionsPrefix(eps->OP,prefix);CHKERRQ(ierr); |
| if (!eps->ip) { ierr = EPSGetIP(eps,&eps->ip);CHKERRQ(ierr); } |
| ierr = IPSetOptionsPrefix(eps->ip,prefix);CHKERRQ(ierr); |
| ierr = PetscObjectAppendOptionsPrefix((PetscObject)eps,prefix);CHKERRQ(ierr); |
| PetscFunctionReturn(0); |
| } |
| Level: intermediate |
| .seealso: EPSMonitorFirst(), EPSMonitorAll(), EPSMonitorLG(), EPSMonitorLGAll(), EPSMonitorCancel() |
| .seealso: EPSMonitorFirst(), EPSMonitorAll(), EPSMonitorCancel() |
| @*/ |
| PetscErrorCode EPSMonitorSet(EPS eps,PetscErrorCode (*monitor)(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,void*),void *mctx,PetscErrorCode (*monitordestroy)(void**)) |
| { |
| */ |
| #include <private/epsimpl.h> /*I "slepceps.h" I*/ |
| #include <private/stimpl.h> /*I "slepcst.h" I*/ |
| #include <../src/eps/impls/external/blzpack/blzpackp.h> |
| PetscErrorCode EPSSolve_BLZPACK(EPS); |
| #include <petscsys.h> |
| #include <private/epsimpl.h> /*I "slepceps.h" I*/ |
| #include <private/stimpl.h> /*I "slepcst.h" I*/ |
| #include <private/stimpl.h> |
| PetscErrorCode EPSSolve_PRIMME(EPS); |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| */ |
| #include <private/epsimpl.h> /*I "slepceps.h" I*/ |
| #include <private/slepcimpl.h> /*I "slepcsys.h" I*/ |
| #include <private/epsimpl.h> |
| #include <private/slepcimpl.h> |
| #include <slepcblaslapack.h> |
| #undef __FUNCT__ |
| PetscErrorCode ierr; |
| PetscInt i,conv,k,l,lds,lt,nv,m,*iwork,p,j; |
| Vec u=eps->work[0]; |
| PetscScalar *Q,nu; |
| PetscReal *a,*b,*work,beta,rtmp; |
| PetscScalar *Q,nu,rtmp; |
| PetscReal *a,*b,*work,beta; |
| PetscBool breakdown; |
| PetscInt count0,count1; |
| PetscReal theta,lambda; |
| count0=count1=0; |
| for(i=0;i<k;i++){ |
| theta = PetscRealPart(eps->eigr[i]); |
| lambda = sr->back[i]; |
| lambda = PetscRealPart(sr->back[i]); |
| if( ((sr->dir)*theta < 0) && ((sr->dir)*(lambda - sPres->ext[0]) > 0))count0++; |
| if( ((sr->dir)*theta > 0) && ((sr->dir)*(sPres->ext[1] - lambda) > 0))count1++; |
| } |
| } |
| ierr = STBackTransform(eps->OP,nv+eps->nconv,sr->back,eps->eigi);CHKERRQ(ierr); |
| for(i=0;i<nv+eps->nconv;i++){ |
| lambda = sr->back[i]; |
| lambda = PetscRealPart(sr->back[i]); |
| if( ((sr->dir)*(lambda - sPres->ext[0]) > 0)&& ((sr->dir)*(sPres->ext[1] - lambda) > 0)){ |
| sr->monit[sr->indexEig+aux]=eps->eigr[i]; |
| sr->errest[sr->indexEig+aux]=eps->errest[i]; |
| PetscErrorCode ierr; |
| PetscReal lambda,err,norm; |
| PetscInt i,count; |
| PetscBool cond,iscayley; |
| PetscBool iscayley; |
| SR sr; |
| shift sPres; |
| /* Sort eigenvalues */ |
| ierr = sortRealEigenvalues(eps->eigr,eps->perm,eps->nconv,PETSC_FALSE,sr->dir); |
| /* Values stored in global array */ |
| /* Condition for avoiding comparing with a non-existing end */ |
| cond = (!sPres->neighb[1] && !sr->hasEnd)?PETSC_TRUE:PETSC_FALSE; |
| for( i=0; i < eps->nconv ;i++ ){ |
| lambda = PetscRealPart(eps->eigr[eps->perm[i]]); |
| err = eps->errest[eps->perm[i]]; |
| PetscFunctionBegin; |
| if ((rA == 0) || (cB == 0)) { PetscFunctionReturn(0); } |
| PetscValidScalarPointer(C,1); |
| PetscValidScalarPointer(A,5); |
| PetscValidScalarPointer(B,10); |
| ierr = PetscLogEventBegin(SLEPC_SlepcDenseMatProd,0,0,0,0);CHKERRQ(ierr); |
| PetscFunctionBegin; |
| if ((rA == 0) || (cB == 0)) { PetscFunctionReturn(0); } |
| PetscValidScalarPointer(C,1); |
| PetscValidScalarPointer(A,4); |
| PetscValidScalarPointer(B,10); |
| /* Transpose if needed */ |
| if (At) tmp = rA, rA = cA, cA = tmp; |
| PetscBLASInt rA = _rA, one=1; |
| PetscFunctionBegin; |
| PetscValidScalarPointer(A,1); |
| PetscValidScalarPointer(eigi,5); |
| ierr = PetscLogEventBegin(SLEPC_SlepcDenseNorm,0,0,0,0);CHKERRQ(ierr); |
| /* Quick exit */ |
| if ((_rA == 0) || (cA == 0)) { PetscFunctionReturn(0); } |
| PetscValidScalarPointer(A,1); |
| PetscValidScalarPointer(auxS,5); |
| PetscValidIntPointer(ncA,7); |
| /* Memory check */ |
| if (lw < cA) SETERRQ(PETSC_COMM_SELF,1, "Insufficient memory for xGEQRF"); |
| PetscInt i; |
| PetscFunctionBegin; |
| PetscValidScalarPointer(Y,1); |
| PetscValidScalarPointer(X,3); |
| if ((ldX < rX) || (ldY < rX)) { |
| SETERRQ(PETSC_COMM_SELF,1, "Leading dimension error"); |
| PetscInt i,j,c; |
| PetscFunctionBegin; |
| PetscValidScalarPointer(Y,1); |
| PetscValidScalarPointer(X,4); |
| if ((ldX < rX) || (ldY < rX)) { |
| SETERRQ(PETSC_COMM_SELF,1, "Leading dimension error"); |
| PetscFunctionBegin; |
| SlepcValidVecsContiguous(Y,cM*dY,1); |
| SlepcValidVecsContiguous(X,cX,5); |
| PetscValidScalarPointer(M,8); |
| /* Compute the real number of columns */ |
| rcX = cX/dX; |
| PetscFunctionBegin; |
| SlepcValidVecsContiguous(X,cX,1); |
| PetscValidScalarPointer(M,4); |
| PetscValidScalarPointer(work,8); |
| if (cX != rM) { |
| SETERRQ(((PetscObject)*X)->comm,1, "Matrix dimensions do not match"); |
| [ W(sU:eU-1, 0:sV-1) W(sU:eU-1, sV:eV-1) ] |
| where W = U' * V. |
| workS0 and workS1 are an auxiliary scalar vector of size |
| (eU-sU)*sV+(eV-sV)*eU. But, if sU == 0, sV == 0 and eU == ldM, only workS0 |
| (eU-sU)*sV*(sU!=0)+(eV-sV)*eU. But, if sU == 0, sV == 0 and eU == ldM, only workS0 |
| is needed, and of size eU*eV. |
| */ |
| PetscErrorCode VecsMult(PetscScalar *M, MatType_t sM, PetscInt ldM, |
| PetscScalar *workS0, PetscScalar *workS1) |
| { |
| PetscErrorCode ierr; |
| PetscInt ldU, ldV, i, j, k; |
| PetscInt ldU, ldV, i, j, k, ms = (eU-sU)*sV*(sU==0?0:1)+(eV-sV)*eU; |
| const PetscScalar *pu, *pv; |
| PetscScalar *W, *Wr; |
| SlepcValidVecsContiguous(U,eU,4); |
| SlepcValidVecsContiguous(V,eV,7); |
| PetscValidScalarPointer(M,1); |
| /* Get the dense matrices and dimensions associated to U and V */ |
| ierr = VecGetLocalSize(U[0], &ldU); CHKERRQ(ierr); |
| ierr = VecGetArrayRead(U[0], &pu);CHKERRQ(ierr); |
| ierr = VecGetArrayRead(V[0], &pv);CHKERRQ(ierr); |
| if (workS0) |
| if (workS0) { |
| PetscValidScalarPointer(workS0,10); |
| W = workS0; |
| else { |
| ierr = PetscMalloc(sizeof(PetscScalar)*((eU-sU)*sV+(eV-sV)*eU), &W); |
| } else { |
| ierr = PetscMalloc(sizeof(PetscScalar)*ms, &W); |
| CHKERRQ(ierr); |
| } |
| } else if (DVD_ISNOT(sM,DVD_MAT_UTRIANG) && |
| DVD_ISNOT(sM,DVD_MAT_LTRIANG)) { |
| if (workS1) { |
| PetscValidScalarPointer(workS1,11); |
| Wr = workS1; |
| if (PetscAbs(PetscMin(W-workS1, workS1-W)) < ((eU-sU)*sV+(eV-sV)*eU)) { |
| if (PetscAbs(PetscMin(W-workS1, workS1-W)) < ms) { |
| SETERRQ(PETSC_COMM_SELF,1, "Consistency broken!"); |
| } |
| } else { |
| ierr = PetscMalloc(sizeof(PetscScalar)*((eU-sU)*sV+(eV-sV)*eU), &Wr); |
| ierr = PetscMalloc(sizeof(PetscScalar)*ms, &Wr); |
| CHKERRQ(ierr); |
| } |
| /* W(0:(eU-sU)*sV-1) <- U(sU:eU-1)' * V(0:sV-1) */ |
| ierr = SlepcDenseMatProd(W, eU-sU, 0.0, 1.0, |
| pu+ldU*sU, ldU, ldU, eU-sU, PETSC_TRUE, |
| pv , ldV, ldV, sV, PETSC_FALSE); |
| CHKERRQ(ierr); |
| if (sU > 0) { |
| ierr = SlepcDenseMatProd(W, eU-sU, 0.0, 1.0, |
| pu+ldU*sU, ldU, ldU, eU-sU, PETSC_TRUE, |
| pv , ldV, ldV, sV, PETSC_FALSE); |
| CHKERRQ(ierr); |
| } |
| /* W((eU-sU)*sV:(eU-sU)*sV+(eV-sV)*eU-1) <- U(0:eU-1)' * V(sV:eV-1) */ |
| ierr = SlepcDenseMatProd(W+(eU-sU)*sV, eU, 0.0, 1.0, |
| ierr = SlepcDenseMatProd(W+(eU-sU)*sV*(sU > 0?1:0), eU, 0.0, 1.0, |
| pu, ldU, ldU, eU, PETSC_TRUE, |
| pv+ldV*sV, ldV, ldV, eV-sV, PETSC_FALSE); |
| CHKERRQ(ierr); |
| /* ReduceAll(W, SUM) */ |
| ierr = MPI_Allreduce(W, Wr, (eU-sU)*sV+(eV-sV)*eU, MPIU_SCALAR, |
| ierr = MPI_Allreduce(W, Wr, ms, MPIU_SCALAR, |
| MPIU_SUM, ((PetscObject)U[0])->comm); CHKERRQ(ierr); |
| /* M(...,...) <- W */ |
| for (i=0,k=0; i<sV; i++) |
| k = 0; |
| if (sU > 0) for (i=0; i<sV; i++) |
| for (j=ldM*i+sU; j<ldM*i+eU; j++,k++) M[j] = Wr[k]; |
| for (i=sV; i<eV; i++) |
| for (j=ldM*i; j<ldM*i+eU; j++,k++) M[j] = Wr[k]; |
| for (j=ldM*i; j<ldM*i+eU; j++,k++) M[j] = Wr[k]; |
| if (!workS1) { |
| ierr = PetscFree(Wr); CHKERRQ(ierr); |
| } else if (DVD_IS(sM,DVD_MAT_UTRIANG) && |
| DVD_ISNOT(sM,DVD_MAT_LTRIANG)) { |
| if (workS1) { |
| PetscValidScalarPointer(workS1,11); |
| Wr = workS1; |
| if (PetscAbs(PetscMin(W-workS1,workS1-W)) < (eV-sV)*eU) { |
| SETERRQ(PETSC_COMM_SELF,1, "Consistency broken!"); |
| } else if (DVD_ISNOT(sM,DVD_MAT_UTRIANG) && |
| DVD_IS(sM,DVD_MAT_LTRIANG)) { |
| if (workS1) { |
| PetscValidScalarPointer(workS1,11); |
| Wr = workS1; |
| if (PetscMin(W - workS1, workS1 - W) < (eU-sU)*eV) { |
| SETERRQ(PETSC_COMM_SELF,1, "Consistency broken!"); |
| SlepcValidVecsContiguous(U,eU,4); |
| SlepcValidVecsContiguous(V,eV,7); |
| PetscValidScalarPointer(M,1); |
| /* Get the dense matrices and dimensions associated to U and V */ |
| ierr = VecGetLocalSize(U[0], &ldU); CHKERRQ(ierr); |
| /* Check if quick exit */ |
| if ((rM == 0) || (cM == 0)) |
| PetscFunctionReturn(0); |
| PetscValidScalarPointer(M,1); |
| if (sM != 0) SETERRQ(((PetscObject)V)->comm,1, "Matrix structure not supported"); |
| /* Check if quick exit */ |
| if ((rM == 0) || (cM == 0)) |
| PetscFunctionReturn(0); |
| PetscValidScalarPointer(M,1); |
| PetscValidScalarPointer(auxS,6); |
| if (auxS) |
| W = auxS; |
| SlepcValidVecsContiguous(U,eU,4); |
| SlepcValidVecsContiguous(V,eV,7); |
| PetscValidScalarPointer(M,1); |
| /* Get the dense matrices and dimensions associated to U and V */ |
| ierr = VecGetLocalSize(U[0], &ldU); CHKERRQ(ierr); |
| ierr = PetscLogEventBegin(SLEPC_VecsMult,0,0,0,0);CHKERRQ(ierr); |
| if ((sU == 0) && (sV == 0) && (eU == ldM)) { |
| if ((sU == 0) && (sV == 0)) { |
| /* Use the smart memory usage version */ |
| /* Add the reduction to r */ |
| *sr = (DvdMult_copy_func*)ptr; |
| PetscFunctionBegin; |
| PetscValidScalarPointer(out,1); |
| for (i=sr->i0,k=0; i<sr->i1; i++) |
| for (j=sr->ld*i+sr->s0; j<sr->ld*i+sr->e0; j++,k++) sr->M[j] = out[k]; |
| if (!wS0) { |
| ierr = PetscMalloc(sizeof(PetscScalar)*n*n, &H); CHKERRQ(ierr); |
| } else |
| } else { |
| PetscValidScalarPointer(wS0,3); |
| H = wS0; |
| } |
| if (!wS1) { |
| ierr = PetscMalloc(sizeof(PetscScalar)*n*n, &T); CHKERRQ(ierr); |
| } else |
| } else { |
| PetscValidScalarPointer(wS1,4); |
| T = wS1; |
| } |
| /* H <- V' * V */ |
| ierr = VecsMult(H, 0, n, V, 0, n, V, 0, n, T, PETSC_NULL); CHKERRQ(ierr); |
| MPI_Comm comm) |
| { |
| PetscFunctionBegin; |
| PetscValidScalarPointer(in,3); |
| PetscValidScalarPointer(out,4); |
| r->in = in; |
| r->out = out; |
| ldS, ldT, leading dimension of S and T |
| ldpX, ldpY, leading dimension of pX and pY |
| auxS, auxiliar scalar of length: |
| double standard 3n+n*n, double generalized 11n+4n*n, |
| complex standard 3n+n*n, complex generalized 3n+2n*n |
| double standard 3n, double generalized 6n, |
| complex standard 3n, complex generalized 3n |
| size_auxS, the length of auxS |
| doProd, if true pX and pY return the eigenvectors premultiplied by the input vectors stored in pX and pY respectively |
| */ |
| PetscErrorCode dvd_compute_eigenvectors(PetscInt n_, PetscScalar *S, |
| PetscInt ldS, PetscScalar *T, PetscInt ldT, PetscScalar *pX, |
| PetscInt ldS_, PetscScalar *T, PetscInt ldT_, PetscScalar *pX, |
| PetscInt ldpX_, PetscScalar *pY, PetscInt ldpY_, PetscScalar *auxS, |
| PetscInt size_auxS, PetscBool doProd) |
| { |
| PetscFunctionBegin; |
| SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"GGEV - Lapack routine is unavailable."); |
| #else |
| PetscErrorCode ierr; |
| PetscBLASInt n, ldpX, ldpY, nout, info; |
| PetscScalar *Sc, *Tc; |
| PetscBLASInt n, ldpX, ldpY, nout, info, ldS, ldT; |
| const char *side, *howmny; |
| #if defined(PETSC_USE_COMPLEX) |
| PetscReal *auxR; |
| #else |
| PetscScalar *pA,*pB; |
| PetscBLASInt n1, ldpA,ldpB; |
| PetscScalar *alphar, *alphai, *beta; |
| #endif |
| PetscFunctionBegin; |
| PetscValidScalarPointer(S,2); |
| if (T) { PetscValidScalarPointer(T,4); } |
| if (pX) { PetscValidScalarPointer(pX,6); } |
| if (pY) { PetscValidScalarPointer(pY,8); } |
| PetscValidScalarPointer(auxS,10); |
| n = PetscBLASIntCast(n_); |
| ldpX = PetscBLASIntCast(ldpX_); |
| ldpY = PetscBLASIntCast(ldpY_); |
| ldpX = PetscBLASIntCast(PetscMax(ldpX_,1)); |
| ldpY = PetscBLASIntCast(PetscMax(ldpY_,1)); |
| ldS = PetscBLASIntCast(PetscMax(ldS_,1)); |
| ldT = PetscBLASIntCast(PetscMax(ldT_,1)); |
| if (pX && pY) side = "B"; |
| else if (pX) side = "R"; |
| else if (pY) side = "L"; |
| else { PetscFunctionReturn(0); } |
| if (!pX) ldpX = 1; |
| if (!pY) ldpY = 1; |
| howmny = doProd?"B":"A"; |
| Sc = auxS; auxS+= n*n; size_auxS-= n*n; |
| if (T) Tc = auxS, auxS+= n*n, size_auxS-= n*n; |
| else Tc = PETSC_NULL; |
| /* Sc <- S, Tc <- T */ |
| ierr = SlepcDenseCopy(Sc, n, S, ldS, n, n); CHKERRQ(ierr); |
| if (T) { |
| ierr = SlepcDenseCopy(Tc, n, T, ldT, n, n); CHKERRQ(ierr); |
| } |
| if (T) { |
| /* [eigr, pX] = eig(S, T) */ |
| #if defined(PETSC_USE_COMPLEX) |
| auxR = (PetscReal*)auxS; auxS = (PetscScalar*)(auxR+2*n); size_auxS-= 2*n; |
| if (size_auxS < 2*n) |
| SETERRQ(PETSC_COMM_SELF,PETSC_ERR_LIB,"Insufficient work space for xTGEVC"); |
| LAPACKtgevc_(side,howmny,PETSC_NULL,&n,Sc,&n,Tc,&n,pY,&ldpY,pX,&ldpX,&n,&nout,auxS,auxR,&info); |
| LAPACKtgevc_(side,howmny,PETSC_NULL,&n,S,&ldS,T,&ldT,pY,&ldpY,pX,&ldpX,&n,&nout,auxS,auxR,&info); |
| if (info) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error in Lapack xTGEVC %d",info); |
| #else |
| alphar = auxS; auxS+= n; size_auxS-= n; |
| alphai = auxS; auxS+= n; size_auxS-= n; |
| beta = auxS; auxS+= n; size_auxS-= n; |
| 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; |
| else pB = PETSC_NULL, ldpB = 0; |
| } else { |
| pA = pX; pB = pY; ldpA = ldpX; ldpB = ldpY; |
| } |
| /* LAPACKtgevc_ needs the element i,i+1 in the 2-by-2 digonal blocs |
| of T that represent complex conjugate eigenpairs to be zero */ |
| n1 = size_auxS; |
| if (size_auxS < 8*n) |
| SETERRQ(PETSC_COMM_SELF,PETSC_ERR_LIB,"Insufficient work space 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_COMM_SELF,PETSC_ERR_LIB,"Error in Lapack xGGEV %d",info); |
| if (doProd) { |
| if (pX) { |
| /* pX <- pX * pA */ |
| ierr = SlepcDenseCopy(Sc, n, pX, ldpX, n, n); CHKERRQ(ierr); |
| ierr = SlepcDenseMatProd(pX, ldpX, 0.0, 1.0, |
| Sc, n, n, n, PETSC_FALSE, |
| pA, n, n, n, PETSC_FALSE); CHKERRQ(ierr); |
| } |
| if (pY) { |
| /* pY <- pY * pB */ |
| ierr = SlepcDenseCopy(Sc, n, pY, ldpY, n, n); CHKERRQ(ierr); |
| ierr = SlepcDenseMatProd(pY, ldpY, 0.0, 1.0, |
| Sc, n, n, n, PETSC_FALSE, |
| pB, n, n, n, PETSC_FALSE); CHKERRQ(ierr); |
| } |
| } |
| if (size_auxS < 6*n) |
| SETERRQ(PETSC_COMM_SELF,PETSC_ERR_LIB,"Insufficient work space for xTGEVC"); |
| LAPACKtgevc_(side,howmny,PETSC_NULL,&n,S,&ldS,T,&ldT,pY,&ldpY,pX,&ldpX,&n,&nout,auxS,&info); |
| #endif |
| } else { |
| /* [eigr, pX] = eig(S) */ |
| auxR = (PetscReal*)auxS; auxS = (PetscScalar*)(auxR+n); size_auxS-= n; |
| if (size_auxS < 2*n) |
| SETERRQ(PETSC_COMM_SELF,PETSC_ERR_LIB,"Insufficient work space for xTREVC"); |
| LAPACKtrevc_(side,howmny,PETSC_NULL,&n,Sc,&n,pY,&ldpY,pX,&ldpX,&n,&nout,auxS,auxR,&info); |
| LAPACKtrevc_(side,howmny,PETSC_NULL,&n,S,&ldS,pY,&ldpY,pX,&ldpX,&n,&nout,auxS,auxR,&info); |
| #else |
| LAPACKtrevc_(side,howmny,PETSC_NULL,&n,Sc,&n,pY,&ldpY,pX,&ldpX,&n,&nout,auxS,&info); |
| if (size_auxS < 3*n) |
| SETERRQ(PETSC_COMM_SELF,PETSC_ERR_LIB,"Insufficient work space for xTREVC"); |
| LAPACKtrevc_(side,howmny,PETSC_NULL,&n,S,&ldS,pY,&ldpY,pX,&ldpX,&n,&nout,auxS,&info); |
| #endif |
| if (info) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error in Lapack xTREVC %d",info); |
| } |
| PetscErrorCode ierr; |
| PetscFunctionBegin; |
| PetscValidScalarPointer(w,4); |
| PetscValidScalarPointer(V,5); |
| n_ = PetscBLASIntCast(n); |
| /* selection sort */ |
| PetscInt cX_proj, PetscBool harm) |
| { |
| PetscErrorCode ierr; |
| PetscInt i; |
| PetscInt i,max_cS; |
| PetscBool std_probl,her_probl; |
| PetscFunctionBegin; |
| /* cS?, cT? */ |
| b->max_size_auxV = PetscMax(b->max_size_auxV, b->max_size_X); |
| /* updateV0 */ |
| max_cS = PetscMax(b->max_size_X,cX_proj); |
| b->max_size_auxS = PetscMax(PetscMax( |
| b->max_size_auxS, |
| b->max_size_X*b->max_size_proj*2*(!d->B?1:2) + /* updateAV1,BV1 */ |
| b->max_size_X*b->max_nev*(her_probl?0:(!d->B?1:2)) + /* updateV0,W0 */ |
| b->max_size_X*b->max_size_proj*2*(std_probl?1:2) + /* updateAV1,BV1 */ |
| max_cS*b->max_nev*(her_probl?0:(!d->B?1:2)) + /* updateV0,W0 */ |
| /* SlepcReduction: in */ |
| PetscMax( |
| b->max_size_X*b->max_size_proj*2*(!d->B?1:2) + /* updateAV1,BV1 */ |
| b->max_size_X*b->max_nev*(her_probl?0:(!d->B?1:2)), /* updateV0,W0 */ |
| b->max_size_X*b->max_size_proj*2*(std_probl?1:2) + /* updateAV1,BV1 */ |
| max_cS*b->max_nev*(her_probl?0:(!d->B?1:2)), /* updateV0,W0 */ |
| /* SlepcReduction: out */ |
| PetscMax( |
| b->max_size_proj*b->max_size_proj, /* updateAV0,BV0 */ |
| #define __FUNCT__ "dvd_calcpairs_qz_start" |
| PetscErrorCode dvd_calcpairs_qz_start(dvdDashboard *d) |
| { |
| PetscBool std_probl, her_probl; |
| PetscInt i; |
| PetscBool her_probl; |
| PetscInt i; |
| PetscFunctionBegin; |
| std_probl = DVD_IS(d->sEP, DVD_EP_STD)?PETSC_TRUE:PETSC_FALSE; |
| her_probl = DVD_IS(d->sEP, DVD_EP_HERMITIAN)?PETSC_TRUE:PETSC_FALSE; |
| d->size_V = 0; |
| d->size_cY = 0; |
| d->size_BcX = 0; |
| d->cX_in_V = d->cX_in_H = d->cX_in_G = d->cX_in_W = d->cX_in_AV = d->cX_in_BV = 0; |
| PetscFunctionReturn(0); |
| } |
| stdp = DVD_IS(d->sEP, DVD_EP_STD)?PETSC_TRUE:PETSC_FALSE; |
| size_in = |
| (d->size_cX+d->V_tra_s)*d->V_tra_s*(d->cT?2:(d->cS?1:0)) + /* updateV0,W0 */ |
| d->size_H*d->V_tra_e*(!stdp?2:1) + /* updateAV1,BV1 */ |
| (d->size_cX+d->V_tra_s-d->cX_in_H)*d->V_tra_s*(d->cT?2:(d->cS?1:0)) + /* updateV0,W0 */ |
| (d->size_H*(d->V_new_e-d->V_new_s)*2+ |
| (d->V_new_e-d->V_new_s)*(d->V_new_e-d->V_new_s))*(!stdp?2:1); /* updateAV0,BV0 */ |
| (d->V_new_e-d->V_new_s)*(d->V_new_e-d->V_new_s))*(!stdp?2:1); /* updateAV1,BV1 */ |
| out = in+size_in; |
| if (d->size_cS+d->V_tra_s != d->size_cX) { SETERRQ(PETSC_COMM_SELF,1, "Consistency broken!"); } |
| /* auxV <- AV * MTX(0:V_tra_e-1) */ |
| ierr = SlepcUpdateVectorsZ(d->auxV, 0.0, 1.0, d->AV-d->cX_in_AV, d->size_AV+d->cX_in_AV, d->MTX, d->ldMTX, d->size_MT, d->V_tra_s-d->max_cX_in_proj); CHKERRQ(ierr); |
| rm = d->size_cX>=d->nev?0:d->max_cX_in_proj; |
| ierr = SlepcUpdateVectorsZ(d->auxV, 0.0, 1.0, d->AV-d->cX_in_AV, d->size_AV+d->cX_in_AV, d->MTX, d->ldMTX, d->size_MT, d->V_tra_s-rm); CHKERRQ(ierr); |
| /* cS(:, size_cS:) <- cX' * auxV */ |
| rm = d->size_cX>=d->nev?0:d->max_cX_in_proj; |
| ierr = VecsMultS(&d->cS[d->ldcS*d->size_cS], 0, d->ldcS, d->cX, 0, d->size_cX-rm, d->auxV, 0, d->V_tra_s-rm, r, (*sr)++); CHKERRQ(ierr); |
| d->size_cS+= d->V_tra_s-rm; |
| } |
| /* auxV <- AV * MTX(0:V_tra_e-1) */ |
| rm = d->size_cX>=d->nev?0:d->max_cX_in_proj; |
| ierr = SlepcUpdateVectorsZ(d->auxV, 0.0, 1.0, d->AV-d->cX_in_H, d->size_AV-d->cX_in_H, d->MTX, d->ldMTX, d->size_MT, d->V_tra_s-d->max_cX_in_proj); CHKERRQ(ierr); |
| ierr = SlepcUpdateVectorsZ(d->auxV, 0.0, 1.0, d->AV-d->cX_in_H, d->size_AV-d->cX_in_H, d->MTX, d->ldMTX, d->size_MT, d->V_tra_s-rm); CHKERRQ(ierr); |
| /* cS(:, size_cS:) <- cY' * auxV */ |
| ierr = VecsMultS(&d->cS[d->ldcS*d->size_cS], 0, d->ldcS, d->cY, 0, d->size_cY-rm, d->auxV, 0, d->V_tra_s-rm, r, (*sr)++); CHKERRQ(ierr); |
| /* auxV <- BV * MTX(0:V_tra_e-1) */ |
| ierr = SlepcUpdateVectorsZ(d->auxV, 0.0, 1.0, d->BV-d->cX_in_H, d->size_BV-d->cX_in_H, d->MTX, d->ldMTX, d->size_MT, d->V_tra_s-d->max_cX_in_proj); CHKERRQ(ierr); |
| ierr = SlepcUpdateVectorsZ(d->auxV, 0.0, 1.0, d->BV-d->cX_in_H, d->size_BV-d->cX_in_H, d->MTX, d->ldMTX, d->size_MT, d->V_tra_s-rm); CHKERRQ(ierr); |
| /* cT(:, size_cS:) <- cY' * auxV */ |
| ierr = VecsMultS(&d->cT[d->ldcS*d->size_cS], 0, d->ldcS, d->cY, 0, d->size_cY-rm, d->auxV, 0, d->V_tra_s-rm, r, (*sr)++); CHKERRQ(ierr); |
| d->size_cS+= d->V_tra_s-rm; |
| d->size_cT+= d->V_tra_s-rm; |
| } |
| { |
| PetscErrorCode ierr; |
| PetscScalar *MTY = d->W?d->MTY:d->MTX; |
| PetscInt cMT, tra_s, rm, cp; |
| PetscInt cMT, tra_s; |
| PetscFunctionBegin; |
| ierr = dvd_calcpairs_updateBV0_gen(d,d->real_AV,PETSC_NULL,&d->AV,&d->size_AV,&d->max_size_AV,PETSC_FALSE,&d->cX_in_AV,d->MTX);CHKERRQ(ierr); |
| tra_s = PetscMax(d->V_tra_s-d->max_cX_in_proj, 0); |
| cMT = d->V_tra_e - tra_s; |
| rm = d->V_tra_s - tra_s; |
| cp = PetscMin(d->max_cX_in_proj - rm, d->cX_in_H); |
| /* Update H <- MTY(tra_s)' * (H * MTX(tra_s:)) */ |
| ierr = SlepcDenseMatProdTriang(d->auxS, 0, d->ldH, d->H, d->sH, d->ldH, d->size_H, d->size_H, PETSC_FALSE, &d->MTX[d->ldMTX*tra_s], 0, d->ldMTX, d->size_MT, cMT, PETSC_FALSE); CHKERRQ(ierr); |
| ierr = SlepcDenseMatProdTriang(d->H, d->sH, d->ldH, &MTY[d->ldMTX*tra_s], 0, d->ldMTX, d->size_MT, cMT, PETSC_TRUE, d->auxS, 0, d->ldH, d->size_H, cMT, PETSC_FALSE); CHKERRQ(ierr); |
| d->size_H = cMT; |
| d->cX_in_H = cp+rm; |
| d->cX_in_H = d->cX_in_AV; |
| PetscFunctionReturn(0); |
| } |
| { |
| PetscErrorCode ierr; |
| PetscScalar *MTY = d->W?d->MTY:d->MTX; |
| PetscInt cMT, rm, cp, tra_s, i; |
| PetscInt cMT, tra_s, i; |
| PetscBool lindep; |
| PetscReal norm; |
| if (d->G) { |
| tra_s = PetscMax(d->V_tra_s-d->max_cX_in_proj, 0); |
| cMT = d->V_tra_e - tra_s; |
| rm = d->V_tra_s - tra_s; |
| cp = PetscMin(d->max_cX_in_proj - rm, d->cX_in_G); |
| ierr = SlepcDenseMatProdTriang(d->auxS, 0, d->ldH, d->G, d->sG, d->ldH, d->size_G, d->size_G, PETSC_FALSE, &d->MTX[d->ldMTX*tra_s], 0, d->ldMTX, d->size_MT, cMT, PETSC_FALSE); CHKERRQ(ierr); |
| ierr = SlepcDenseMatProdTriang(d->G, d->sG, d->ldH, &MTY[d->ldMTX*tra_s], 0, d->ldMTX, d->size_MT, cMT, PETSC_TRUE, d->auxS, 0, d->ldH, d->size_G, cMT, PETSC_FALSE); CHKERRQ(ierr); |
| d->size_G = cMT; |
| d->cX_in_G = cp+rm; |
| d->cX_in_G = d->cX_in_V; |
| } |
| PetscFunctionReturn(0); |
| PetscBLASInt info,n,a; |
| PetscFunctionBegin; |
| if (d->pY) { PetscValidScalarPointer(d->pY,0); } |
| PetscValidScalarPointer(d->S,0); |
| PetscValidScalarPointer(d->T,0); |
| PetscValidScalarPointer(d->eigr,0); |
| PetscValidScalarPointer(d->eigi,0); |
| PetscValidScalarPointer(d->auxS,0); |
| /* S <- H, T <- G */ |
| d->ldS = d->ldT = d->ldpX = d->ldpY = d->size_H; |
| ierr = SlepcDenseCopyTriang(d->S, 0, d->size_H, d->H, d->sH, d->ldH, |
| allResiduals; /* if computing all the residuals */ |
| } dvdManagV_basic; |
| #define _Ceil(A,B) ((A)/(B)+((A)%(B)==0?0:1)) |
| #define FromRealToScalar(S) ((PetscInt)_Ceil((S)*sizeof(PetscReal),sizeof(PetscScalar))) |
| #undef __FUNCT__ |
| #define __FUNCT__ "dvd_managementV_basic" |
| PetscErrorCode dvd_managementV_basic(dvdDashboard *d, dvdBlackboard *b, |
| { |
| PetscErrorCode ierr; |
| dvdManagV_basic *data; |
| #if !defined(PETSC_USE_COMPLEX) |
| PetscBool her_probl, std_probl; |
| #endif |
| PetscFunctionBegin; |
| her_probl = DVD_IS(d->sEP, DVD_EP_HERMITIAN)?PETSC_TRUE:PETSC_FALSE; |
| std_probl = DVD_IS(d->sEP, DVD_EP_STD)?PETSC_TRUE:PETSC_FALSE; |
| /* Setting configuration constrains */ |
| #if !defined(PETSC_USE_COMPLEX) |
| /* if the last converged eigenvalue is complex its conjugate pair is also |
| converged */ |
| her_probl = DVD_IS(d->sEP, DVD_EP_HERMITIAN)?PETSC_TRUE:PETSC_FALSE; |
| std_probl = DVD_IS(d->sEP, DVD_EP_STD)?PETSC_TRUE:PETSC_FALSE; |
| b->max_size_X = PetscMax(b->max_size_X, bs+(her_probl && std_probl)?0:1); |
| #else |
| b->max_size_X = PetscMax(b->max_size_X, bs); |
| d->size_real_eigr = b->size_V; |
| d->real_eigr = b->free_scalars; b->free_scalars+= b->size_V; |
| d->real_eigi = b->free_scalars; b->free_scalars+= b->size_V; |
| d->real_nR = (PetscReal*)b->free_scalars; |
| b->free_scalars = (PetscScalar*)(d->real_nR + b->size_V); |
| d->real_nX = (PetscReal*)b->free_scalars; |
| b->free_scalars = (PetscScalar*)(d->real_nX + b->size_V); |
| d->real_errest = (PetscReal*)b->free_scalars; |
| b->free_scalars = (PetscScalar*)(d->real_errest + b->size_V); |
| d->real_nR = (PetscReal*)b->free_scalars; b->free_scalars+= FromRealToScalar(b->size_V); |
| d->real_nX = (PetscReal*)b->free_scalars; b->free_scalars+= FromRealToScalar(b->size_V); |
| d->real_errest = (PetscReal*)b->free_scalars; b->free_scalars+= FromRealToScalar(b->size_V); |
| d->MTX = b->free_scalars; b->free_scalars+= b->max_size_V*b->max_size_V; |
| if (plusk > 0) { |
| data->oldU = b->free_scalars; b->free_scalars+= b->max_size_V*b->max_size_V; |
| DVD_FL_ADD(d->endList, dvd_updateV_conv_finish); |
| DVD_FL_ADD(d->destroyList, dvd_managementV_basic_d); |
| } |
| PetscFunctionReturn(0); |
| } |
| /* Notify the changes in V and update the other subspaces */ |
| d->V_tra_s = d->cX_in_H; d->V_tra_e = cMTX; |
| d->V_new_s = d->V_tra_e-d->cX_in_H; d->V_new_e = d->V_tra_e; |
| d->V_new_s = d->V_tra_e-d->cX_in_H; d->V_new_e = d->V_new_s; |
| /* Remove oldU */ |
| data->size_oldU = 0; |
| FromIntToScalar(size_P) + /* iXkZPivots */ |
| PetscMax(PetscMax( |
| 3*b->max_size_proj*b->max_size_X, /* dvd_improvex_apply_proj */ |
| 8*cX_impr*b->max_size_X), |
| /* dvd_improvex_jd_proj_cuv_KZX */ |
| (herm?0:1)*11*b->max_size_proj+4*b->max_size_proj*b->max_size_proj)); |
| /* dvd_improvex_get_eigenvectors */ |
| 8*cX_impr*b->max_size_X), /* dvd_improvex_jd_proj_cuv_KZX */ |
| (herm?0:1)*6*b->max_size_proj)); /* dvd_improvex_get_eigenvectors */ |
| b->own_vecs+= size_P; /* KZ */ |
| /* Setup the preconditioner */ |
| { |
| dvdImprovex_jd *data = (dvdImprovex_jd*)d->improveX_data; |
| PetscErrorCode ierr; |
| PetscInt i, j, n, maxits, maxits0, lits, s; |
| PetscInt i, j, n, maxits, maxits0, lits, s, ldpX; |
| PetscScalar *pX, *pY, *auxS = d->auxS, *auxS0; |
| PetscReal tol, tol0; |
| Vec *u, *v, *kr, kr_comp, D_comp; |
| /* Compute the eigenvectors of the selected pairs */ |
| if (DVD_IS(d->sEP, DVD_EP_HERMITIAN)) { |
| pX = pY = d->pX; |
| pX = d->pX; |
| pY = d->pY?d->pY:d->pX; |
| ldpX = d->ldpX; |
| } else { |
| pX = auxS; auxS+= d->size_H*d->size_H; |
| pY = auxS; auxS+= d->size_H*d->size_H; |
| ierr = dvd_improvex_get_eigenvectors(d, pX, pY, d->size_H, auxS, |
| d->size_auxS-(auxS-d->auxS)); |
| CHKERRQ(ierr); |
| ldpX = d->size_H; |
| } |
| /* Restart lastTol if a new pair converged */ |
| /* Compute u, v and kr */ |
| ierr = dvd_improvex_jd_proj_cuv(d, r_s+i, r_s+i+s, &u, &v, kr, |
| &data->auxV, &auxS, data->theta, data->thetai, |
| &pX[d->size_H*(r_s+i+d->cX_in_H)], &pY[d->size_H*(r_s+i+d->cX_in_H)], d->size_H); |
| &pX[d->size_H*(r_s+i+d->cX_in_H)], &pY[d->size_H*(r_s+i+d->cX_in_H)], ldpX); |
| CHKERRQ(ierr); |
| data->u = u; |
| /* XKZ <- X'*KZ */ |
| size_KZ = data->size_KZ+n; |
| wS0 = *auxS; wS1 = wS0+2*n*data->size_KZ+n*n; |
| ierr = VecsMult(data->XKZ, 0, data->ldXKZ, d->V-data->size_KZ, 0, data->size_KZ, data->KZ, 0, size_KZ, wS0, wS1);CHKERRQ(ierr); |
| ierr = VecsMult(data->XKZ, 0, data->ldXKZ, d->V-data->size_KZ, 0, data->size_KZ, data->KZ, data->size_KZ, size_KZ, wS0, wS1);CHKERRQ(ierr); |
| ierr = VecsMult(&data->XKZ[data->size_KZ], 0, data->ldXKZ, *u, 0, n, data->KZ, 0, size_KZ, wS0, wS1);CHKERRQ(ierr); |
| /* iXKZ <- inv(XKZ) */ |
| } |
| #endif |
| #if !defined(PETSC_USE_COMPLEX) |
| #define DVD_NORM_FOR_UV(x) PetscAbsScalar(x) |
| #else |
| #define DVD_NORM_FOR_UV(x) (x) |
| #endif |
| #define DVD_NORMALIZE_UV(u,v,ierr,a) { \ |
| (ierr) = VecDot((u), (v), &(a)); CHKERRQ(ierr); \ |
| if ((a) == 0.0) { \ |
| SETERRQ(((PetscObject)u)->comm,1, "Inappropriate approximate eigenvector norm"); \ |
| } \ |
| if ((u) == (v)) { \ |
| ierr = VecScale((u), 1.0/PetscSqrtScalar(DVD_NORM_FOR_UV(a))); \ |
| CHKERRQ(ierr); \ |
| } else { \ |
| ierr = VecScale((u), 1.0/(a)); CHKERRQ(ierr); \ |
| } \ |
| } |
| #undef __FUNCT__ |
| #define __FUNCT__ "dvd_improvex_jd_proj_uv_KZX" |
| /* |
| for (i=0; i<n; i++) { |
| ierr = VecNormEnd(u[i], NORM_2, &d->nX[i_s+i]);CHKERRQ(ierr); |
| } |
| #if !defined(PETSC_USE_COMPLEX) |
| for(i=0; i<n; i++) |
| if(d->eigi[i_s+i] != 0.0) |
| d->nX[i_s+i] = d->nX[i_s+i+1] = PetscSqrtScalar(d->nX[i_s+i]*d->nX[i_s+i]+d->nX[i_s+i+1]*d->nX[i_s+i+1]); |
| #endif |
| } else { |
| for (i=0; i<n; i++) d->nX[i_s+i] = 1.0; |
| } |
| /* Bx <- B*X(i) */ |
| Bx = kr; |
| for(i=i_s; i<i_e; i++) d->nX[i] = 1.0; |
| if (d->BV) { |
| ierr = SlepcUpdateVectorsZ(Bx, 0.0, 1.0, d->BV-d->cX_in_H, d->size_BV+d->cX_in_H, pX, ld, d->size_H, n); CHKERRQ(ierr); |
| } else { |
| b[2] = b[7] = -theta[2*i+1]; |
| b[6] = -(b[3] = thetai[i]); |
| b[1] = b[4] = 0.0; |
| b[8] = b[13] = 1.0; |
| b[10] = b[15] = -d->eigr[i_s+i]; |
| b[14] = -(b[11] = d->eigi[i_s+i]); |
| b[8] = b[13] = 1.0/d->nX[i_s+i]; |
| b[10] = b[15] = -d->eigr[i_s+i]/d->nX[i_s+i]; |
| b[14] = -(b[11] = d->eigi[i_s+i]/d->nX[i_s+i]); |
| b[9] = b[12] = 0.0; |
| X[0] = Ax[i]; X[1] = Ax[i+1]; X[2] = Bx[i]; X[3] = Bx[i+1]; |
| ierr = SlepcUpdateVectorsD(X, 4, 1.0, b, 4, 4, 4, Z, size_Z); |
| CHKERRQ(ierr); |
| } |
| } |
| for (i=0; i<n; i++) d->nX[i_s+i] = 1.0; |
| /* v <- K^{-1} r = K^{-1}(theta_2i'*Ax + theta_2i+1*Bx) */ |
| for(i=0; i<n; i++) { |
| CHKERRQ(ierr); |
| /* 2-Normalize the columns of pX an pY */ |
| ierr = SlepcDenseNorm(pX, ld, d->size_H, d->size_H, d->eigi); CHKERRQ(ierr); |
| ierr = SlepcDenseNorm(pY, ld, d->size_H, d->size_H, d->eigi); CHKERRQ(ierr); |
| ierr = SlepcDenseNorm(pX, ld, d->size_H, d->size_H, d->eigi-d->cX_in_H); CHKERRQ(ierr); |
| ierr = SlepcDenseNorm(pY, ld, d->size_H, d->size_H, d->eigi-d->cX_in_H); CHKERRQ(ierr); |
| PetscFunctionReturn(0); |
| } |
| cV_ = PetscBLASIntCast(cV); |
| n = PetscBLASIntCast(data->size_iXKZ); |
| ld = PetscBLASIntCast(data->ldiXKZ); |
| PetscValidScalarPointer(data->iXKZ,0); |
| LAPACKgetrs_("N", &n, &cV_, data->iXKZ, &ld, data->iXKZPivots, h, &n, &info); |
| if (info) SETERRQ1(PETSC_COMM_WORLD,PETSC_ERR_LIB, "Error in Lapack XGETRS %d", info); |
| /* Setup the presence of converged vectors in the projected problem and in the projector */ |
| ierr = EPSDavidsonGetWindowSizes_Davidson(eps,&cX_in_impr,&cX_in_proj);CHKERRQ(ierr); |
| if (min_size_V <= cX_in_proj) { |
| SETERRQ(((PetscObject)eps)->comm,PETSC_ERR_SUP,"minv has to be greater than qwindow"); |
| } |
| if (bs > 1 && cX_in_impr > 0) { |
| SETERRQ(((PetscObject)eps)->comm,PETSC_ERR_SUP,"Unsupported option: pwindow > 0 and bs > 1"); |
| } |
| /* Setup IP */ |
| if (ipB && dvd->B) { |
| EPS_DAVIDSON *data = (EPS_DAVIDSON*)eps->data; |
| dvdDashboard *d = &data->ddb; |
| PetscScalar *pX,*auxS; |
| PetscInt size_auxS; |
| PetscInt size_auxS,i,j; |
| PetscFunctionBegin; |
| if (d->cS) { |
| /* Compute the eigenvectors associated to (cS, cT) */ |
| ierr = PetscMalloc(sizeof(PetscScalar)*d->nconv*d->nconv,&pX);CHKERRQ(ierr); |
| size_auxS = 11*d->nconv + 4*d->nconv*d->nconv; |
| size_auxS = 6*d->nconv; |
| ierr = PetscMalloc(sizeof(PetscScalar)*size_auxS,&auxS);CHKERRQ(ierr); |
| #if defined(PETSC_USE_COMPLEX) |
| for (i=0; i<d->nconv; i++) { |
| for (j=i+1; j<d->nconv; j++) { |
| d->cS[d->ldcS*i+j] = 0.0; |
| if (d->cT) d->cT[d->ldcS*i+j] = 0.0; |
| } |
| } |
| #else |
| for (i=0; i<d->nconv; i++) { |
| if (d->cS[d->ldcS*i+i+1] != 0.0 && d->ceigi[i] != 0.0) { |
| for (j=i+2; j<d->nconv; j++) d->cS[d->ldcS*i+j] = 0.0; |
| for (j=i+2; j<d->nconv; j++) d->cS[d->ldcS*(i+1)+j] = 0.0; |
| if (d->cT) { |
| d->cT[d->ldcS*(i+1)+i] = 0.0; |
| for (j=i+1; j<d->nconv; j++) d->cT[d->ldcS*i+j] = 0.0; |
| for (j=i+2; j<d->nconv; j++) d->cT[d->ldcS*(i+1)+j] = 0.0; |
| } |
| i++; |
| } else { |
| for (j=i+1; j<d->nconv; j++) { |
| d->cS[d->ldcS*i+j] = 0.0; |
| if (d->cT) d->cT[d->ldcS*i+j] = 0.0; |
| } |
| } |
| } |
| #endif |
| ierr = dvd_compute_eigenvectors(d->nconv,d->cS,d->ldcS,d->cT,d->ldcT, |
| pX,d->nconv,PETSC_NULL,0,auxS, |
| size_auxS,PETSC_FALSE);CHKERRQ(ierr); |
| PetscFunctionBegin; |
| /* Load the Davidson solver */ |
| ierr = EPSCreate_Davidson(eps);CHKERRQ(ierr); |
| ierr = EPSDavidsonSetFix_Davidson(eps,0.0);CHKERRQ(ierr); |
| /* Overload the GD properties */ |
| eps->ops->setfromoptions = EPSSetFromOptions_GD; |
| . initialsize - number of vectors of the initial searching subspace |
| Notes: |
| If EPSGDGetKrylovStart is PETSC_FALSE and the user provides vectors with |
| EPSSetInitialSpace, up to initialsize vectors will be used; and if the |
| If EPSGDGetKrylovStart() is PETSC_FALSE and the user provides vectors with |
| EPSSetInitialSpace(), up to initialsize vectors will be used; and if the |
| provided vectors are not enough, the solver completes the subspace with |
| random vectors. In the case of EPSGDGetKrylovStart being PETSC_TRUE, the solver |
| random vectors. In the case of EPSGDGetKrylovStart() being PETSC_TRUE, the solver |
| gets the first vector provided by the user or, if not available, a random vector, |
| and expands the Krylov basis up to initialsize vectors. |
| . -eps_gd_initial_size - number of vectors of the initial searching subspace |
| Notes: |
| If EPSGDGetKrylovStart is PETSC_FALSE and the user provides vectors with |
| EPSSetInitialSpace, up to initialsize vectors will be used; and if the |
| If EPSGDGetKrylovStart() is PETSC_FALSE and the user provides vectors with |
| EPSSetInitialSpace(), up to initialsize vectors will be used; and if the |
| provided vectors are not enough, the solver completes the subspace with |
| random vectors. In the case of EPSGDGetKrylovStart being PETSC_TRUE, the solver |
| random vectors. In the case of EPSGDGetKrylovStart() being PETSC_TRUE, the solver |
| gets the first vector provided by the user or, if not available, a random vector, |
| and expands the Krylov basis up to initialsize vectors. |
| */ |
| #include <private/epsimpl.h> /*I "slepceps.h" I*/ |
| #include <private/stimpl.h> /*I "slepcst.h" I*/ |
| #include <../src/eps/impls/davidson/common/davidson.h> |
| #include <slepcblaslapack.h> |
| PetscErrorCode EPSSetUp_JD(EPS eps); |
| PetscErrorCode EPSDestroy_JD(EPS eps); |
| . initialsize - number of vectors of the initial searching subspace |
| Notes: |
| If EPSGDGetKrylovStart is PETSC_FALSE and the user provides vectors with |
| EPSSetInitialSpace, up to initialsize vectors will be used; and if the |
| If EPSGDGetKrylovStart() is PETSC_FALSE and the user provides vectors with |
| EPSSetInitialSpace(), up to initialsize vectors will be used; and if the |
| provided vectors are not enough, the solver completes the subspace with |
| random vectors. In the case of EPSGDGetKrylovStart being PETSC_TRUE, the solver |
| random vectors. In the case of EPSGDGetKrylovStart() being PETSC_TRUE, the solver |
| gets the first vector provided by the user or, if not available, a random vector, |
| and expands the Krylov basis up to initialsize vectors. |
| . -eps_jd_initial_size - number of vectors of the initial searching subspace |
| Notes: |
| If EPSGDGetKrylovStart is PETSC_FALSE and the user provides vectors with |
| EPSSetInitialSpace, up to initialsize vectors will be used; and if the |
| If EPSGDGetKrylovStart() is PETSC_FALSE and the user provides vectors with |
| EPSSetInitialSpace(), up to initialsize vectors will be used; and if the |
| provided vectors are not enough, the solver completes the subspace with |
| random vectors. In the case of EPSGDGetKrylovStart being PETSC_TRUE, the solver |
| random vectors. In the case of EPSGDGetKrylovStart() being PETSC_TRUE, the solver |
| gets the first vector provided by the user or, if not available, a random vector, |
| and expands the Krylov basis up to initialsize vectors. |
| #undef __FUNCT__ |
| #define __FUNCT__ "EPSJDSetConstantCorrectionTolerance" |
| /*@ |
| EPSJDSetConstantCorrectionTolerance - If true, deactivates the dynamic stopping criterion (also called Newton) that sets the KSP relative tolerance |
| EPSJDSetConstantCorrectionTolerance - If true, deactivates the dynamic stopping criterion |
| (also called Newton) that sets the KSP relative tolerance |
| to 0.5**i, where i is the number of EPS iterations from the last converged value. |
| Logically Collective on EPS |
| synopsis %n<PRE>%1</PRE> |
| definition %n<B>%1</B>%n |
| section %n<H3><FONT COLOR="#883300">%1</FONT></H3>%n |
| s_synopsis %n<H3><FONT COLOR="#663300">Synopsis</FONT></H3>%n<PRE>%n |
| s_synopsis %n<H3><FONT COLOR="#883300">Synopsis</FONT></H3>%n<PRE>%n |
| e_synopsis %n</PRE>%n |
| em_dash |
| eop %n</BODY></HTML>%n |
| e_caption </B></CENTER> |
| picture <A IMG="%1"></A> |
| # If the location variable is changed, then maint/exampleindex.tcl MUST be changed accordingly! |
| location <P><B><FONT COLOR="#663300">Location: </FONT></B><A HREF="../../../%1#%rq0">%1</A> |
| location <P><B><FONT COLOR="#883300">Location: </FONT></B><A HREF="../../../%1#%rq0">%1</A> |
| # Only do the actual title |
| # Without a title, the page will be broken. |
| mantitle <TITLE>%1</TITLE>%n</HEAD>%n<BODY BGCOLOR="FFFFFF">%n<font face="Arial, Helvetica, sans-serif" size="2">%n<H1>%1</H1>%n |
| dependent on the solution method and the number of singular values required. |
| The parameters ncv and mpd are intimately related, so that the user is advised |
| to set one of them at most. Normal usage is the following: |
| (a) In cases where nsv is small, the user sets ncv (a reasonable default is 2*nsv). |
| (b) In cases where nsv is large, the user sets mpd. |
| to set one of them at most. Normal usage is that |
| (a) in cases where nsv is small, the user sets ncv (a reasonable default is 2*nsv); and |
| (b) in cases where nsv is large, the user sets mpd. |
| The value of ncv should always be between nsv and (nsv+mpd), typically |
| ncv=nsv+mpd. If nev is not too large, mpd=nsv is a reasonable choice, otherwise |
| PetscFunctionBegin; |
| PetscValidHeaderSpecific(svd,SVD_CLASSID,1); |
| if (!svd->ip) { ierr = SVDGetIP(svd,&svd->ip);CHKERRQ(ierr); } |
| ierr = IPSetOptionsPrefix(svd->ip,prefix);CHKERRQ(ierr); |
| ierr = PetscObjectSetOptionsPrefix((PetscObject)svd,prefix);CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)svd,SVDCROSS,&flg1);CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)svd,SVDCYCLIC,&flg2);CHKERRQ(ierr); |
| PetscFunctionBegin; |
| PetscValidHeaderSpecific(svd,SVD_CLASSID,1); |
| if (!svd->ip) { ierr = SVDGetIP(svd,&svd->ip);CHKERRQ(ierr); } |
| ierr = IPSetOptionsPrefix(svd->ip,prefix);CHKERRQ(ierr); |
| ierr = PetscObjectAppendOptionsPrefix((PetscObject)svd,prefix);CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)svd,SVDCROSS,&flg1);CHKERRQ(ierr); |
| ierr = PetscTypeCompare((PetscObject)svd,SVDCYCLIC,&flg2);CHKERRQ(ierr); |
| Level: intermediate |
| .seealso: SVDMonitorFirst(), SVDMonitorAll(), SVDMonitorLG(), SVDMonitorLGAll(), SVDMonitorCancel() |
| .seealso: SVDMonitorFirst(), SVDMonitorAll(), SVDMonitorCancel() |
| @*/ |
| PetscErrorCode SVDMonitorSet(SVD svd,PetscErrorCode (*monitor)(SVD,PetscInt,PetscInt,PetscReal*,PetscReal*,PetscInt,void*),void *mctx,PetscErrorCode (*monitordestroy)(void**)) |
| { |
| */ |
| #include <private/svdimpl.h> /*I "slepcsvd.h" I*/ |
| #include <private/ipimpl.h> /*I "slepcip.h" I*/ |
| #include <private/ipimpl.h> |
| #undef __FUNCT__ |
| #define __FUNCT__ "SVDSetOperator" |
| */ |
| #include <private/svdimpl.h> /*I "slepcsvd.h" I*/ |
| #include <private/ipimpl.h> /*I "slepcip.h" I*/ |
| #include <private/ipimpl.h> |
| #include <slepcblaslapack.h> |
| typedef struct { |
| */ |
| #include <private/svdimpl.h> /*I "slepcsvd.h" I*/ |
| #include <private/ipimpl.h> /*I "slepcip.h" I*/ |
| #include <private/ipimpl.h> |
| #include <slepcblaslapack.h> |
| typedef struct { |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| */ |
| #include "private/vecimpl.h" /*I "petscvec.h" I*/ |
| #include <private/vecimplslepc.h> /*I "slepcvec.h" I*/ |
| #include "veccomp0.h" |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| */ |
| #include <slepcsys.h> /*I "slepcsys.h" I*/ |
| #include <private/slepcimpl.h> /*I "slepcsys.h" I*/ |
| #undef __FUNCT__ |
| #define __FUNCT__ "SlepcMatConvertSeqDense" |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| */ |
| #include <slepcsys.h> |
| #include <private/epsimpl.h> /*I "slepceps.h" I*/ |
| #include <private/stimpl.h> /*I "slepcst.h" I*/ |
| #include <private/svdimpl.h> /*I "slepcsvd.h" I*/ |
| #include <private/qepimpl.h> /*I "slepcqep.h" I*/ |
| #include <private/ipimpl.h> /*I "slepcip.h" I*/ |
| #include <private/slepcimpl.h> /*I "slepcsys.h" I*/ |
| #include <private/epsimpl.h> |
| #include <private/stimpl.h> |
| #include <private/svdimpl.h> |
| #include <private/qepimpl.h> |
| #include <private/ipimpl.h> |
| #include <private/vecimplslepc.h> |
| #include <stdlib.h> |
| #include <slepcvec.h> |
| #undef __FUNCT__ |
| #define __FUNCT__ "SlepcPrintVersion" |
| -@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap |
| -${OMAKE} ACTION=slepc_manualpages tree_basic LOC=${LOC} |
| -${PYTHON} ${PETSC_DIR}/bin/maint/wwwindex.py ${SLEPC_DIR} ${LOC} |
| -${OMAKE} ACTION=manexamples tree_basic LOC=${LOC} |
| -${OMAKE} ACTION=slepc_manexamples tree_basic LOC=${LOC} |
| # Builds .html versions of the source |
| alldoc2: chk_loc |