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-2026, 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 AGPL VERSION 3 LICENSE OR
11 * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8.
12 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
13 * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GNU AGPL
14 * VERSION 3, ACCORDING TO RECIPIENTS CHOICE.
15 *
16 * The OpenModelica software and the OSMC (Open Source Modelica Consortium)
17 * Public License (OSMC-PL) are obtained from OSMC, either from the above
18 * address, from the URLs:
19 * http://www.openmodelica.org or
20 * https://github.com/OpenModelica/ or
21 * http://www.ida.liu.se/projects/OpenModelica,
22 * and in the OpenModelica distribution.
23 *
24 * GNU AGPL version 3 is obtained from:
25 * https://www.gnu.org/licenses/licenses.html#GPL
26 *
27 * This program is distributed WITHOUT ANY WARRANTY; without
28 * even the implied warranty of MERCHANTABILITY or FITNESS
29 * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
30 * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
31 *
32 * See the full OSMC Public License conditions for more details.
33 *
34 */
35
36#ifndef _OMS_MATVER4_H_
37#define _OMS_MATVER4_H_
38
39#include <stdio.h>
40#include <stddef.h>
41
42 namespace oms
43{
44
45 typedef enum MatVer4Type_t
46{
47 MatVer4Type_DOUBLE = 0,
48 MatVer4Type_SINGLE = 10,
49 MatVer4Type_INT32 = 20,
50 MatVer4Type_CHAR = 51
51} MatVer4Type_t;
52
53 typedef struct MatVer4Header
54{
55 unsigned int type;
56 unsigned int mrows;
57 unsigned int ncols;
58 unsigned int imagf;
59 unsigned int namelen;
60} MatVer4Header;
61
62 typedef struct MatVer4Matrix
63{
64 MatVer4Header header;
65 void *data;
66} MatVer4Matrix;
67
68 size_t sizeofMatVer4Type(MatVer4Type_t type);
69
70 void writeMatVer4Matrix(FILE* file, const char* name, size_t rows, size_t cols, const void* matrixData, MatVer4Type_t type);
71 void appendMatVer4Matrix(FILE* file, long position, const char* name, size_t rows, size_t cols, const void* matrixData, MatVer4Type_t type);
72
73MatVer4Matrix* readMatVer4Matrix(FILE* file);
74 void freeMatVer4Matrix(MatVer4Matrix** matrix);
75
76 void skipMatVer4Matrix(FILE* file);
77
78}
79
80#endif
oms
Definition AlgLoop.h:49
oms::sizeofMatVer4Type
size_t sizeofMatVer4Type(MatVer4Type_t type)
Definition MatVer4.cpp:55
oms::skipMatVer4Matrix
void skipMatVer4Matrix(FILE *file)
Definition MatVer4.cpp:144
oms::readMatVer4Matrix
MatVer4Matrix * readMatVer4Matrix(FILE *file)
Definition MatVer4.cpp:112
oms::writeMatVer4Matrix
void writeMatVer4Matrix(FILE *file, const char *name, size_t rows, size_t cols, const void *matrixData, MatVer4Type_t type)
Definition MatVer4.cpp:74
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:90
oms::MatVer4Type_t
MatVer4Type_t
Definition MatVer4.h:46
oms::MatVer4Type_DOUBLE
@ MatVer4Type_DOUBLE
Definition MatVer4.h:47
oms::MatVer4Type_CHAR
@ MatVer4Type_CHAR
Definition MatVer4.h:50
oms::MatVer4Type_INT32
@ MatVer4Type_INT32
Definition MatVer4.h:49
oms::MatVer4Type_SINGLE
@ MatVer4Type_SINGLE
Definition MatVer4.h:48
oms::freeMatVer4Matrix
void freeMatVer4Matrix(MatVer4Matrix **matrix)
Definition MatVer4.cpp:133
oms::MatVer4Header
Definition MatVer4.h:54
oms::MatVer4Header::mrows
unsigned int mrows
Definition MatVer4.h:56
oms::MatVer4Header::imagf
unsigned int imagf
Definition MatVer4.h:58
oms::MatVer4Header::type
unsigned int type
Definition MatVer4.h:55
oms::MatVer4Header::namelen
unsigned int namelen
Definition MatVer4.h:59
oms::MatVer4Header::ncols
unsigned int ncols
Definition MatVer4.h:57
oms::MatVer4Matrix
Definition MatVer4.h:63
oms::MatVer4Matrix::data
void * data
Definition MatVer4.h:65
oms::MatVer4Matrix::header
MatVer4Header header
Definition MatVer4.h:64