#include "Didasko_ConfigDefs.h"
#if defined(HAVE_DIDASKO_EPETRA)
#include <iostream>
#include "Epetra_ConfigDefs.h"
#ifdef HAVE_MPI
#include "mpi.h"
#include "Epetra_MpiComm.h"
#else
#include "Epetra_SerialComm.h"
#endif
#include "Epetra_SerialDenseVector.h"
#include "Epetra_SerialDenseMatrix.h"
#include "Epetra_SerialDenseSolver.h"
int main(int argc, char *argv[])
{
#ifdef HAVE_MPI
MPI_Init(&argc, &argv);
#else
#endif
int NumRows = 5;
for( int i=0 ; i<NumRows ; ++i ) b[i] = 1.0, x[i]=0.0;
A.
Shape( NumRows, NumRows );
A2.
Shape( NumRows, NumRows );
for( int i=0 ; i<NumRows ; ++i )
for( int j=0 ; j<NumRows ; ++j )
A(i,j) = 1.0/(i+j+2);
cout<< A;
A2 = A;
cout << "A * x = \n" << b;
double rcond;
cout << "The (estimated) condition number of A is " << 1/rcond << endl;
cout << "The inverse of A is\n";
cout << A2;
#ifdef HAVE_MPI
MPI_Finalize();
#endif
}
#else
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
puts("Please configure Didasko with:\n"
"--enable-epetra");
return 0;
}
#endif