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.
double * Values() const
Returns pointer to the values in vector.
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.
bool MyGID(int GID_in) const
Returns true if the GID passed in belongs to the calling processor in this map, otherwise returns fal...
int NumMyElements() const
Number of elements on the calling processor.
double power_method(const Epetra_CrsMatrix &A)
Epetra_SerialComm: The Epetra Serial Communication Class.
int MyPID() const
Return my process ID.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
int main(int argc, char *argv[])
int Length() const
Returns length of 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...
int GID(int LID) const
Returns global ID of local ID, return IndexBase-1 if not found on this processor. ...