Subversion Repositories slepc-dev

Rev

Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2431 Rev 2580
Line 1... Line 1...
%%
%%
%
%
%  Solves a standard eigenvalue problem with SLEPc
%  Solves a standard eigenvalue problem with SLEPc
%  User creates directly a PETSc Mat
%  User creates directly a PETSc Mat
%
%
 
 
 
%  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
%  SLEPc - Scalable Library for Eigenvalue Problem Computations
 
%  Copyright (c) 2002-2011, Universitat Politecnica de Valencia, Spain
 
%
 
%  This file is part of SLEPc.
 
%    
 
%  SLEPc is free software: you can redistribute it and/or modify it under  the
 
%  terms of version 3 of the GNU Lesser General Public License as published by
 
%  the Free Software Foundation.
 
%
 
%  SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
 
%  WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
 
%  FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
 
%  more details.
 
%
 
%  You  should have received a copy of the GNU Lesser General  Public  License
 
%  along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
 
%  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 
%%
%%
%  Set the Matlab path and initialize SLEPc
%  Set the Matlab path and initialize SLEPc
%
%
path(path,'../../')
path(path,'../../')
Line 31... Line 50...
  mat.SetValues(i.html">i+1,i.html">i,-1.0);
  mat.SetValues(i.html">i+1,i.html">i,-1.0);
  mat.SetValues(i.html">i,i.html">i+1,-1.0);
  mat.SetValues(i.html">i,i.html">i+1,-1.0);
end
end
mat.AssemblyBegin(PetscMat.FINAL_ASSEMBLY);
mat.AssemblyBegin(PetscMat.FINAL_ASSEMBLY);
mat.AssemblyEnd(PetscMat.FINAL_ASSEMBLY);
mat.AssemblyEnd(PetscMat.FINAL_ASSEMBLY);
%mat.View;
 
 
 
%%
%%
%  Create the eigensolver, pass the matrix and solve the problem
%  Create the eigensolver, pass the matrix and solve the problem
%
%
eps = SlepcEPS();
eps = SlepcEPS();
Line 54... Line 72...
    fprintf('    %12f        %12g\n',lambda,relerr)
    fprintf('    %12f        %12g\n',lambda,relerr)
  else
  else
    fprintf('  %12f%+12f      %12g\n',real(lambda),imag(lambda),relerr)
    fprintf('  %12f%+12f      %12g\n',real(lambda),imag(lambda),relerr)
  end
  end
end
end
%eps.View();
 
 
 
%%
%%
%   Free objects and shutdown SLEPc
%   Free objects and shutdown SLEPc
%
%
mat.Destroy();
mat.Destroy();