1 | /*
|
---|
2 | * SubspaceFactorizerUnitTest.hpp
|
---|
3 | *
|
---|
4 | * Created on: Nov 13, 2010
|
---|
5 | * Author: heber
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef SUBSPACEFACTORIZERUNITTEST_HPP_
|
---|
9 | #define SUBSPACEFACTORIZERUNITTEST_HPP_
|
---|
10 |
|
---|
11 | // include config.h
|
---|
12 | #ifdef HAVE_CONFIG_H
|
---|
13 | #include <config.h>
|
---|
14 | #endif
|
---|
15 |
|
---|
16 |
|
---|
17 | #include <cppunit/extensions/HelperMacros.h>
|
---|
18 |
|
---|
19 | class MatrixContent;
|
---|
20 | class VectorContent;
|
---|
21 | class Subspace;
|
---|
22 |
|
---|
23 | typedef std::set<std::set<size_t> > SetofIndexSets;
|
---|
24 | typedef std::set<size_t> IndexSet;
|
---|
25 | typedef std::multimap< size_t, boost::shared_ptr<Subspace> > SubspaceMap;
|
---|
26 | typedef std::multimap< size_t, boost::shared_ptr<IndexSet> > IndexMap;
|
---|
27 | typedef std::list< boost::shared_ptr<VectorContent> > VectorList;
|
---|
28 | typedef std::list< std::pair<boost::shared_ptr<VectorContent>, double> > VectorValueList;
|
---|
29 | typedef std::vector< boost::shared_ptr<VectorContent> > VectorArray;
|
---|
30 | typedef std::vector< double > ValueArray;
|
---|
31 |
|
---|
32 | class SubspaceFactorizerUnittest : public CppUnit::TestFixture
|
---|
33 | {
|
---|
34 | CPPUNIT_TEST_SUITE( SubspaceFactorizerUnittest) ;
|
---|
35 | CPPUNIT_TEST ( BlockTest );
|
---|
36 | //CPPUNIT_TEST ( EigenvectorTest );
|
---|
37 | CPPUNIT_TEST ( generatePowerSetTest );
|
---|
38 | CPPUNIT_TEST ( SubspaceTest );
|
---|
39 | CPPUNIT_TEST_SUITE_END();
|
---|
40 |
|
---|
41 | public:
|
---|
42 | void setUp();
|
---|
43 | void tearDown();
|
---|
44 |
|
---|
45 | void BlockTest();
|
---|
46 | void EigenvectorTest();
|
---|
47 | void generatePowerSetTest();
|
---|
48 | void SubspaceTest();
|
---|
49 |
|
---|
50 | enum { matrixdimension = 4 };
|
---|
51 | enum { subspacelimit = 3 };
|
---|
52 | private:
|
---|
53 |
|
---|
54 | MatrixContent *matrix;
|
---|
55 |
|
---|
56 | MatrixContent ***transformation;
|
---|
57 | };
|
---|
58 |
|
---|
59 | MatrixContent * getSubspaceMatrix(MatrixContent &bigmatrix, const IndexSet &rowindexset, const IndexSet &columnindexset);
|
---|
60 | void embedSubspaceMatrix(MatrixContent &bigmatrix, MatrixContent &subsystem, const IndexSet &rowindexset, const IndexSet &columnindexset);
|
---|
61 | std::ostream & operator<<(std::ostream &ost, const IndexSet &indexset);
|
---|
62 |
|
---|
63 | #endif /* SUBSPACEFACTORIZERUNITTEST_HPP_ */
|
---|