[9c5296] | 1 | /*
|
---|
| 2 | * Subspace.hpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: Nov 22, 2010
|
---|
| 5 | * Author: heber
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef SUBSPACE_HPP_
|
---|
| 9 | #define SUBSPACE_HPP_
|
---|
| 10 |
|
---|
| 11 | #include <map>
|
---|
| 12 | #include <set>
|
---|
| 13 | #include <vector>
|
---|
| 14 | #include "Eigenspace.hpp"
|
---|
| 15 | #include "MatrixContent.hpp"
|
---|
| 16 | #include "VectorContent.hpp"
|
---|
[a06042] | 17 | #include "unittests/SubspaceFactorizerUnittest.hpp"
|
---|
[9c5296] | 18 |
|
---|
| 19 | /** A subset of eigenvectors from an Eigenspace.
|
---|
| 20 | *
|
---|
| 21 | * In this class we regard a sub set of eigenvectors of an Eigenspace
|
---|
| 22 | * which span a subspace of the eigenspace. This is used for diagonalization
|
---|
| 23 | * of the Eigenspace's matrix in linear-scaling, subspace decomposition
|
---|
| 24 | * schemes.
|
---|
| 25 | *
|
---|
| 26 | * Here, beyond the contents of Eigenspace, we need projection matrices from
|
---|
| 27 | * and to this subspace and also mappings from the global indices to the local
|
---|
| 28 | * indices, to identify local eigenvectors in this Subspace with their
|
---|
| 29 | * counterparts in the full Eigenspace.
|
---|
| 30 | *
|
---|
| 31 | */
|
---|
| 32 | class Subspace : public Eigenspace
|
---|
| 33 | {
|
---|
[a06042] | 34 | // TODO: Remove if not needed anymore
|
---|
| 35 | friend void SubspaceFactorizerUnittest::SubspaceTest();
|
---|
[9c5296] | 36 | public:
|
---|
| 37 | typedef std::map<size_t, size_t> mapping;
|
---|
| 38 | typedef std::set< boost::shared_ptr<Subspace> > subset;
|
---|
| 39 |
|
---|
| 40 | Subspace(indexset &_s, Eigenspace &_FullSpace);
|
---|
| 41 | ~Subspace();
|
---|
| 42 |
|
---|
| 43 | // manipulate subsets
|
---|
| 44 | bool addSubset(boost::shared_ptr<Subspace> &_s);
|
---|
| 45 | bool removeSubset(boost::shared_ptr<Subspace> &_s);
|
---|
| 46 |
|
---|
| 47 | void calculateEigenSubspace();
|
---|
| 48 | void correctEigenvectorsFromSubIndices();
|
---|
| 49 | eigenvectorset getEigenvectorsInFullSpace();
|
---|
| 50 | eigenvectorset getEigenvectorsInSubspace();
|
---|
| 51 |
|
---|
| 52 | private:
|
---|
| 53 |
|
---|
| 54 | void invertLocalToGlobalMapping();
|
---|
| 55 | void getSubspacematrixFromBigmatrix(const MatrixContent & bigmatrix);
|
---|
[a06042] | 56 | void createProjectionMatrices();
|
---|
| 57 | void projectFullSpaceMatrixToSubspace();
|
---|
[9c5296] | 58 |
|
---|
| 59 | mapping LocalToGlobal;
|
---|
| 60 | mapping GlobalToLocal;
|
---|
| 61 | subset SubIndices;
|
---|
| 62 | MatrixContent ProjectToSubspace;
|
---|
| 63 | MatrixContent ProjectFromSubspace;
|
---|
| 64 | Eigenspace &FullSpace;
|
---|
| 65 | };
|
---|
| 66 |
|
---|
| 67 |
|
---|
| 68 | #endif /* SUBSPACE_HPP_ */
|
---|