libMesh
eigen_sparse_vector_test.C
Go to the documentation of this file.
1 #include <libmesh/eigen_sparse_vector.h>
2 
3 #ifdef LIBMESH_HAVE_EIGEN
4 
5 #include "numeric_vector_test.h"
6 
7 #include <libmesh/ignore_warnings.h>
8 #include <cppunit/extensions/HelperMacros.h>
9 #include <cppunit/TestCase.h>
10 #include <libmesh/restore_warnings.h>
11 
12 // THE CPPUNIT_TEST_SUITE_END macro expands to code that involves
13 // std::auto_ptr, which in turn produces -Wdeprecated-declarations
14 // warnings. These can be ignored in GCC as long as we wrap the
15 // offending code in appropriate pragmas. We can't get away with a
16 // single ignore_warnings.h inclusion at the beginning of this file,
17 // since the libmesh headers pull in a restore_warnings.h at some
18 // point. We also don't bother restoring warnings at the end of this
19 // file since it's not a header.
20 #include <libmesh/ignore_warnings.h>
21 
22 using namespace libMesh;
23 
24 class EigenSparseVectorTest : public NumericVectorTest<EigenSparseVector<libMesh::Number>> {
25 public:
26  void setUp()
27  {
28  // Eigen doesn't support distributed parallel vectors, but we can
29  // build a serial vector on each processor
30  my_comm = new Parallel::Communicator();
31  }
32 
33  void tearDown()
34  {
35  delete my_comm;
36  }
37 
38  CPPUNIT_TEST_SUITE( EigenSparseVectorTest );
39 
40  NUMERICVECTORTEST
41 
42  CPPUNIT_TEST_SUITE_END();
43 };
44 
46 
47 #endif // #ifdef LIBMESH_HAVE_EIGEN
Encapsulates the MPI_Comm object.
Definition: parallel.h:657
CPPUNIT_TEST_SUITE_REGISTRATION(EigenSparseVectorTest)
The libMesh namespace provides an interface to certain functionality in the library.