trunk preprocessor: added some comments
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2176 ac1d8469-bf42-47a9-8791-bf33cf982152issue#70
parent
a3a39d0a26
commit
be2622e404
|
@ -17,8 +17,8 @@
|
||||||
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BLOCKTRIANGULAR_H
|
#ifndef _BLOCKTRIANGULAR_HH
|
||||||
#define BLOCKTRIANGULAR_H
|
#define _BLOCKTRIANGULAR_HH
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "ExprNode.hh"
|
#include "ExprNode.hh"
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CODEINTERPRETER
|
#ifndef _CODEINTERPRETER_HH
|
||||||
#define CODEINTERPRETER
|
#define _CODEINTERPRETER_HH
|
||||||
|
|
||||||
const char FLDZ=0;
|
const char FLDZ=0;
|
||||||
const char FLDT=1;
|
const char FLDT=1;
|
||||||
|
@ -61,7 +61,7 @@ enum BlockSimulationType
|
||||||
SOLVE_BACKWARD_COMPLETE = 6, //!< Block of several equations, newton solver needed, backward
|
SOLVE_BACKWARD_COMPLETE = 6, //!< Block of several equations, newton solver needed, backward
|
||||||
SOLVE_TWO_BOUNDARIES_COMPLETE = 7, //!< Block of several equations, newton solver needed, forward and backwar
|
SOLVE_TWO_BOUNDARIES_COMPLETE = 7, //!< Block of several equations, newton solver needed, forward and backwar
|
||||||
EVALUATE_FOREWARD_R = 8, //!< Simple evaluation, normalized variable on right-hand side, forward
|
EVALUATE_FOREWARD_R = 8, //!< Simple evaluation, normalized variable on right-hand side, forward
|
||||||
EVALUATE_BACKWARD_R = 9 //!< Simple evaluation, normalized variable on right-hand side, backward
|
EVALUATE_BACKWARD_R = 9 //!< Simple evaluation, normalized variable on right-hand side, backward
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Enumeration of possible symbol types
|
//! Enumeration of possible symbol types
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MODELBLOCKS
|
#ifndef _MODELBLOCKS_HH
|
||||||
#define MODELBLOCKS
|
#define _MODELBLOCKS_HH
|
||||||
#include "ModelNormalization.hh"
|
#include "ModelNormalization.hh"
|
||||||
|
|
||||||
//! Sparse form of the graph, with strongly connected components
|
//! Sparse form of the graph, with strongly connected components
|
||||||
|
@ -32,7 +32,7 @@ typedef struct block_result
|
||||||
block_result_t;
|
block_result_t;
|
||||||
|
|
||||||
|
|
||||||
//! Implements Tarjan algorithm
|
//! Computes strongly connected components and converts it to block decomposition
|
||||||
class Blocks
|
class Blocks
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -17,18 +17,20 @@
|
||||||
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MODELNORMALIZATION
|
#ifndef _MODELNORMALIZATION_HH
|
||||||
#define MODELNORMALIZATION
|
#define _MODELNORMALIZATION_HH
|
||||||
#include "SymbolTable.hh"
|
#include "SymbolTable.hh"
|
||||||
#include "CodeInterpreter.hh"
|
#include "CodeInterpreter.hh"
|
||||||
|
|
||||||
|
|
||||||
|
//! One edge in the bi-partite graph (equation side), stored in a chained-list
|
||||||
struct Edge
|
struct Edge
|
||||||
{
|
{
|
||||||
Edge *next;
|
Edge *next;
|
||||||
int Vertex_Index;
|
int Vertex_Index; //!< Variable linked to the equation
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Set of the edges going to a given equation
|
||||||
struct Equation_vertex
|
struct Equation_vertex
|
||||||
{
|
{
|
||||||
Edge *First_Edge;
|
Edge *First_Edge;
|
||||||
|
@ -36,6 +38,7 @@ struct Equation_vertex
|
||||||
int matched;
|
int matched;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Bi-partite graph, seen from the equation side
|
||||||
struct Equation_set
|
struct Equation_set
|
||||||
{
|
{
|
||||||
Equation_vertex *Number;
|
Equation_vertex *Number;
|
||||||
|
@ -50,13 +53,16 @@ struct simple
|
||||||
int index;
|
int index;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Computes the model normalization
|
||||||
class Normalization
|
class Normalization
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
//! Indicates if a given variable vertex is matched
|
||||||
struct Variable_vertex
|
struct Variable_vertex
|
||||||
{
|
{
|
||||||
int matched;
|
int matched;
|
||||||
};
|
};
|
||||||
|
//! Data extracted from the bi-partite graph, seen from the variable side
|
||||||
struct Variable_set
|
struct Variable_set
|
||||||
{
|
{
|
||||||
Variable_vertex *Number;
|
Variable_vertex *Number;
|
||||||
|
|
Loading…
Reference in New Issue