Commit f3549b4c authored by sebastien's avatar sebastien

Beautified MEX source code

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3251 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 502e3e1d
......@@ -36,9 +36,9 @@ if strcmpi('GLNX86', computer) || strcmpi('GLNXA64', computer) ...
elseif strcmpi('PCWIN', computer) || strcmpi('PCWIN64', computer)
% Windows (x86-32 or x86-64) with Microsoft or gcc compiler
if strcmpi('PCWIN', computer)
LIBRARY_PATH = [MATLAB_PATH '/extern/lib/win32/microsoft/'];
LIBRARY_PATH = [MATLAB_PATH '/extern/lib/win32/microsoft/'];
else
LIBRARY_PATH = [MATLAB_PATH '/extern/lib/win64/microsoft/'];
LIBRARY_PATH = [MATLAB_PATH '/extern/lib/win64/microsoft/'];
end
LAPACK_PATH = ['"' LIBRARY_PATH 'libmwlapack.lib"'];
if matlab_ver_less_than('7.5')
......@@ -59,7 +59,7 @@ COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -DMATLAB_MEX_FILE -DMATLAB_VERSION=0x' spr
% Large array dims for 64 bits platforms appeared in Matlab 7.3
if (strcmpi('GLNXA64', computer) || strcmpi('PCWIN64', computer)) ...
&& ~matlab_ver_less_than('7.3')
&& ~matlab_ver_less_than('7.3')
COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -largeArrayDims' ];
end
......
......@@ -36,9 +36,9 @@ if strcmpi('GLNX86', computer) || strcmpi('GLNXA64', computer) ...
elseif strcmpi('PCWIN', computer) || strcmpi('PCWIN64', computer)
% Windows (x86-32 or x86-64) with Microsoft or gcc compiler
if strcmpi('PCWIN', computer)
LIBRARY_PATH = [MATLAB_PATH '/extern/lib/win32/microsoft/'];
LIBRARY_PATH = [MATLAB_PATH '/extern/lib/win32/microsoft/'];
else
LIBRARY_PATH = [MATLAB_PATH '/extern/lib/win64/microsoft/'];
LIBRARY_PATH = [MATLAB_PATH '/extern/lib/win64/microsoft/'];
end
LAPACK_PATH = ['"' LIBRARY_PATH 'libmwlapack.lib"'];
if matlab_ver_less_than('7.5')
......@@ -58,7 +58,7 @@ COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -DMATLAB_MEX_FILE -DMATLAB_VERSION=0x' spr
% Large array dims for 64 bits platforms appeared in Matlab 7.3
if (strcmpi('GLNXA64', computer) || strcmpi('PCWIN64', computer)) ...
&& ~matlab_ver_less_than('7.3')
&& ~matlab_ver_less_than('7.3')
COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -largeArrayDims' ];
end
......@@ -122,7 +122,7 @@ eval([ COMPILE_COMMAND ' -I. mjdgges/mjdgges.c ' LAPACK_PATH ]);
disp('Compiling sparse_hessian_times_B_kronecker_C...')
eval([ COMPILE_COMMAND_OMP ' -I. kronecker/sparse_hessian_times_B_kronecker_C.cc' ]);
disp('Compiling A_times_B_kronecker_C...')
eval([ COMPILE_COMMAND_OMP ' -I. kronecker/A_times_B_kronecker_C.cc ']);
......
This diff is collapsed.
......@@ -31,54 +31,52 @@
# include "linbcg.hh"
#endif
#ifndef DEBUG_EX
#include "mex.h"
# include "mex.h"
#else
#include "mex_interface.hh"
# include "mex_interface.hh"
#endif
//#define DEBUGC
using namespace std;
#define pow_ pow
typedef vector<pair<Tags, void* > >::const_iterator it_code_type;
typedef vector<pair<Tags, void * > >::const_iterator it_code_type;
class Interpreter : SparseMatrix
{
protected :
double pow1(double a, double b);
double log1(double a);
void compute_block_time(int Per_u_, bool evaluate, int block_num);
void evaluate_a_block(const int size, const int type, string bin_basename, bool steady_state, int block_num,
const bool is_linear=false, const int symbol_table_endo_nbr=0, const int Block_List_Max_Lag=0, const int Block_List_Max_Lead=0, const int u_count_int=0);
bool simulate_a_block(const int size, const int type, string file_name, string bin_basename, bool Gaussian_Elimination, bool steady_state, int block_num,
const bool is_linear=false, const int symbol_table_endo_nbr=0, const int Block_List_Max_Lag=0, const int Block_List_Max_Lead=0, const int u_count_int=0);
double *T;
vector<Block_contain_type> Block_Contain;
vector<pair<Tags, void* > > code_liste;
it_code_type it_code;
stack<double> Stack;
int Block_Count, Per_u_, Per_y_;
int it_, nb_row_x, nb_row_xd, maxit_, size_of_direction;
double *g1, *r;
double solve_tolf;
bool GaussSeidel;
double *x, *params;
double *steady_y, *steady_x;
map<pair<pair<int, int> ,int>, int> IM_i;
int equation, derivative_equation, derivative_variable;
string filename;
int minimal_solving_periods;
public :
protected:
double pow1(double a, double b);
double log1(double a);
void compute_block_time(int Per_u_, bool evaluate, int block_num);
void evaluate_a_block(const int size, const int type, string bin_basename, bool steady_state, int block_num,
const bool is_linear = false, const int symbol_table_endo_nbr = 0, const int Block_List_Max_Lag = 0, const int Block_List_Max_Lead = 0, const int u_count_int = 0);
bool simulate_a_block(const int size, const int type, string file_name, string bin_basename, bool Gaussian_Elimination, bool steady_state, int block_num,
const bool is_linear = false, const int symbol_table_endo_nbr = 0, const int Block_List_Max_Lag = 0, const int Block_List_Max_Lead = 0, const int u_count_int = 0);
double *T;
vector<Block_contain_type> Block_Contain;
vector<pair<Tags, void * > > code_liste;
it_code_type it_code;
stack<double> Stack;
int Block_Count, Per_u_, Per_y_;
int it_, nb_row_x, nb_row_xd, maxit_, size_of_direction;
double *g1, *r;
double solve_tolf;
bool GaussSeidel;
double *x, *params;
double *steady_y, *steady_x;
map<pair<pair<int, int>, int>, int> IM_i;
int equation, derivative_equation, derivative_variable;
string filename;
int minimal_solving_periods;
public:
Interpreter(double *params_arg, double *y_arg, double *ya_arg, double *x_arg, double *steady_y_arg, double *steady_x_arg,
double *direction_arg, int y_size_arg, int nb_row_x_arg,
int nb_row_xd_arg, int periods_arg, int y_kmin_arg, int y_kmax_arg, int maxit_arg_, double solve_tolf_arg, int size_o_direction_arg,
double slowc_arg, int y_decal_arg, double markowitz_c_arg, string &filename_arg, int minimal_solving_periods_arg);
bool compute_blocks(string file_name, string bin_basename, bool steady_state, bool evaluate);
Interpreter(double *params_arg, double *y_arg, double *ya_arg, double *x_arg, double *steady_y_arg, double *steady_x_arg,
double *direction_arg, int y_size_arg, int nb_row_x_arg,
int nb_row_xd_arg, int periods_arg, int y_kmin_arg, int y_kmax_arg, int maxit_arg_, double solve_tolf_arg, int size_o_direction_arg,
double slowc_arg, int y_decal_arg, double markowitz_c_arg, string &filename_arg, int minimal_solving_periods_arg);
bool compute_blocks(string file_name, string bin_basename, bool steady_state, bool evaluate);
};
#endif
......@@ -21,16 +21,16 @@
Mem_Mngr::Mem_Mngr()
{
swp_f=false;
swp_f_b=0;
swp_f = false;
swp_f_b = 0;
}
void
Mem_Mngr::Print_heap()
{
int i;
mexPrintf("i :");
for (i=0;i<CHUNK_SIZE;i++)
mexPrintf("%3d ",i);
for (i = 0; i < CHUNK_SIZE; i++)
mexPrintf("%3d ", i);
mexPrintf("\n");
}
......@@ -38,90 +38,89 @@ void
Mem_Mngr::init_Mem()
{
Chunk_Stack.clear();
CHUNK_SIZE=0;
Nb_CHUNK=0;
NZE_Mem=NULL;
NZE_Mem_add=NULL;
CHUNK_heap_pos=0;
CHUNK_SIZE = 0;
Nb_CHUNK = 0;
NZE_Mem = NULL;
NZE_Mem_add = NULL;
CHUNK_heap_pos = 0;
NZE_Mem_Allocated.clear();
}
void Mem_Mngr::fixe_file_name(string filename_arg)
void
Mem_Mngr::fixe_file_name(string filename_arg)
{
filename=filename_arg;
filename = filename_arg;
}
void
Mem_Mngr::init_CHUNK_BLCK_SIZE(int u_count)
{
CHUNK_BLCK_SIZE=u_count;
CHUNK_BLCK_SIZE = u_count;
}
NonZeroElem*
NonZeroElem *
Mem_Mngr::mxMalloc_NZE()
{
long int i;
if (!Chunk_Stack.empty()) /*An unused block of memory available inside the heap*/
{
NonZeroElem* p1 = Chunk_Stack.back();
NonZeroElem *p1 = Chunk_Stack.back();
Chunk_Stack.pop_back();
return(p1);
return (p1);
}
else if (CHUNK_heap_pos<CHUNK_SIZE) /*there is enough allocated memory space available we keep it at the top of the heap*/
else if (CHUNK_heap_pos < CHUNK_SIZE) /*there is enough allocated memory space available we keep it at the top of the heap*/
{
i=CHUNK_heap_pos++;
return(NZE_Mem_add[i]);
i = CHUNK_heap_pos++;
return (NZE_Mem_add[i]);
}
else /*We have to allocate extra memory space*/
{
CHUNK_SIZE+=CHUNK_BLCK_SIZE;
CHUNK_SIZE += CHUNK_BLCK_SIZE;
Nb_CHUNK++;
NZE_Mem=(NonZeroElem*)mxMalloc(CHUNK_BLCK_SIZE*sizeof(NonZeroElem)); /*The block of memory allocated*/
NZE_Mem = (NonZeroElem *) mxMalloc(CHUNK_BLCK_SIZE*sizeof(NonZeroElem)); /*The block of memory allocated*/
NZE_Mem_Allocated.push_back(NZE_Mem);
if(!NZE_Mem)
if (!NZE_Mem)
{
mexPrintf("Not enough memory available\n");
mexEvalString("drawnow;");
}
NZE_Mem_add=(NonZeroElem**)mxRealloc(NZE_Mem_add, CHUNK_SIZE*sizeof(NonZeroElem*)); /*We have to redefine the size of pointer on the memory*/
if(!NZE_Mem_add)
NZE_Mem_add = (NonZeroElem **) mxRealloc(NZE_Mem_add, CHUNK_SIZE*sizeof(NonZeroElem *)); /*We have to redefine the size of pointer on the memory*/
if (!NZE_Mem_add)
{
mexPrintf("Not enough memory available\n");
mexEvalString("drawnow;");
}
for (i=CHUNK_heap_pos;i<CHUNK_SIZE;i++)
for (i = CHUNK_heap_pos; i < CHUNK_SIZE; i++)
{
NZE_Mem_add[i]=(NonZeroElem*)(NZE_Mem+(i-CHUNK_heap_pos));
NZE_Mem_add[i] = (NonZeroElem *)(NZE_Mem+(i-CHUNK_heap_pos));
}
i=CHUNK_heap_pos++;
return(NZE_Mem_add[i]);
i = CHUNK_heap_pos++;
return (NZE_Mem_add[i]);
}
}
void
Mem_Mngr::mxFree_NZE(void* pos)
Mem_Mngr::mxFree_NZE(void *pos)
{
int i;
int i;
size_t gap;
for (i=0;i<Nb_CHUNK;i++)
for (i = 0; i < Nb_CHUNK; i++)
{
gap=((size_t)(pos)-(size_t)(NZE_Mem_add[i*CHUNK_BLCK_SIZE]))/sizeof(NonZeroElem);
if ((gap<CHUNK_BLCK_SIZE) && (gap>=0))
gap = ((size_t)(pos)-(size_t)(NZE_Mem_add[i*CHUNK_BLCK_SIZE]))/sizeof(NonZeroElem);
if ((gap < CHUNK_BLCK_SIZE) && (gap >= 0))
break;
}
Chunk_Stack.push_back((NonZeroElem*)pos);
Chunk_Stack.push_back((NonZeroElem *) pos);
}
void
Mem_Mngr::Free_All()
{
while(NZE_Mem_Allocated.size())
{
mxFree(NZE_Mem_Allocated.back());
NZE_Mem_Allocated.pop_back();
}
while (NZE_Mem_Allocated.size())
{
mxFree(NZE_Mem_Allocated.back());
NZE_Mem_Allocated.pop_back();
}
mxFree(NZE_Mem_add);
init_Mem();
}
......@@ -20,47 +20,46 @@
#ifndef MEM_MNGR_HH_INCLUDED
#define MEM_MNGR_HH_INCLUDED
#include <vector>
#include <fstream>
#ifndef DEBUG_EX
#include "mex.h"
# include "mex.h"
#else
#include "mex_interface.hh"
# include "mex_interface.hh"
#endif
using namespace std;
struct NonZeroElem
{
int u_index;
int r_index, c_index, lag_index;
NonZeroElem *NZE_R_N, *NZE_C_N;
};
{
int u_index;
int r_index, c_index, lag_index;
NonZeroElem *NZE_R_N, *NZE_C_N;
};
typedef vector<NonZeroElem*> v_NonZeroElem;
typedef vector<NonZeroElem *> v_NonZeroElem;
class Mem_Mngr
{
public:
void Print_heap();
void init_Mem();
void mxFree_NZE(void* pos);
NonZeroElem* mxMalloc_NZE();
void init_CHUNK_BLCK_SIZE(int u_count);
void Free_All();
Mem_Mngr();
void fixe_file_name(string filename_arg);
bool swp_f;
void Print_heap();
void init_Mem();
void mxFree_NZE(void *pos);
NonZeroElem *mxMalloc_NZE();
void init_CHUNK_BLCK_SIZE(int u_count);
void Free_All();
Mem_Mngr();
void fixe_file_name(string filename_arg);
bool swp_f;
private:
v_NonZeroElem Chunk_Stack;
int CHUNK_SIZE, CHUNK_BLCK_SIZE, Nb_CHUNK;
int CHUNK_heap_pos;
NonZeroElem** NZE_Mem_add;
NonZeroElem* NZE_Mem;
vector<NonZeroElem*> NZE_Mem_Allocated;
int swp_f_b;
fstream SaveCode_swp;
string filename;
v_NonZeroElem Chunk_Stack;
int CHUNK_SIZE, CHUNK_BLCK_SIZE, Nb_CHUNK;
int CHUNK_heap_pos;
NonZeroElem **NZE_Mem_add;
NonZeroElem *NZE_Mem;
vector<NonZeroElem *> NZE_Mem_Allocated;
int swp_f_b;
fstream SaveCode_swp;
string filename;
};
#endif
This diff is collapsed.
......@@ -37,35 +37,40 @@ using namespace std;
extern unsigned long _nan[2];
extern double NAN;
inline bool isnan(double value)
inline bool
isnan(double value)
{
return _isnan(value);
}
inline bool isinf(double value)
inline bool
isinf(double value)
{
return (std::numeric_limits<double>::has_infinity &&
value == std::numeric_limits<double>::infinity());
return (std::numeric_limits<double>::has_infinity
&& value == std::numeric_limits<double>::infinity());
}
template<typename T>
inline T asinh(T x)
inline T
asinh(T x)
{
return log(x+sqrt(x*x+1));
}
template<typename T>
inline T acosh(T x)
inline T
acosh(T x)
{
if (!(x>=1.0))
if (!(x >= 1.0))
return sqrt(-1.0);
return log(x+sqrt(x*x-1.0));
}
template<typename T>
inline T atanh(T x)
inline T
atanh(T x)
{
if(!(x>-1.0 && x<1.0))
if (!(x > -1.0 && x < 1.0))
return sqrt(-1.0);
return log((1.0+x)/(1.0-x))/2.0;
}
......@@ -78,108 +83,105 @@ struct t_save_op_s
int first, second;
};
const int IFLD =0;
const int IFDIV =1;
const int IFLESS=2;
const int IFSUB =3;
const int IFLDZ =4;
const int IFMUL =5;
const int IFSTP =6;
const int IFADD =7;
const double eps=1e-10;
const double very_big=1e24;
const int alt_symbolic_count_max=1;
const int IFLD = 0;
const int IFDIV = 1;
const int IFLESS = 2;
const int IFSUB = 3;
const int IFLDZ = 4;
const int IFMUL = 5;
const int IFSTP = 6;
const int IFADD = 7;
const double eps = 1e-10;
const double very_big = 1e24;
const int alt_symbolic_count_max = 1;
class SparseMatrix
{
public:
SparseMatrix();
int simulate_NG1(int blck, int y_size, int it_, int y_kmin, int y_kmax, int Size, int periods, bool print_it, bool cvg, int &iter, int minimal_solving_periods);
bool simulate_NG(int blck, int y_size, int it_, int y_kmin, int y_kmax, int Size, bool print_it, bool cvg, int &iter, bool steady_state);
void Direct_Simulate(int blck, int y_size, int it_, int y_kmin, int y_kmax, int Size, int periods, bool print_it, int iter);
void fixe_u(double **u, int u_count_int, int max_lag_plus_max_lead_plus_1);
void Read_SparseMatrix(string file_name, const int Size, int periods, int y_kmin, int y_kmax, bool steady_state, bool two_boundaries);
void Read_file(string file_name, int periods, int u_size1, int y_size, int y_kmin, int y_kmax, int &nb_endo, int &u_count, int &u_count_init, double* u);
private:
void Init(int periods, int y_kmin, int y_kmax, int Size, map<pair<pair<int, int> ,int>, int> &IM);
void ShortInit(int periods, int y_kmin, int y_kmax, int Size, map<pair<pair<int, int> ,int>, int> &IM);
void Simple_Init(int it_, int y_kmin, int y_kmax, int Size, std::map<std::pair<std::pair<int, int> ,int>, int> &IM);
void End(int Size);
bool compare( int *save_op, int *save_opa, int *save_opaa, int beg_t, int periods, long int nop4, int Size
{
public:
SparseMatrix();
int simulate_NG1(int blck, int y_size, int it_, int y_kmin, int y_kmax, int Size, int periods, bool print_it, bool cvg, int &iter, int minimal_solving_periods);
bool simulate_NG(int blck, int y_size, int it_, int y_kmin, int y_kmax, int Size, bool print_it, bool cvg, int &iter, bool steady_state);
void Direct_Simulate(int blck, int y_size, int it_, int y_kmin, int y_kmax, int Size, int periods, bool print_it, int iter);
void fixe_u(double **u, int u_count_int, int max_lag_plus_max_lead_plus_1);
void Read_SparseMatrix(string file_name, const int Size, int periods, int y_kmin, int y_kmax, bool steady_state, bool two_boundaries);
void Read_file(string file_name, int periods, int u_size1, int y_size, int y_kmin, int y_kmax, int &nb_endo, int &u_count, int &u_count_init, double *u);
private:
void Init(int periods, int y_kmin, int y_kmax, int Size, map<pair<pair<int, int>, int>, int> &IM);
void ShortInit(int periods, int y_kmin, int y_kmax, int Size, map<pair<pair<int, int>, int>, int> &IM);
void Simple_Init(int it_, int y_kmin, int y_kmax, int Size, std::map<std::pair<std::pair<int, int>, int>, int> &IM);
void End(int Size);
bool compare(int *save_op, int *save_opa, int *save_opaa, int beg_t, int periods, long int nop4, int Size
#ifdef PROFILER
, long int *ndiv, long int *nsub
, long int *ndiv, long int *nsub
#endif
);
void Insert(const int r, const int c, const int u_index, const int lag_index);
void Delete(const int r,const int c);
int At_Row(int r, NonZeroElem **first);
int At_Pos(int r, int c, NonZeroElem **first);
int At_Col(int c, NonZeroElem **first);
int At_Col(int c, int lag, NonZeroElem **first);
int NRow(int r);
int NCol(int c);
int Union_Row(int row1, int row2);
void Print(int Size,int *b);
int Get_u();
void Delete_u(int pos);
void Clear_u();
void Print_u();
void CheckIt(int y_size, int y_kmin, int y_kmax, int Size, int periods, int iter);
void Check_the_Solution(int periods, int y_kmin, int y_kmax, int Size, double *u, int* pivot, int* b);
int complete(int beg_t, int Size, int periods, int *b);
double bksub( int tbreak, int last_period, int Size, double slowc_l
);
void Insert(const int r, const int c, const int u_index, const int lag_index);
void Delete(const int r, const int c);
int At_Row(int r, NonZeroElem **first);
int At_Pos(int r, int c, NonZeroElem **first);
int At_Col(int c, NonZeroElem **first);
int At_Col(int c, int lag, NonZeroElem **first);
int NRow(int r);
int NCol(int c);
int Union_Row(int row1, int row2);
void Print(int Size, int *b);
int Get_u();
void Delete_u(int pos);
void Clear_u();
void Print_u();
void CheckIt(int y_size, int y_kmin, int y_kmax, int Size, int periods, int iter);
void Check_the_Solution(int periods, int y_kmin, int y_kmax, int Size, double *u, int *pivot, int *b);
int complete(int beg_t, int Size, int periods, int *b);
double bksub(int tbreak, int last_period, int Size, double slowc_l
#ifdef PROFILER
, long int *nmul
, long int *nmul
#endif
);
double simple_bksub(int it_, int Size, double slowc_l);
stack<double> Stack;
int nb_prologue_table_u, nb_first_table_u, nb_middle_table_u, nb_last_table_u;
int nb_prologue_table_y, nb_first_table_y, nb_middle_table_y, nb_last_table_y;
int middle_count_loop;
char type;
fstream SaveCode;
string filename;
int max_u, min_u;
clock_t time00;
Mem_Mngr mem_mngr;
vector<int> u_liste;
map<pair<int, int>,NonZeroElem*> Mapped_Array;
int *NbNZRow, *NbNZCol;
NonZeroElem **FNZE_R, **FNZE_C;
int nb_endo, u_count_init;
int *pivot, *pivotk, *pivot_save;
double *pivotv, *pivotva;
int *b;
bool *line_done;
bool symbolic, alt_symbolic;
int alt_symbolic_count;
int *g_save_op;
int first_count_loop;
int g_nop_all;
int u_count_alloc, u_count_alloc_save;
double markowitz_c_s;
double res1a;
long int nop_all, nop1, nop2;
map<pair<pair<int, int> ,int>, int> IM_i;
);
double simple_bksub(int it_, int Size, double slowc_l);
stack<double> Stack;
int nb_prologue_table_u, nb_first_table_u, nb_middle_table_u, nb_last_table_u;
int nb_prologue_table_y, nb_first_table_y, nb_middle_table_y, nb_last_table_y;
int middle_count_loop;
char type;
fstream SaveCode;
string filename;
int max_u, min_u;
clock_t time00;
Mem_Mngr mem_mngr;
vector<int> u_liste;
map<pair<int, int>, NonZeroElem *> Mapped_Array;
int *NbNZRow, *NbNZCol;
NonZeroElem **FNZE_R, **FNZE_C;
int nb_endo, u_count_init;
int *pivot, *pivotk, *pivot_save;
double *pivotv, *pivotva;
int *b;
bool *line_done;
bool symbolic, alt_symbolic;
int alt_symbolic_count;
int *g_save_op;
int first_count_loop;
int g_nop_all;
int u_count_alloc, u_count_alloc_save;
double markowitz_c_s;
double res1a;
long int nop_all, nop1, nop2;
map<pair<pair<int, int>, int>, int> IM_i;
protected:
double *u, *y, *ya;
double res1, res2, max_res, max_res_idx;
double slowc, slowc_save, markowitz_c;
int y_kmin, y_kmax, y_size, periods, y_decal;
int *index_vara, *index_equa;
int u_count, tbreak_g;
int iter;
double *direction;
int start_compare;
int restart;
bool error_not_printed;
};
double *u, *y, *ya;
double res1, res2, max_res, max_res_idx;
double slowc, slowc_save, markowitz_c;
int y_kmin, y_kmax, y_size, periods, y_decal;
int *index_vara, *index_equa;
int u_count, tbreak_g;
int iter;
double *direction;
int start_compare;
int restart;
bool error_not_printed;
};
#endif
This diff is collapsed.
......@@ -10,9 +10,9 @@ mexPrintf(const char *str, ...)
va_list args;
int retval;
va_start (args, str);
retval = vprintf (str, args);
va_end (args);
va_start(args, str);
retval = vprintf(str, args);
va_end(args);
return retval;
}
......@@ -25,24 +25,23 @@ mexErrMsgTxt(const string str)
}
void
mxFree(void* to_release)
mxFree(void *to_release)
{
free(to_release);
}
void*
void *
mxMalloc(int amount)
{
return malloc(amount);
}
void*
mxRealloc(void* to_extend, int amount)
void *
mxRealloc(void *to_extend, int amount)
{
return realloc(to_extend, amount);
}
void
mexEvalString(const string str)
{
......
......@@ -5,9 +5,9 @@
#include <stdarg.h>
using namespace std;
int mexPrintf(/*const string*/const char* str, ...);
int mexPrintf(/*const string*/ const char *str, ...);
void mexErrMsgTxt(const string str);
void* mxMalloc(int amount);
void* mxRealloc(void* to_extend, int amount);
void mxFree(void* to_release);
void *mxMalloc(int amount);
void *mxRealloc(void *to_extend, int amount);
void mxFree(void