class SolverBase
{
public:
- /**
- * Declare type for container size.
- */
- typedef types::global_dof_index size_type;
-
/**
* Constructor. Takes the MPI communicator over which parallel
* computations are to happen.
solve (const PETScWrappers::MatrixBase &A,
std::vector<double> &eigenvalues,
std::vector<OutputVector> &eigenvectors,
- const size_type n_eigenpairs = 1);
+ const unsigned int n_eigenpairs = 1);
/**
* Same as above, but here a composite method for solving the
const PETScWrappers::MatrixBase &B,
std::vector<double> &eigenvalues,
std::vector<OutputVector> &eigenvectors,
- const size_type n_eigenpairs = 1);
+ const unsigned int n_eigenpairs = 1);
/**
* Same as above, but here a composite method for solving the
/**
* Solve the linear system for <code>n_eigenpairs</code>
* eigenstates. Parameter <code>n_converged</code> contains the
- * actual number of eigenstates that have . converged; this can
+ * actual number of eigenstates that have converged; this can
* be both fewer or more than n_eigenpairs, depending on the
* SLEPc eigensolver used.
*/
void
- solve (const unsigned int n_eigenpairs, unsigned int *n_converged);
+ solve (const unsigned int n_eigenpairs,
+ unsigned int *n_converged);
/**
* Access the real parts of solutions for a solved eigenvector
SolverBase::solve (const PETScWrappers::MatrixBase &A,
std::vector<double> &eigenvalues,
std::vector<OutputVector> &eigenvectors,
- const size_type n_eigenpairs)
+ const unsigned int n_eigenpairs)
{
// Panic if the number of eigenpairs wanted is out of bounds.
AssertThrow ((n_eigenpairs > 0) && (n_eigenpairs <= A.m ()),
set_matrices (A);
// and solve
- size_type n_converged = 0;
+ unsigned int n_converged = 0;
solve (n_eigenpairs, &n_converged);
if (n_converged > n_eigenpairs)
eigenvectors.resize (n_converged, eigenvectors.front());
eigenvalues.resize (n_converged);
- for (size_type index=0; index<n_converged; ++index)
+ for (unsigned int index=0; index<n_converged; ++index)
get_eigenpair (index, eigenvalues[index], eigenvectors[index]);
}
const PETScWrappers::MatrixBase &B,
std::vector<double> &eigenvalues,
std::vector<OutputVector> &eigenvectors,
- const size_type n_eigenpairs)
+ const unsigned int n_eigenpairs)
{
// Guard against incompatible matrix sizes:
AssertThrow (A.m() == B.m (), ExcDimensionMismatch(A.m(), B.m()));
set_matrices (A, B);
// and solve
- size_type n_converged = 0;
+ unsigned int n_converged = 0;
solve (n_eigenpairs, &n_converged);
if (n_converged>=n_eigenpairs)
eigenvectors.resize (n_converged, eigenvectors.front());
eigenvalues.resize (n_converged);
- for (size_type index=0; index<n_converged; ++index)
+ for (unsigned int index=0; index<n_converged; ++index)
get_eigenpair (index, eigenvalues[index], eigenvectors[index]);
}
std::vector<double> &imag_eigenvalues,
std::vector<OutputVector> &real_eigenvectors,
std::vector<OutputVector> &imag_eigenvectors,
- const size_type n_eigenpairs)
+ const unsigned int n_eigenpairs)
{
// Guard against incompatible matrix sizes:
AssertThrow (A.m() == B.m (), ExcDimensionMismatch(A.m(), B.m()));
set_matrices (A, B);
// and solve
- size_type n_converged = 0;
+ unsigned int n_converged = 0;
solve (n_eigenpairs, &n_converged);
if (n_converged>=n_eigenpairs)
real_eigenvalues.resize (n_converged);
imag_eigenvalues.resize (n_converged);
- for (size_type index=0; index<n_converged; ++index)
+ for (unsigned int index=0; index<n_converged; ++index)
get_eigenpair (index,
real_eigenvalues[index], imag_eigenvalues[index],
real_eigenvectors[index], imag_eigenvectors[index]);