46 #include "Epetra_config.h"
62 int main(
int argc,
char *argv[]) {
64 MPI_Init(&argc,&argv);
73 std::cout << Comm << std::endl;
76 std::cout <<
"Usage: " << argv[0] <<
" number_of_equations" << std::endl;
79 int NumGlobalElements = atoi(argv[1]);
91 for (
int i=0; i<NumMyElements; i++) {
92 int RowIndex = Map.
GID(i);
93 ColIndices[0] = RowIndex;
101 ColIndices[0] = RowIndex;
110 std::cout << std::endl <<
"Estimate of Dominant Eigenvalue = " << lambda << std::endl;
Epetra_Map: A class for partitioning vectors and matrices.
Epetra_IntSerialDenseVector: A class for constructing and using dense vectors.
virtual int InsertGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
Insert a list of elements in a given global row of the matrix.
int power_method(Epetra_CrsMatrix &A, double &lambda, int niters, double tolerance, bool verbose)
int MyPID() const
Return my process ID.
Epetra_MpiComm: The Epetra MPI Communication Class.
std::string Epetra_Version()
int FillComplete(bool OptimizeDataStorage=true)
Signal that data entry is complete. Perform transformations to local index space. ...
Epetra_SerialDenseVector: A class for constructing and using dense vectors.
int NumMyElements() const
Number of elements on the calling processor.
int GID(int LID) const
Returns global ID of local ID, return IndexBase-1 if not found on this processor. ...
int Length() const
Returns length of vector.
bool MyGID(int GID_in) const
Returns true if the GID passed in belongs to the calling processor in this map, otherwise returns fal...
Epetra_SerialComm: The Epetra Serial Communication Class.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
int main(int argc, char *argv[])
double * Values() const
Returns pointer to the values in vector.
int * Values()
Returns pointer to the values in vector.
virtual int ReplaceGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
Replace specified existing values with this list of entries for a given global row of the matrix...