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_OMDC_DATA_STORE__
16 #define __INC_OMDC_DATA_STORE__
17 
18 #include <Eigen/Core>
19 
43 namespace OMDc {
44 
57 class DataStore
58 {
59 public:
61  const Eigen::Index m;
63  const Eigen::Index r;
65  const Eigen::Index n;
67  const Eigen::Index p;
68 private:
70  const Eigen::Index zwdim;
72  const Eigen::Ref<const Eigen::MatrixXd> S;
74  const Eigen::Ref<const Eigen::MatrixXd> U;
76  Eigen::MatrixXd LTS;
78  Eigen::MatrixXd Z;
80  Eigen::MatrixXd ZW;
82  const double normY;
83 public:
85  typedef Eigen::Block<const Eigen::MatrixXd,Eigen::Dynamic,Eigen::Dynamic,true> Block;
87  typedef Eigen::Block<const Eigen::Ref<const Eigen::MatrixXd>,Eigen::Dynamic,Eigen::Dynamic,true> RefBlock;
90  inline const RefBlock X() const {
91  return S.leftCols(m-1);
92  };
95  inline const RefBlock Y() const {
96  return S.rightCols(m-1);
97  };
100  inline const Block LTX() const {
101  return LTS.leftCols(m-1);
102  };
105  inline const Block LTY() const {
106  return LTS.rightCols(m-1);
107  };
112  DataStore( const Eigen::Ref<const Eigen::MatrixXd> S, const Eigen::Ref<const Eigen::MatrixXd> U, Eigen::Index r);
115  void updateSystemMatrices(const Eigen::Ref<const Eigen::MatrixXd> L);
124  const Eigen::MatrixXd getSystemMatrix() const;
134  const Eigen::MatrixXd &getProjector() const;
143  const Eigen::MatrixXd getInputMatrix() const;
153  const double getResidual() const;
171  const Eigen::VectorXd getInitialState() const;
172 };
173 
174 };
175 
176 #endif
interface to internal representation of OMDc data
Definition: DataStore.hpp:58
const Eigen::VectorXd getInitialState() const
computes intial state from identified system
Eigen::Block< const Eigen::MatrixXd, Eigen::Dynamic, Eigen::Dynamic, true > Block
short-hand for matrix block expression
Definition: DataStore.hpp:85
Eigen::Block< const Eigen::Ref< const Eigen::MatrixXd >, Eigen::Dynamic, Eigen::Dynamic, true > RefBlock
short-hand for referenced matrix block
Definition: DataStore.hpp:87
const Eigen::Index n
number of spatial locations (n > m)
Definition: DataStore.hpp:65
const Eigen::MatrixXd & getProjector() const
get state projector
const Block LTY() const
read-access to projected output 'right' snaps
Definition: DataStore.hpp:105
const Eigen::Index m
number of snapshots
Definition: DataStore.hpp:61
const Eigen::MatrixXd getSystemMatrix() const
system matrix of linear system from internal representation
const Block LTX() const
read-access to projected input 'left' snaps
Definition: DataStore.hpp:100
const double getResidual() const
residual of squared Fobenius norm || Y - LML'X - LPU ||
const RefBlock Y() const
read-access to 'right' snaps
Definition: DataStore.hpp:95
const Eigen::MatrixXd getInputMatrix() const
input matrix of linear system from internal representation
const RefBlock X() const
read-access to 'left' snaps
Definition: DataStore.hpp:90
const Eigen::Index r
rank of reduced space
Definition: DataStore.hpp:63
DataStore(const Eigen::Ref< const Eigen::MatrixXd > S, const Eigen::Ref< const Eigen::MatrixXd > U, Eigen::Index r)
standard contructor from snapshots and inputs
const Eigen::Index p
number of inputs
Definition: DataStore.hpp:67
void updateSystemMatrices(const Eigen::Ref< const Eigen::MatrixXd > L)
recomputes internal representations for given modes
Optimal Mode Decomposition for control.
Definition: DataStore.hpp:43

Automatic Control and Systems Theory, Ruhr-Univeristy Bochum