Skip to content

Commit

Permalink
fix declaration of MA57 API for case of long integers (FUNNY_MA57_INT)
Browse files Browse the repository at this point in the history
- use ma57int instead of ipindex
  • Loading branch information
svigerske committed Nov 15, 2023
1 parent 6d060c0 commit a8e153f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 49 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ More detailed information about incremental changes can be found in the

### 3.14.14 (202x-yy-zz)

- Fixed build of MA57 interface when `FUNNY_MA57_FINT` is defined (MA57 with long integers).

### 3.14.13 (2023-11-08)

- Reduced priority for making Spral the default value for option linear_solver [#677].
Expand Down
8 changes: 4 additions & 4 deletions src/Algorithm/LinearSolvers/IpMa57TSolverInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ ESymSolverStatus Ma57TSolverInterface::SymbolicFactorization(

wd_lfact_ = 0;
wd_lifact_ = 0;
ComputeMemIncrease(wd_lfact_, (Number)wd_info_[8] * ma57_pre_alloc_, 0, "double working space for MA57");
ComputeMemIncrease(wd_lifact_, (Number)wd_info_[9] * ma57_pre_alloc_, 0, "integer working space for MA57");
ComputeMemIncrease(wd_lfact_, (Number)wd_info_[8] * ma57_pre_alloc_, (ma57int)0, "double working space for MA57");
ComputeMemIncrease(wd_lifact_, (Number)wd_info_[9] * ma57_pre_alloc_, (ma57int)0, "integer working space for MA57");

// XXX MH: Why is this necessary? Is `::Factorization' called more
// than once per object lifetime? Where should allocation take
Expand Down Expand Up @@ -652,7 +652,7 @@ ESymSolverStatus Ma57TSolverInterface::Factorization(
Number* temp;
ma57int ic = 0;

ComputeMemIncrease(wd_lfact_, (Number)wd_info_[16] * ma57_pre_alloc_, 0, "double working space for MA57");
ComputeMemIncrease(wd_lfact_, (Number)wd_info_[16] * ma57_pre_alloc_, (ma57int)0, "double working space for MA57");
Jnlst().Printf(J_WARNING, J_LINEAR_ALGEBRA,
"Reallocating memory for MA57: lfact (%" IPOPT_INDEX_FORMAT ")\n", wd_lfact_);

Expand Down Expand Up @@ -684,7 +684,7 @@ ESymSolverStatus Ma57TSolverInterface::Factorization(
ma57int* temp;
ma57int ic = 1;

ComputeMemIncrease(wd_lifact_, (Number)wd_info_[17] * ma57_pre_alloc_, 0, "integer working space for MA57");
ComputeMemIncrease(wd_lifact_, (Number)wd_info_[17] * ma57_pre_alloc_, (ma57int)0, "integer working space for MA57");
temp = new ma57int[wd_lifact_];

Jnlst().Printf(J_DETAILED, J_LINEAR_ALGEBRA,
Expand Down
90 changes: 45 additions & 45 deletions src/Algorithm/LinearSolvers/IpMa57TSolverInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,35 @@ typedef ipindex ma57int;

/// @since 3.14.0
#define IPOPT_DECL_MA57A(x) void (x)( \
ipindex* n, /**< Order of matrix. */ \
ipindex* ne, /**< Number of entries. */ \
const ipindex* irn, /**< Matrix nonzero row structure */ \
const ipindex* jcn, /**< Matrix nonzero column structure */ \
ipindex* lkeep, /**< Workspace for the pivot order of lenght 3*n */ \
ipindex* keep, /**< Workspace for the pivot order of lenght 3*n */ \
ma57int* n, /**< Order of matrix. */ \
ma57int* ne, /**< Number of entries. */ \
const ma57int* irn, /**< Matrix nonzero row structure */ \
const ma57int* jcn, /**< Matrix nonzero column structure */ \
ma57int* lkeep, /**< Workspace for the pivot order of lenght 3*n */ \
ma57int* keep, /**< Workspace for the pivot order of lenght 3*n */ \
/* Automatically iflag = 0; ikeep pivot order iflag = 1 */ \
ipindex* iwork, /**< Integer work space. */ \
ipindex* icntl, /**< Integer Control parameter of length 30 */ \
ipindex* info, /**< Statistical Information; Integer array of length 20 */ \
ma57int* iwork, /**< Integer work space. */ \
ma57int* icntl, /**< Integer Control parameter of length 30 */ \
ma57int* info, /**< Statistical Information; Integer array of length 20 */ \
ipnumber* rinfo /**< Double Control parameter of length 5 */ \
)

/// @since 3.14.0
#define IPOPT_DECL_MA57B(x) void (x)( \
ipindex* n, /**< Order of matrix. */ \
ipindex* ne, /**< Number of entries. */ \
ipnumber* a, /**< Numerical values. */ \
ipnumber* fact, /**< Entries of factors. */ \
ipindex* lfact, /**< Length of array `fact'. */ \
ipindex* ifact, /**< Indexing info for factors. */ \
ipindex* lifact, /**< Length of array `ifact'. */ \
ipindex* lkeep, /**< Length of array `keep'. */ \
ipindex* keep, /**< Integer array. */ \
ipindex* iwork, /**< Workspace of length `n'. */ \
ipindex* icntl, /**< Integer Control parameter of length 20. */ \
ipnumber* cntl, /**< Double Control parameter of length 5. */ \
ipindex* info, /**< Statistical Information; Integer array of length 40. */ \
ipnumber* rinfo /**< Statistical Information; Real array of length 20. */ \
ma57int* n, /**< Order of matrix. */ \
ma57int* ne, /**< Number of entries. */ \
ipnumber* a, /**< Numerical values. */ \
ipnumber* fact, /**< Entries of factors. */ \
ma57int* lfact, /**< Length of array `fact'. */ \
ma57int* ifact, /**< Indexing info for factors. */ \
ma57int* lifact, /**< Length of array `ifact'. */ \
ma57int* lkeep, /**< Length of array `keep'. */ \
ma57int* keep, /**< Integer array. */ \
ma57int* iwork, /**< Workspace of length `n'. */ \
ma57int* icntl, /**< Integer Control parameter of length 20. */ \
ipnumber* cntl, /**< Double Control parameter of length 5. */ \
ma57int* info, /**< Statistical Information; Integer array of length 40. */ \
ipnumber* rinfo /**< Statistical Information; Real array of length 20. */ \
)

/* Solution job: Solve for...
Expand All @@ -61,42 +61,42 @@ typedef ipindex ma57int;
*/
/// @since 3.14.0
#define IPOPT_DECL_MA57C(x) void (x)( \
ipindex* job, /**< Solution job. */ \
ipindex* n, /**< Order of matrix. */ \
ma57int* job, /**< Solution job. */ \
ma57int* n, /**< Order of matrix. */ \
ipnumber* fact, /**< Entries of factors. */ \
ipindex* lfact, /**< Length of array `fact'. */ \
ipindex* ifact, /**< Indexing info for factors. */ \
ipindex* lifact, /**< Length of array `ifact'. */ \
ipindex* nrhs, /**< Number of right hand sides. */ \
ma57int* lfact, /**< Length of array `fact'. */ \
ma57int* ifact, /**< Indexing info for factors. */ \
ma57int* lifact, /**< Length of array `ifact'. */ \
ma57int* nrhs, /**< Number of right hand sides. */ \
ipnumber* rhs, /**< Numerical Values. */ \
ipindex* lrhs, /**< Leading dimensions of `rhs'. */ \
ma57int* lrhs, /**< Leading dimensions of `rhs'. */ \
ipnumber* work, /**< Real workspace. */ \
ipindex* lwork, /**< Length of `work', >= N*NRHS. */ \
ipindex* iwork, /**< Integer array of length `n'. */ \
ipindex* icntl, /**< Integer Control parameter array of length 20. */ \
ipindex* info /**< Statistical Information; Integer array of length 40. */ \
ma57int* lwork, /**< Length of `work', >= N*NRHS. */ \
ma57int* iwork, /**< Integer array of length `n'. */ \
ma57int* icntl, /**< Integer Control parameter array of length 20. */ \
ma57int* info /**< Statistical Information; Integer array of length 40. */ \
)

/// @since 3.14.0
#define IPOPT_DECL_MA57E(x) void (x)( \
ipindex* n, \
ipindex* ic, /**< 0: copy real array. >=1: copy integer array. */ \
ipindex* keep, \
ma57int* n, \
ma57int* ic, /**< 0: copy real array. >=1: copy integer array. */ \
ma57int* keep, \
ipnumber* fact, \
ipindex* lfact, \
ma57int* lfact, \
ipnumber* newfac, \
ipindex* lnew, \
ipindex* ifact, \
ipindex* lifact, \
ipindex* newifc, \
ipindex* linew, \
ipindex* info \
ma57int* lnew, \
ma57int* ifact, \
ma57int* lifact, \
ma57int* newifc, \
ma57int* linew, \
ma57int* info \
)

/// @since 3.14.0
#define IPOPT_DECL_MA57I(x) void (x)( \
ipnumber* cntl, \
ipindex* icntl \
ma57int* icntl \
)

namespace Ipopt
Expand Down

0 comments on commit a8e153f

Please sign in to comment.