Bytecode: remove warnings about narrowing (-Wnarrowing)

kalman-mex
Sébastien Villemot 2023-10-16 17:58:36 -04:00
parent b0fa610357
commit 651fed87be
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
3 changed files with 7 additions and 7 deletions

View File

@ -28,7 +28,7 @@
constexpr double BIG = 1.0e+8, SMALL = 1.0e-5;
Interpreter::Interpreter(Evaluate &evaluator_arg, double *params_arg, double *y_arg, double *ya_arg, double *x_arg, double *steady_y_arg,
double *direction_arg, size_t y_size_arg,
double *direction_arg, int y_size_arg,
size_t nb_row_x_arg, int periods_arg, int y_kmin_arg, int y_kmax_arg,
int maxit_arg_, double solve_tolf_arg, int y_decal_arg, double markowitz_c_arg,
string &filename_arg, int minimal_solving_periods_arg, int stack_solve_algo_arg, int solve_algo_arg,

View File

@ -52,7 +52,7 @@ protected:
string elastic(string str, unsigned int len, bool left);
public:
Interpreter(Evaluate &evaluator_arg, double *params_arg, double *y_arg, double *ya_arg, double *x_arg, double *steady_y_arg,
double *direction_arg, size_t y_size_arg,
double *direction_arg, int y_size_arg,
size_t nb_row_x_arg, int periods_arg, int y_kmin_arg, int y_kmax_arg,
int maxit_arg_, double solve_tolf_arg, int y_decal_arg, double markowitz_c_arg,
string &filename_arg, int minimal_solving_periods_arg, int stack_solve_algo_arg, int solve_algo_arg,

View File

@ -55,7 +55,7 @@ Get_Arguments_and_global_variables(int nrhs,
double *xd[], size_t &row_x, size_t &col_x,
double *params[],
double *steady_yd[], size_t &steady_row_y, size_t &steady_col_y,
unsigned int &periods,
int &periods,
mxArray **block_structur,
bool &steady_state, bool &block_decomposed,
bool &evaluate, int &block,
@ -181,7 +181,7 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
size_t i, row_y = 0, col_y = 0, row_x = 0, col_x = 0;
size_t steady_row_y, steady_col_y;
int y_kmin = 0, y_kmax = 0, y_decal = 0;
unsigned int periods = 1;
int periods {1};
double *direction;
bool steady_state = false;
bool block_decomposed {false};
@ -503,11 +503,11 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+ (steady_state ? "static" : "dynamic") + ".cod"};
Evaluate evaluator {codfile, steady_state, symbol_table};
Interpreter interprete {evaluator, params, y, ya, x, steady_yd, direction, row_y, row_x,
Interpreter interprete {evaluator, params, y, ya, x, steady_yd, direction, static_cast<int>(row_y), row_x,
periods, y_kmin, y_kmax, maxit_, solve_tolf, y_decal,
markowitz_c, file_name, minimal_solving_periods, stack_solve_algo,
solve_algo, global_temporary_terms, print, GlobalTemporaryTerms,
steady_state, block_decomposed, col_x, col_y, symbol_table, verbosity};
steady_state, block_decomposed, static_cast<int>(col_x), static_cast<int>(col_y), symbol_table, verbosity};
bool r;
vector<int> blocks;
@ -531,7 +531,7 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
vector<double> residual = interprete.get_residual();
plhs[0] = mxCreateDoubleMatrix(static_cast<int>(residual.size()/periods),
static_cast<int>(periods), mxREAL);
periods, mxREAL);
std::copy(residual.begin(), residual.end(), mxGetPr(plhs[0]));
}
else