#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_Map.h"
#include "Epetra_Vector.h"
#include "Epetra_IntSerialDenseVector.h"
int main(int argc, char *argv[])
{
#ifdef HAVE_MPI
MPI_Init(&argc, &argv);
#else
#endif
int NumElements = 5;
int MyLength = x.MyLength();
for( int i=0 ; i<MyLength ; ++i ) x[i] = 1.0*i;
double *x_values;
x_values = new double[MyLength];
x.ExtractCopy( x_values );
for( int i=0 ; i<MyLength ; ++i )
cout << "extracted value[" << i << "] = " << x_values[i] << endl;
int* Indices; Indices = new int[MyLength];
for( int i=0 ; i<MyLength ; ++i ) {
x_values[i] *= 10;
Indices[i] = i;
}
cout << x;
x.ReplaceMyValues(MyLength, 0, x_values, Indices);
cout << x;
delete[] x_values;
delete[] Indices;
#ifdef HAVE_MPI
MPI_Finalize();
#endif
return(0);
}
#else
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
puts("Please configure Didasko with:\n"
"--enable-epetra");
return 0;
}
#endif