Commit 684d8ac8 authored by george's avatar george

Cleared up DynareMxArrayToString in k_order_perturbation.cpp and changed...

Cleared up DynareMxArrayToString in k_order_perturbation.cpp and changed #ifdef  to #if defined() in dynamic_dll.cpp

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3195 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 965c7435
......@@ -31,14 +31,14 @@ DynamicModelDLL::DynamicModelDLL(const string &modName, const int y_length, cons
: length(y_length), jcols(j_cols), nMax_lag(n_max_lag), nExog(n_exog)
{
string fName;
#ifndef _WIN32
#if !defined(__CYGWIN32__) && !defined(_WIN32)
fName = "./";
#endif
fName += modName + "_dynamic" + sExt;
try
{
#ifdef _WIN32
#if defined(__CYGWIN32__) || defined(_WIN32)
HINSTANCE dynamicHinstance;
dynamicHinstance = ::LoadLibrary(fName.c_str());
if (dynamicHinstance == NULL)
......
......@@ -99,16 +99,7 @@ DynareMxArrayToString(const char *cNamesCharStr, const int len, const int width)
else cNamesMX[j][i] = '\0';
}
}
const char **ret = (const char **) calloc(len, sizeof(char *));
for (int j = 0; j < len; j++)
{
cNamesMX[j][width] = '\0';
char *token = (char *) calloc(strlen(cNamesMX[j])+1, sizeof(char));
strcpy(token, cNamesMX[j]);
ret[j] = token;
}
mxFree(cNamesMX);
return ret;
return (const char **)cNamesMX;
}
//////////////////////////////////////////////////////
......@@ -121,6 +112,7 @@ DynareMxArrayToString(const mxArray *mxFldp, const int len, const int width)
{
char *cNamesCharStr = mxArrayToString(mxFldp);
const char **ret = DynareMxArrayToString(cNamesCharStr, len, width);
return ret;
}
......@@ -135,7 +127,7 @@ extern "C" {
mexErrMsgTxt("Must have at least 5 input parameters.");
if (nlhs == 0)
mexErrMsgTxt("Must have at least 1 output parameter.");
const mxArray *dr = prhs[0];
const int check_flag = (int) mxGetScalar(prhs[1]);
const mxArray *M_ = prhs[2];
......@@ -271,7 +263,7 @@ extern "C" {
sstol, var_order_vp, llincidence, qz_criterium);
// construct main K-order approximation class
Approximation app(dynare, journal, nSteps, false, qz_criterium);
// run stochastic steady
app.walkStochSteady();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment