RCAC C++
RCACGrad.hpp
1
#ifndef _RCACGRAD_HPP_
2
#define _RCACGRAD_HPP_
3
4
#include "RCAC.hpp"
5
#include <iostream>
6
#include "Eigen/Core"
7
#include "Eigen/Sparse"
8
#include "unsupported/Eigen/KroneckerProduct"
9
10
//Name: Nima Mohseni
11
//Date: 2/18/2020
12
//Purpose: This file contains the implementation of Gradient Descent RCAC as
13
//a derived class of the base RCAC class
14
27
//Struct flags: contains the necessary flags and data for the gradient RCAC
28
struct
rcacGradFlags
29
{
30
//Default RCAC Flags. Required in all RCAC implementations
31
int
lz;
32
int
ly;
33
int
lu;
34
int
Nc;
35
Eigen::VectorXd theta_0;
36
int
filtorder;
37
int
k_0;
38
39
//RCAC Gradient Coefficients
40
double
alpha;
41
42
};
43
48
class
RCACGrad
:
public
RCAC
49
{
50
public
:
57
//Value ctor: Initializes RCAC using gradient descent with the given flags and
58
//filter values
59
RCACGrad
(
60
rcacGradFlags
&FLAGS,
61
rcacFilt
&FILT
62
);
63
64
private
:
71
//Function coeffUpdate: Compute the RCAC coefficient update for gradient RCAC
72
void
coeffUpdate(
73
Eigen::VectorXd &zIn
74
);
75
76
//Gradient FLAGS
77
double
alpha;
//stepsize scaling
78
79
//Other Variables
80
Eigen::VectorXd gradient;
81
};
82
83
#endif
RCACGrad
Definition:
RCACGrad.hpp:48
rcacFilt
Definition:
RCAC.hpp:66
rcacGradFlags
Definition:
RCACGrad.hpp:28
RCAC
Definition:
RCAC.hpp:81
RCACGrad.hpp
Generated by
1.8.13