#include "Didasko_ConfigDefs.h"
#if defined(HAVE_DIDASKO_EPETRA)
#include "Epetra_ConfigDefs.h"
#ifdef HAVE_MPI
#include "mpi.h"
#include "Epetra_MpiComm.h"
#else
#include "Epetra_SerialComm.h"
#endif
#include "Epetra_SerialDenseMatrix.h"
int main(int argc, char *argv[])
{
#ifdef HAVE_MPI
MPI_Init(&argc, &argv);
#else
#endif
int NumRowsA = 2, NumColsA = 2;
A.
Shape( NumRowsA, NumColsA );
for( int i=0 ; i<NumRowsA ; ++i )
for( int j=0 ; j<NumColsA ; ++j )
A(i,j) = i+100*j;
cout << A;
cout <<
"Inf norm of A = " << A.
OneNorm() << endl;
cout << "One norm of A = " << A.InfNorm() << endl;
int NumRowsB = 2, NumColsB=1;
B.
Shape(NumRowsB, NumColsB);
for( int i=0 ; i<NumRowsB ; ++i )
for( int j=0 ; j<NumColsB ; ++j )
B(i,j) = 11.0+i+100*j;
cout << B;
AtimesB.
Shape(NumRowsA,NumColsB);
AtimesB.
Multiply(
'N',
'N',1.0, A, B, 0.0);
cout << AtimesB;
#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