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