Skip to content

Releases: libprima/prima

Version 0.7.2

08 Oct 17:42
Compare
Choose a tag to compare

Compared with v0.7.1, the major changes are as follows.

  1. Revise https://github.com/libprima/prima/blob/main/matlab/setup_tools/compile.m so that the MATLAB interface is thread-safe and recursion-safe, which are tested at https://github.com/zequipe/prima/actions/workflows/parallel_test_matlab.yml and https://github.com/zequipe/prima/actions/workflows/recursive_test_matlab.yml
  2. Revise infnan.F90 so that it works correctly with gfortran-13 -Ofast (see equipez/infnan#23).
  3. Set eta1, eta2, gamma1, and gamma2 explicitly in https://github.com/libprima/prima/blob/main/matlab/interfaces/private/preprima.m. Previously, they were set to NaN, which will be translated to the default values by the Fortran code. However, this will not work if is_nan does not work on the Fortran side, which did happen before point 2 was implemented if gfortran-13 is invoked with -Ofast. To avoid this problem, we set these parameters to the correct (default) values in the MATLAB interface.

Version 0.7.1

16 Sep 16:04
Compare
Choose a tag to compare

Compared with v0.7, this release mainly makes the following changes, both by Julien @jschueller .

  1. Export symbols for DLL on Windows using .def files for CMake, resolving #70.
  2. Remove the hint sizes in prima.h and prima.c, resolving JuliaInterop/Clang.jl#443, in order to generate Julia wrappers.

Version 0.7

15 Sep 17:58
Compare
Choose a tag to compare

Compared with the last release, the most important change is the C interface and CMake building system contributed by @jschueller .

In addition, we can now input the commit hash when manually invoking a workflow. This is instrumental when we want to re-produce the result of a previous run. Note, however, that we have to make sure that the runner has the same status as before in order to reproduce the result. This may not be the case if we use actions like free-disk-space in the workflow now but not before. See b25e404 and jlumbroso/free-disk-space#12.

pl in the Fortran implementation of UOBYQA is changed to an allocatable array.

Version 0.6.2

15 Aug 14:33
Compare
Choose a tag to compare

Compared to the last release, this one updates hypotenuse, and changes nlconstr in fortran/cobyla/cobyla.f90 from an allocatable array to an automatic one.

Version 0.6.1

09 Aug 08:22
Compare
Choose a tag to compare

This release removed some large files that were added mistakenly.

Version 0.6

04 Aug 14:45
Compare
Choose a tag to compare

Compared to v0.5.1, the major changes are as follows.

  1. lincoa now supports the following constraints:
Aineq*x <= bineq, Aeq*x = beq, xl <= x <= xu
  1. cobyla now supports the following constraints:
nlconstr(x) <= 0, Aineq*x <= bineq, Aeq*x = beq, xl <= x <= xu

N.B.:
2.1. In Powell's implementation of cobyla, the constraints are constr(x) >= 0, where constr is a vector-valued function that wraps all constraints. In contrast, the nonlinear constraints we consider are nlconstr(x) <=0 (not >=0).
2.2. cobyla does not support nonlinear equality constraints directly. Such a constraint has to be wrapped as two inequality constraints before being passed to the Fortran code. The wrapping is left to be done by the MATLAB/Python/R/Julia interface. The MATLAB interface already does so.

  1. constr_modified is removed from the output of matlab/lincoa, so is the warning "%s:ConstraintModified".

Version 0.5.1

01 Jul 03:46
Compare
Choose a tag to compare

Compared with Version 0.5, this release implements the following.

  1. Change the while loop in bobyqa/rescue.f90 to a do loop, completely eliminating the possibility of infinite cyclings.
  2. Change the default value of ctol from EPS to sqrt(EPS). ctol is used only by lincoa and cobyla in selectx when selecting the iterate to return. It is not used during the iterations of any algorithm.
  3. Implement stress tests on large problems. The tests verify that PRIMA does not run into errors even if invoked on problems that are much larger than the dimension PRIMA can effectively handle.
  4. Add -heap-arrays and /heap-arrays to the compilation options in compile.m for macOS and Windows, respectively, with the Intel compiler. Without this, PRIMA will encounter stack overflows when handling large problems.

Version 0.5

18 Jun 17:30
Compare
Choose a tag to compare

Compared to Version 0.4, the major changes are as follows.

  1. Use newunit in fprint.f90, addressing #22.
  2. Revise fprint.f90 to fix "buffer overflow" detected by nagfor. See 311f2b3.
  3. cobyla is modified as follows concerning cpen.
    • Implement the update of cpen in cobylb.f90 into a function getcpen, eliminating a cycle in the code. The flow of the algorithm becomes simpler.
    • Impose cpen >= cpenmin > 0, while Powell's code allows cpen = 0.
    • The initialization of cpen takes into account fcratio, while Powell's code initializes it to zero.
  4. Implement the boolean variable trfail.
    • For newuoa/bobyqa/lincoa, trfail = .not. (qred > 1.0E-5_RP * rho**2) . In previous versions, trfail is essentially .not. (qred > 0) even though it was not defined explicitly.
    • For uobyqa, trfail = .not. (qred > EPS * rho**2). In previous versions, trfail is essentially .not. (qred > 0) even though it was not defined explicitly.
    • For cobyla, trfail = .not. (prerem > min(ONE, cpen) * rho**2). In previous versions, trfail is essentially .not. (max(prerec, preref) > 0) even though it was not defined explicitly.
  5. cobyla now tries the last trust-region step before returning, if this step was too short to try before.
  6. The linting of Fortran and MEX gateways is now done on GitHub-hosted runners, except for the lining by nagfor.

N.B.: This version still retains the RESCUE and IDZ techniques in Powell's original implementation. See the release notes of Version 0.3 for more details.

Version 0.4

12 May 17:18
Compare
Choose a tag to compare

Compared to Version 0.3, the major changes are as follows. Except for the first one, they are all improvements on the MATLAB interface rather than the Fortran code. This release also removes large unwanted files in the history of the repo, making its size reduced from 100+MB to ~15MB.

  1. The definition of weight in cobyla/setdrop_tr was buggy (our implementation of this function is completely different from the one by Powell, so Powell's original code does not have this problem). The problematic code was adopted from LINCOA, which does not have the same problem due to the definition of xopt in this function. The bug has been fixed. See the comment in lincoa/setdrop_tr.

  2. If lb contains NaN, then we raise a warning "INVOKER:NaNInLB" and regard the constraints as infeasible. The same for ub. See the function pre_bcon in preprima.m. This is consistent with the behavior of NaN in the floating point number system. In previous versions, the NaN in bounds is considered as no bound.

  3. If Aineq or bineq contains NaN, then we raise a warning "INVOKER:NaNInequality" and regard the constraints as infeasible. Similar for Aeq and beq. See the function pre_lcon in preprima.m.

  4. If Aineq contains infinite values, or bineq = -Inf, then we raise a warning "INVOKER:InfInequality" and regard the constraints as infeasible. Similar for Aeq and beq. See the function pre_lcon in preprima.m.

  5. We allow x0, bineq, beq to be rows. See the functions pre_x0, pre_lcon, pre_fun, pre_nonlcon in preprima.m. No matter whether they are rows or columns, we always require size(Aineq) = [length(bineq), length(x0)] and size(Aeq) = [length(beq), length(x0)]. This is consistent with the behavior of fmincon. We raise warnings "INVOKER:X0IsRow", "INVOKER:BineqIsRow", or "INVOKER:BeqIsRow" if they are rows.

  6. iprint is fully implemented. The MATLAB version behaves exactly as the Fortran version regarding iprint, except if classical is true, in which case the MATLAB version does not support a nonzero iprint.

  7. testprima: perturb is changed to eps the perturbation of x0 is changed to

        x0 = x0 + perturb*max(norm(x0), 1)*r/norm(r);

    In addition, the following is added to lines 122–124 to test iprint:

        if ~release  % 20230508: Test the newly implemented iprint.
            problem.options.iprint = round(4*(2*rand() - 1));
        end

N.B.: This version still retains the RESCUE and IDZ techniques in Powell's original implementation. See the release notes of Version 0.3 for more details.

Version 0.3

17 Apr 03:23
Compare
Choose a tag to compare

This version provides miscellaneous improvements upon the last one. The major changes are as follows.

  • Start profiling the solvers under various compilation options (-O1, -O2, -Ofast, etc). This is to ensure that the modernized solvers' good performance does not depend on a specific optimization level.
  • Start profiling LINCOA and COBYLA with and without the optimization toolbox of MATLAB. The preprocessing of linearly constrained problems makes use of the toolbox if available. This is to make sure that its availability does not affect the good performance of the modernized solvers.
  • Start profiling the LINCOA and COBYLA with multiple penalty parameters in the merit function. This is to make sure that the good performance of the modernized solvers holds for a wide range of penalty parameters.
  • Implement start_time and end_time in the MATLAB tests. This helps us to monitor which problem takes excessive time or fails, which is nontrivial to detect if the problems are solved in parallel.
  • Implement GAMMA3 in the Fortran code. This is the threshold for testing whether DELTA is close enough to RHO after an update (if yes, DELTA will be reset to RHO).
  • Enable automatic spell-check using https://github.com/marketplace/actions/check-spelling
  • Switch the default Fortran standard to Fortran 2008, and drop the support for Fortran 2003.
  • Use the iso_fortran_env intrinsic module, especially for REAL64, INT32, etc.
  • Use the storage_size intrinsic function.
  • Use allocated characters for variable-length strings.
  • Use ERROR STOP instead of STOP in ERRSTOP. We prefer the former because it is more appropriate in this scenario, and, more importantly, Fortran 2018 allows ERROR STOP in PURE procedures, which enables us to achieve the purity of all functions later when we switch the default Fortran standard to Fortran 2018.

In addition, we also profile BOBYQA, NEWUOAand LINCOA with and without RESCUE / IDZ techniques to see how much difference it makes. See benchmarking/rescue_idz/ for the results. According to the test on 20230406, the techniques affect the performance only marginally. The settings of the test are as follows.

  1. Test problems: the CUTEst set.
  2. Maximum dimension: 200.
  3. Maximum number of linear constraints for LINCOA: 20000.
  4. Tested features: plain, randomizex0-eps, perm, single, dnoise-1.0e-6, signif5, noise-1.0e-4.
  5. Number of random tests when applicable: 3.
  6. RHOEND: 1.0e-8.
  7. Maximum number of function evaluations: 500*dimension.
  8. Tolerance for the convergence tests in the performance profiles: 10^{-i}, i = 1, ..., 16.

Note that we purposely set the stopping criteria and convergence tolerance to observe the long-term behavior of the algorithms, as the techniques under consideration do not take effect unless we ask for very high precision.

The result: RESCUE and IDZ do not affect the performance of the algorithms significantly. For the classical version (i.e., Powell's implementation), the difference is barely observable. For the modernized version, the difference is more obvious, but still not significant.

Therefore, it seems safe to ignore these two techniques in the first implementation of algorithms based on the derivative-free PSB.

We plan to remove IDZ from NEWUOA and LINCOA, and modify the code of NEWUOA, BOYQA, and LINCOA to use RESCUE as a restarting technique. This will significantly simplify the code, and possibly unify the updating subroutines as well as shiftbase. We will also make sure that the modification will improve the performance of the solvers. If this is implemented, then the current release is the last version that implements Powell's original RESCUE and IDZ techniques.

Update 20230510: Version 0.4 still retains RESCUE and IDZ.