svZeroDSolver
Loading...
Searching...
No Matches
State.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the
2// University of California, and others. SPDX-License-Identifier: BSD-3-Clause
3/**
4 * @file State.h
5 * @brief State source file
6 */
7#ifndef SVZERODSOLVER_ALGEBRA_STATE_HPP_
8#define SVZERODSOLVER_ALGEBRA_STATE_HPP_
9
10#include <Eigen/Core>
11
12/**
13 * @brief State of the system.
14 *
15 * Stores the current state of a system, i.e. the current value and
16 * derivate of all variables.
17 *
18 */
19class State {
20 public:
21 Eigen::Matrix<double, Eigen::Dynamic, 1>
22 y; ///< Vector of solution quantities
23 Eigen::Matrix<double, Eigen::Dynamic, 1> ydot; ///< Derivate of \ref y
24
25 /**
26 * @brief Construct a new State object
27 *
28 */
29 State();
30
31 /**
32 * @brief Construct a new State object
33 *
34 * @param n Size of the state
35 */
36 State(int n);
37
38 /**
39 * @brief Destroy the State object
40 *
41 */
42 ~State();
43
44 /**
45 * @brief Copy a State object
46 *
47 * @param state
48 */
49 State(const State &state);
50
51 /**
52 * @brief Construct a new State object and initilaize with all zeros.
53 *
54 * @param n Size of the state
55 * @return New state initialized with all zeros
56 */
57 static State Zero(int n);
58};
59
60#endif // SVZERODSOLVER_ALGEBRA_STATE_HPP_
static State Zero(int n)
Construct a new State object and initilaize with all zeros.
Definition State.cpp:20
Eigen::Matrix< double, Eigen::Dynamic, 1 > ydot
Derivate of y.
Definition State.h:23
State()
Construct a new State object.
Definition State.cpp:6
Eigen::Matrix< double, Eigen::Dynamic, 1 > y
Vector of solution quantities.
Definition State.h:22
~State()
Destroy the State object.
Definition State.cpp:13