OMDc  1.0.0
created from 0b26fa0 on deploy-documentation
DataStore.hpp
1 // Copyright Lucas Mieg, Martin Moennigmann
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef __INC_OMD_DATA_STORE__
16 #define __INC_OMD_DATA_STORE__
17 
18 #include <Eigen/Core>
19 
21 namespace OMD {
22 
24 class DataStore
25 {
26 public:
28  const Eigen::Index m;
30  const Eigen::Index r;
32  const Eigen::Index n;
33 private:
35  const Eigen::Ref<const Eigen::MatrixXd> S;
37  Eigen::MatrixXd LTS;
39  Eigen::MatrixXd M;
41  double residual_helper;
43  const double normY;
45  Eigen::MatrixXd W;
46 public:
48  typedef Eigen::Block<const Eigen::MatrixXd,Eigen::Dynamic,Eigen::Dynamic,true> Block;
50  typedef Eigen::Block<const Eigen::Ref<const Eigen::MatrixXd>,Eigen::Dynamic,Eigen::Dynamic,true> RefBlock;
53  inline const RefBlock X() const {
54  return S.leftCols(m-1);
55  };
58  inline const RefBlock Y() const {
59  return S.rightCols( m-1);
60  };
63  inline const Block LTX() const {
64  return LTS.leftCols(m-1);
65  };
68  inline const Block LTY() const {
69  return LTS.rightCols(m-1);
70  };
74  DataStore( const Eigen::Ref<const Eigen::MatrixXd> S, Eigen::Index r);
77  void updateSystemMatrices(const Eigen::Ref<const Eigen::MatrixXd> L);
80  const Eigen::MatrixXd& getSystemMatrix() const;
83  const double getResidual() const;
86  const Eigen::MatrixXd& getProjector() const;
87 };
88 
89 };
90 
91 #endif
interface to internal representation of OMD data
Definition: DataStore.hpp:25
const Block LTX() const
read-access to projected left snaps
Definition: DataStore.hpp:63
const Block LTY() const
read-access to projected right snaps
Definition: DataStore.hpp:68
void updateSystemMatrices(const Eigen::Ref< const Eigen::MatrixXd > L)
recomputes internal representations for given modes
const RefBlock X() const
read-access to left snaps
Definition: DataStore.hpp:53
const Eigen::Index m
number of snapshots
Definition: DataStore.hpp:28
Eigen::Block< const Eigen::MatrixXd, Eigen::Dynamic, Eigen::Dynamic, true > Block
short-hand for matrix block expression
Definition: DataStore.hpp:48
const RefBlock Y() const
read-access to right snaps
Definition: DataStore.hpp:58
Eigen::Block< const Eigen::Ref< const Eigen::MatrixXd >, Eigen::Dynamic, Eigen::Dynamic, true > RefBlock
short-hand for referenced matrix block
Definition: DataStore.hpp:50
const double getResidual() const
squared Frobenius residual: ||Y|| - ||(L'YX'L) inv(L'XX'L) (L'XY'L)||
const Eigen::Index n
number of spatial locations (n > m)
Definition: DataStore.hpp:32
const Eigen::MatrixXd & getProjector() const
projector onto orthog. space of X'L
const Eigen::MatrixXd & getSystemMatrix() const
system matrix of linear system M = (L'YX'L) inv(L'XX'L)
DataStore(const Eigen::Ref< const Eigen::MatrixXd > S, Eigen::Index r)
standard contructor from snapshots
const Eigen::Index r
rank of reduced space
Definition: DataStore.hpp:30
Optimal Mode Decomposition.
Definition: DataStore.hpp:21

Automatic Control and Systems Theory, Ruhr-Univeristy Bochum