diff --git a/src/scopflow/solver/hiop/scopflow_hiop.cpp b/src/scopflow/solver/hiop/scopflow_hiop.cpp index 1aee91be..7dcfa19a 100644 --- a/src/scopflow/solver/hiop/scopflow_hiop.cpp +++ b/src/scopflow/solver/hiop/scopflow_hiop.cpp @@ -155,7 +155,7 @@ extern PetscErrorCode SCOPFLOWUpdateOPFLOWVariableBounds(OPFLOW, Vec, Vec, /* Note: x only holds the coupled variables which, in this case, are the generator real power variables for the base-case */ -bool SCOPFLOWHIOPInterface::eval_f_rterm(size_t idx, const int &n, +bool SCOPFLOWHIOPInterface::eval_f_rterm(hiop::size_type idx, const int &n, const double *x, double &rval) { PetscErrorCode ierr; OPFLOW opflow0; /* base case OPFLOW */ @@ -245,7 +245,8 @@ bool SCOPFLOWHIOPInterface::eval_f_rterm(size_t idx, const int &n, return true; } -bool SCOPFLOWHIOPInterface::eval_grad_rterm(size_t idx, const int &n, double *x, +bool SCOPFLOWHIOPInterface::eval_grad_rterm(hiop::size_type idx, const int &n, + double *x, hiop::hiopVector &gradvec) { (void)idx; (void)n; @@ -310,12 +311,12 @@ bool SCOPFLOWHIOPInterface::eval_grad_rterm(size_t idx, const int &n, double *x, return true; } -size_t SCOPFLOWHIOPInterface::get_num_rterms() const { - return scopflow->Nc - 1; +hiop::size_type SCOPFLOWHIOPInterface::get_num_rterms() const { + return (hiop::size_type)scopflow->Nc - 1; } -size_t SCOPFLOWHIOPInterface::get_num_vars() const { - return scopflow->opflow0->nx; +hiop::size_type SCOPFLOWHIOPInterface::get_num_vars() const { + return (hiop::size_type)scopflow->opflow0->nx; } void SCOPFLOWHIOPInterface::get_solution(double *x) const { diff --git a/src/scopflow/solver/hiop/scopflow_hiop.h b/src/scopflow/solver/hiop/scopflow_hiop.h index b01f50b4..834cb2ff 100644 --- a/src/scopflow/solver/hiop/scopflow_hiop.h +++ b/src/scopflow/solver/hiop/scopflow_hiop.h @@ -23,13 +23,14 @@ class SCOPFLOWHIOPInterface : public hiop::hiopInterfacePriDecProblem { const double *hess, const char *master_options_file); - bool eval_f_rterm(size_t idx, const int &n, const double *x, double &rval); - bool eval_grad_rterm(size_t idx, const int &n, double *x, + bool eval_f_rterm(hiop::size_type idx, const int &n, const double *x, + double &rval); + bool eval_grad_rterm(hiop::size_type idx, const int &n, double *x, hiop::hiopVector &grad); - size_t get_num_rterms() const; + hiop::size_type get_num_rterms() const; - size_t get_num_vars() const; + hiop::size_type get_num_vars() const; void get_solution(double *x) const; diff --git a/src/sopflow/solver/hiop/sopflow_hiop.cpp b/src/sopflow/solver/hiop/sopflow_hiop.cpp index c5cd759a..8b933ca5 100644 --- a/src/sopflow/solver/hiop/sopflow_hiop.cpp +++ b/src/sopflow/solver/hiop/sopflow_hiop.cpp @@ -164,7 +164,7 @@ extern PetscErrorCode SOPFLOWUpdateOPFLOWVariableBounds(OPFLOW, Vec, Vec, /* Note: x only holds the coupled variables which, in this case, are the generator real power variables for the base-case */ -bool SOPFLOWHIOPInterface::eval_f_rterm(size_t idx, const int &n, +bool SOPFLOWHIOPInterface::eval_f_rterm(hiop::size_type idx, const int &n, const double *x, double &rval) { (void)n; PetscErrorCode ierr; @@ -283,7 +283,8 @@ bool SOPFLOWHIOPInterface::eval_f_rterm(size_t idx, const int &n, return true; } -bool SOPFLOWHIOPInterface::eval_grad_rterm(size_t idx, const int &n, double *x, +bool SOPFLOWHIOPInterface::eval_grad_rterm(hiop::size_type idx, const int &n, + double *x, hiop::hiopVector &gradvec) { (void)idx; (void)n; @@ -349,11 +350,11 @@ bool SOPFLOWHIOPInterface::eval_grad_rterm(size_t idx, const int &n, double *x, return true; } -size_t SOPFLOWHIOPInterface::get_num_rterms() const { +hiop::size_type SOPFLOWHIOPInterface::get_num_rterms() const { return (sopflow->Ns * sopflow->Nc) - 1; } -size_t SOPFLOWHIOPInterface::get_num_vars() const { +hiop::size_type SOPFLOWHIOPInterface::get_num_vars() const { return sopflow->opflow0->nx; } diff --git a/src/sopflow/solver/hiop/sopflow_hiop.h b/src/sopflow/solver/hiop/sopflow_hiop.h index b3f32d69..0aab4ffd 100644 --- a/src/sopflow/solver/hiop/sopflow_hiop.h +++ b/src/sopflow/solver/hiop/sopflow_hiop.h @@ -24,13 +24,14 @@ class SOPFLOWHIOPInterface : public hiop::hiopInterfacePriDecProblem { const double *hess, const char *master_options_file); - bool eval_f_rterm(size_t idx, const int &n, const double *x, double &rval); - bool eval_grad_rterm(size_t idx, const int &n, double *x, + bool eval_f_rterm(hiop::size_type idx, const int &n, const double *x, + double &rval); + bool eval_grad_rterm(hiop::size_type idx, const int &n, double *x, hiop::hiopVector &grad); - size_t get_num_rterms() const; + hiop::size_type get_num_rterms() const; - size_t get_num_vars() const; + hiop::size_type get_num_vars() const; void get_solution(double *x) const;