Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
f2e2f682
Commit
f2e2f682
authored
14 years ago
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
SWZ: centralize mex changes, remove unused functions
parent
a1ade982
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mex/sources/ms-sbvar/modify_for_mex.cc
+3
-31
3 additions, 31 deletions
mex/sources/ms-sbvar/modify_for_mex.cc
mex/sources/ms-sbvar/modify_for_mex.h
+9
-25
9 additions, 25 deletions
mex/sources/ms-sbvar/modify_for_mex.h
with
12 additions
and
56 deletions
mex/sources/ms-sbvar/modify_for_mex.cc
+
3
−
31
View file @
f2e2f682
/*
/*
* Copyright (C) 2010 Dynare Team
* Copyright (C) 2010
-2011
Dynare Team
*
*
* This file is part of Dynare.
* This file is part of Dynare.
*
*
...
@@ -17,51 +17,23 @@
...
@@ -17,51 +17,23 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#if defined(MATLAB_MEX_FILE) || defined(OCTAVE_MEX_FILE)
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
extern
"C"
{
{
#endif
#endif
#include
<stdio.h>
#include
<stdlib.h>
#include
<stdarg.h>
#include
<stdarg.h>
#include
<string.h>
#if defined(MATLAB_MEX_FILE) || defined(OCTAVE_MEX_FILE)
#include
<dynmex.h>
#include
<dynmex.h>
#endif
int
constant_seed
;
int
constant_seed
;
void
ms_fprintf_err
(
char
*
str
,
...)
{
va_list
ap
;
va_start
(
ap
,
str
);
#if defined(MATLAB_MEX_FILE) || defined(OCTAVE_MEX_FILE)
mexPrintf
(
str
,
ap
);
#else
vfprintf
(
stderr
,
str
,
ap
);
#endif
va_end
(
ap
);
}
void
void
msExit
(
int
status
)
msExit
(
int
status
)
{
{
#if defined(MATLAB_MEX_FILE) || defined(OCTAVE_MEX_FILE)
throw
"Error in MS-SBVAR MEX file.
\n
"
;
throw
"Error in MS-SBVAR MEX file.
\n
"
;
#else
exit
(
status
);
#endif
}
}
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
#endif
This diff is collapsed.
Click to expand it.
mex/sources/ms-sbvar/modify_for_mex.h
+
9
−
25
View file @
f2e2f682
...
@@ -20,42 +20,26 @@
...
@@ -20,42 +20,26 @@
#ifndef _MEXMOD
#ifndef _MEXMOD
#define _MEXMOD
#define _MEXMOD
void
ms_exit
(
int
status
);
void
ms_fprintf_err
(
const
char
*
str
,
...);
extern
int
constant_seed
;
#endif
#if defined(MATLAB_MEX_FILE) || defined(OCTAVE_MEX_FILE)
#if defined(MATLAB_MEX_FILE) || defined(OCTAVE_MEX_FILE)
#include
<dynmex.h>
#include
<dynmex.h>
#include
<dynblas.h>
#include
<dynblas.h>
#include
<dynlapack.h>
#include
<dynlapack.h>
#include
<mat.h>
#define msMalloc mxMalloc
#define msCalloc mxCalloc
#define msRealloc mxRealloc
#define msFree mxFree
mxArray
*
globalMatlabStruct
;
#define dw_malloc(n) mxMalloc(n)
#define dw_calloc(n) mxCalloc(n)
#define dw_realloc(buffer,n) mxRealloc(buffer,n)
#define dw_free(buffer) mxFree(buffer)
#define dw_exit(n) msExit(n)
#ifndef _MEXWRITE
void
msExit
(
int
status
);
#define _MEXWRITE
extern
int
constant_seed
;
/* Write Matlab Output */
mxArray
*
globalMatlabStruct
;
void
mex_write_to_matlab_matfile
(
double
*
,
int
,
int
,
const
char
*
,
const
char
*
);
void
mex_write_to_matlab_matfile
(
double
*
,
int
,
int
,
const
char
*
,
const
char
*
);
void
mex_write_to_matlab_global_struct
(
double
*
,
int
,
int
,
const
char
*
);
void
mex_write_to_matlab_global_struct
(
double
*
,
int
,
int
,
const
char
*
);
mxArray
*
getMxArray
(
double
*
,
int
,
int
);
mxArray
*
getMxArray
(
double
*
,
int
,
int
);
#endif
#endif
#else
#define ms_fprintf_stdout printf
#define msMalloc malloc
#define msCalloc calloc
#define msRealloc realloc
#define msFree free
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment