2 Copyright (C) 2012 Modelon AB
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the BSD style license.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 FMILIB_License.txt file for more details.
12 You should have received a copy of the FMILIB_License.txt file
13 along with this program. If not, contact Modelon AB <http://www.modelon.com>.
16 /** \file fmi2_xml_model_structure_impl.h
17 * \brief Private header file. Definitions for the model structure interface.
20 #ifndef FMI2_XML_MODELSTRUCTURE_IMPL_H_
21 #define FMI2_XML_MODELSTRUCTURE_IMPL_H_
23 #include <FMI2/fmi2_xml_model_structure.h>
29 /** \brief Structure for keeping information about variable dependencies.
31 typedef struct fmi2_xml_dependencies_t {
32 int isRowMajor; /** Information is stored in row-major format flag */
34 /** Start index in dependency data for the corresponding row (isRowMajor=1) or column (isRowMajor = 0) */
35 jm_vector(size_t) startIndex;
37 /** Column indices (isRowMajor=1) or row indices (isRowMajor=0)
38 Note that indices are 1-based. 0 has a special meaning - depends on all.
40 jm_vector(size_t) dependencyIndex;
41 jm_vector(char) dependencyFactorKind;
42 } fmi2_xml_dependencies_t;
44 fmi2_xml_dependencies_t* fmi2_xml_allocate_dependencies(jm_callbacks* cb);
45 void fmi2_xml_free_dependencies(fmi2_xml_dependencies_t* dep);
47 struct fmi2_xml_model_structure_t {
48 jm_vector(jm_voidp) outputs;
49 jm_vector(jm_voidp) derivatives;
50 jm_vector(jm_voidp) discreteStates;
51 jm_vector(jm_voidp) initialUnknowns;
53 fmi2_xml_dependencies_t* outputDeps;
54 fmi2_xml_dependencies_t* derivativeDeps;
55 fmi2_xml_dependencies_t* discreteStateDeps;
56 fmi2_xml_dependencies_t* initialUnknownDeps;
58 int isValidFlag; /**\ brief The flag is used to signal if an error was discovered and the model structure is not usable */