OMSimulatorLib The OMSimulator project is a FMI-based co-simulation environment.

Loading...
Searching...
No Matches
MatVer4.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenModelica.
3 *
4 * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC),
5 * c/o Linköpings universitet, Department of Computer and Information Science,
6 * SE-58183 Linköping, Sweden.
7 *
8 * All rights reserved.
9 *
10 * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR
11 * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
12 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
13 * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
14 * ACCORDING TO RECIPIENTS CHOICE.
15 *
16 * The OpenModelica software and the Open Source Modelica
17 * Consortium (OSMC) Public License (OSMC-PL) are obtained
18 * from OSMC, either from the above address,
19 * from the URLs: http://www.ida.liu.se/projects/OpenModelica or
20 * http://www.openmodelica.org, and in the OpenModelica distribution.
21 * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
22 *
23 * This program is distributed WITHOUT ANY WARRANTY; without
24 * even the implied warranty of MERCHANTABILITY or FITNESS
25 * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
26 * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
27 *
28 * See the full OSMC Public License conditions for more details.
29 *
30 */
31
32#ifndef _OMS_MATVER4_H_
33#define _OMS_MATVER4_H_
34
35#include <stdio.h>
36#include <stddef.h>
37
38 namespace oms
39{
40
41 typedef enum MatVer4Type_t
42{
43 MatVer4Type_DOUBLE = 0,
44 MatVer4Type_SINGLE = 10,
45 MatVer4Type_INT32 = 20,
46 MatVer4Type_CHAR = 51
47} MatVer4Type_t;
48
49 typedef struct MatVer4Header
50{
51 unsigned int type;
52 unsigned int mrows;
53 unsigned int ncols;
54 unsigned int imagf;
55 unsigned int namelen;
56} MatVer4Header;
57
58 typedef struct MatVer4Matrix
59{
60 MatVer4Header header;
61 void *data;
62} MatVer4Matrix;
63
64 size_t sizeofMatVer4Type(MatVer4Type_t type);
65
66 void writeMatVer4Matrix(FILE* file, const char* name, size_t rows, size_t cols, const void* matrixData, MatVer4Type_t type);
67 void appendMatVer4Matrix(FILE* file, long position, const char* name, size_t rows, size_t cols, const void* matrixData, MatVer4Type_t type);
68
69MatVer4Matrix* readMatVer4Matrix(FILE* file);
70 void freeMatVer4Matrix(MatVer4Matrix** matrix);
71
72 void skipMatVer4Matrix(FILE* file);
73
74}
75
76#endif
oms
Definition AlgLoop.h:45
oms::sizeofMatVer4Type
size_t sizeofMatVer4Type(MatVer4Type_t type)
Definition MatVer4.cpp:51
oms::skipMatVer4Matrix
void skipMatVer4Matrix(FILE *file)
Definition MatVer4.cpp:140
oms::readMatVer4Matrix
MatVer4Matrix * readMatVer4Matrix(FILE *file)
Definition MatVer4.cpp:108
oms::writeMatVer4Matrix
void writeMatVer4Matrix(FILE *file, const char *name, size_t rows, size_t cols, const void *matrixData, MatVer4Type_t type)
Definition MatVer4.cpp:70
oms::appendMatVer4Matrix
void appendMatVer4Matrix(FILE *file, long position, const char *name, size_t rows, size_t cols, const void *matrixData, MatVer4Type_t type)
Definition MatVer4.cpp:86
oms::MatVer4Type_t
MatVer4Type_t
Definition MatVer4.h:42
oms::MatVer4Type_DOUBLE
@ MatVer4Type_DOUBLE
Definition MatVer4.h:43
oms::MatVer4Type_CHAR
@ MatVer4Type_CHAR
Definition MatVer4.h:46
oms::MatVer4Type_INT32
@ MatVer4Type_INT32
Definition MatVer4.h:45
oms::MatVer4Type_SINGLE
@ MatVer4Type_SINGLE
Definition MatVer4.h:44
oms::freeMatVer4Matrix
void freeMatVer4Matrix(MatVer4Matrix **matrix)
Definition MatVer4.cpp:129
oms::MatVer4Header
Definition MatVer4.h:50
oms::MatVer4Header::mrows
unsigned int mrows
Definition MatVer4.h:52
oms::MatVer4Header::imagf
unsigned int imagf
Definition MatVer4.h:54
oms::MatVer4Header::type
unsigned int type
Definition MatVer4.h:51
oms::MatVer4Header::namelen
unsigned int namelen
Definition MatVer4.h:55
oms::MatVer4Header::ncols
unsigned int ncols
Definition MatVer4.h:53
oms::MatVer4Matrix
Definition MatVer4.h:59
oms::MatVer4Matrix::data
void * data
Definition MatVer4.h:61
oms::MatVer4Matrix::header
MatVer4Header header
Definition MatVer4.h:60