{"id":13686629,"url":"https://github.com/libprima/prima","last_synced_at":"2025-05-16T05:05:30.827Z","repository":{"id":37389797,"uuid":"271259503","full_name":"libprima/prima","owner":"libprima","description":"PRIMA is a package for solving general nonlinear optimization problems without using derivatives. It provides the reference implementation for Powell's derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. PRIMA means Reference Implementation for Powell's methods with Modernization and Amelioration,  P for Powell.","archived":false,"fork":false,"pushed_at":"2025-05-03T09:04:26.000Z","size":21490,"stargazers_count":348,"open_issues_count":51,"forks_count":43,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-13T09:09:18.225Z","etag":null,"topics":["blackbox-optimization","bobyqa","cobyla","constrained-optimization","derivative-free-optimization","lincoa","matlab","modern-fortran","newuoa","nonlinear-optimization","numerical-optimization","optimization","powell","prima","python","simulation-based-optimization","unconstrained-optimization","uobyqa","zeroth-order-method"],"latest_commit_sha":null,"homepage":"http://libprima.net","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libprima.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-10T11:33:09.000Z","updated_at":"2025-05-03T09:04:29.000Z","dependencies_parsed_at":"2024-03-23T12:07:15.633Z","dependency_job_id":"36b84046-d807-4f4d-904a-33da263012d0","html_url":"https://github.com/libprima/prima","commit_stats":{"total_commits":5228,"total_committers":9,"mean_commits":580.8888888888889,"dds":"0.038829380260137714","last_synced_commit":"c3688239fdbceafb526ef6e0a02cd26d7064fdae"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libprima%2Fprima","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libprima%2Fprima/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libprima%2Fprima/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libprima%2Fprima/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libprima","download_url":"https://codeload.github.com/libprima/prima/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blackbox-optimization","bobyqa","cobyla","constrained-optimization","derivative-free-optimization","lincoa","matlab","modern-fortran","newuoa","nonlinear-optimization","numerical-optimization","optimization","powell","prima","python","simulation-based-optimization","unconstrained-optimization","uobyqa","zeroth-order-method"],"created_at":"2024-08-02T15:00:36.400Z","updated_at":"2025-05-16T05:05:25.818Z","avatar_url":"https://github.com/libprima.png","language":"Fortran","readme":"\u003ch2 align=\"center\"\u003ePRIMA: Reference Implementation for Powell's Methods with Modernization and Amelioration\u003c/h2\u003e\n\u003cp align=\"center\"\u003eDedicated to the late Professor \u003cb\u003e\u003ca href=\"https://www.zhangzk.net/powell.html\"\u003eM. J. D. Powell\u003c/a\u003e\u003c/b\u003e FRS (1936--2015)\u003c/p\u003e\n\n- [What](#what)\n- [Why](#why)\n- [How](#how)\n- [Current status](#current-status)\n    - [Modern Fortran](#modern-fortran)\n    - [C](#c)\n    - [Python](#python)\n    - [MATLAB](#matlab)\n    - [Julia](#julia)\n    - [Other languages](#other-languages)\n- [Bug fixes](#bug-fixes)\n- [Improvements](#improvements)\n- [Who was Powell?](#who-was-powell)\n- [A \"fun\" fact](#a-fun-fact)\n- [Acknowledgment](#acknowledgment)\n- [Citing PRIMA](#citing-prima)\n- [Charityware](#charityware)\n- [Contact](#contact)\n- [Mirrors](#mirrors)\n    - [Gitee](https://gitee.com/libprima/prima)\n    - [GitHub](https://github.com/libprima/prima)\n    - [GitLab](https://gitlab.com/libprima/prima)\n- [Star history](#star-history)\n\n\n### What\n\nPRIMA is a package for **solving general nonlinear optimization problems without using derivatives**.\nIt provides the reference implementation for Powell's renowned derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA.\nThe \"P\" in the name stands for [**P**owell](https://www.zhangzk.net/powell.html),\nand \"RIMA\" is an acronym for \"**R**eference **I**mplementation with **M**odernization and **A**melioration\".\n\nThe current version is ready to be used [in Fortran](#modern-fortran), [in C](#c),\n[in Python](https://github.com/libprima/prima#python),\n[in MATLAB](https://github.com/libprima/prima/blob/main/README_mat.md),\nand [in Julia](https://juliahub.com/ui/Packages/General/PRIMA).\n\nPRIMA was initiated by [Zaikun Zhang](https://www.zhangzk.net) in July 2020, based on\nthe [PDFO](https://www.pdfo.net) package.\n\nSee [Zaikun Zhang's talk](https://raw.githubusercontent.com/ztalks/20230825-iciam23/main/20230825-iciam.pdf)\non PRIMA at [The 10th International Congress on Industrial and Applied Mathematics](https://iciam2023.org/) for more information.\n\n\n### Why\n\nProfessor Powell carefully implemented his derivative-free optimization methods into publicly available solvers,\nwhich are genuine masterpieces. They are widely used by engineers and scientists. For instance,\nsee Section 1 of [a recent paper on Powell's solvers](https://arxiv.org/pdf/2302.13246.pdf)\nas well as the Google searches of [COBYLA](https://www.google.com/search?q=cobyla)\nand [BOBYQA](https://www.google.com/search?q=bobyqa).\n\nHowever, Professor Powell's implementation was done in [Fortran 77](./fortran/original).\nThe code is nontrivial to understand or maintain, let alone extend.\nFor many practitioners, this has become an obstacle to exploiting these solvers in their\napplications. Even worse, it has hindered researchers from exploring the wealth left by Professor\nPowell. By all means, it is\n[necessary to make the solvers available in languages other than Fortran](https://permalink.lanl.gov/object/tr?what=info:lanl-repo/lareport/LA-UR-23-23992)\npromptly, first wrapping Powell's code, which is the objective of [PDFO](https://www.pdfo.net),\nand then providing native and modernized implementations, which is the mission of PRIMA.\n\nBefore he passed, Professor Powell had asked me and\n[Professor Nick Gould](https://www.numerical.rl.ac.uk/people/nimg) to maintain his solvers.\nThis is an honorable mission. To make the solvers more accessible, I started PRIMA.\nIt is a project similar to the translation, interpretation, and annotation of Euclid’s\n*Elements*. It will make Powell's solvers easily understandable to everyone, not only the experts.\nFew people remember [who translated *Elements*](https://en.wikipedia.org/wiki/Euclid%27s_Elements#Translations),\nbut it is a job that must be done.\n\nPRIMA aims to provide the reference implementation of Powell's methods in modern languages,\nincluding [**modern** Fortran](https://fortran-lang.org) (F2008 or newer), C/C++, Python, MATLAB,\nJulia, and R. It will be a **faithful** implementation, in the sense that the code will be\nmathematically equivalent to Powell’s, **except for** the\n[bug fixes](#bug-fixes) and [improvements](#improvements) made intentionally.\n\nThe focus is to implement these methods in a **structured** and **modularized** way so that they\nare **understandable**, **maintainable**, **extendable**, **fault-tolerant**, and **future-proof**.\nThe code will **have no GOTO** (of course)\nand will **use matrix-vector procedures instead of loops** whenever possible.\nIn doing so, PRIMA codes the algorithms **in a way that we would present them on a blackboard**.\nSuch an implementation will enable us to get a deeper understanding of Powell's methods and\npave the way for new developments based on them.\n\nThere do exist \"translations\" of Powell's Fortran 77 code in other languages. For example,\n[NLopt](https://github.com/stevengj/nlopt) contains a C version of COBYLA, NEWUOA, and BOBYQA,\nbut the C code in NLopt is translated from the Fortran 77 code straightforwardly, if\nnot automatically by [f2c](https://netlib.org/f2c/f2c.pdf), and hence inherits the style, structure,\nand probably [bugs](#bug-fixes) of the original Fortran 77 implementation.\nNote, however, that\n[Py-BOBYQA](https://numericalalgorithmsgroup.github.io/pybobyqa/) is a **true translation** of BOBYQA\nto Python, with significant improvements.\n\n\n### How\n\nThe mission of PRIMA is nontrivial due to the delicacy of Powell's algorithms and the unique style\nof his code. To ensure the faithfulness of PRIMA,\nthe **modern** Fortran version was started by refactoring Powell's code into the free form via a small\n[MATLAB tool](./matlab/setup_tools/freeform.m).\nHowever, such refactored code is far from what is desired, because it inherits completely\nthe structure and style of Powell's code except for the layout. Significant modifications are needed\nto reorganize (indeed, to **rewrite**) the code. To maintain the faithfulness and quality of the\nreference implementation, extensive tests are conducted after each and every tiny modification,\nusing the [CUTEst](https://github.com/ralna/CUTEst) problems via [MatCUTEst](https://github.com/matcutest/matcutest).\nThe tests do not only verify the faithfulness of the implementation but also check that **the solvers\nbehave properly even if they are invoked with improper inputs or [encounter failures of function\nevaluations](https://github.com/libprima/prima/blob/main/matlab/tests/private/tough.m)**.\n[**Stress tests**](#stress-tests) are also conducted\nperiodically to verify that the solvers work correctly without running into errors when applied to\n**excessively large problems**.\n\n[The tests](./tests.md) are **automated** by\n[GitHub Actions](https://docs.github.com/en/actions).\nAs of August 2023, more than\n45,000 \"workflows\" have been successfully run by GitHub Actions. Normally, each workflow consists of \\~ 5\n([sometimes more than 200](https://github.com/primalib/prima/actions/runs/5763631681))\n**randomized** tests,\neach test taking from tens of minutes to several hours (the maximum\nis 6 hours, after which the test will be canceled automatically). In other words,\nPRIMA has been verified by more than 200,000 hours (or **more than 20 years**) of randomized tests.\n**Code must be battle-tested before becoming software.**\n\n\n### Current status\n\n#### Modern Fortran\n\nAfter almost **three** years of intensive coding, the [modern Fortran version](./fortran) of\nPRIMA was finished by December 2022.\nIt can be compiled using CMake as follows.\u003ca name=\"cmake\"\u003e\u003c/a\u003e\n```bash\ngit clone --depth 1 https://github.com/libprima/prima.git\ncd prima\ncmake -S . -B build -DCMAKE_INSTALL_PREFIX=install\ncmake --build build --target install\n```\nThis should create the `primaf` library for Fortran usage, located in the `install/lib/` directory\nto be used with the module files in `install/include/prima/mod/`.\nIn case CMake fails to find your Fortran compiler,\nyou can indicate it by specifying `-DCMAKE_Fortran_COMPILER=/path/to/your/Fortran/compiler`.\nSimilarly, set `-DCMAKE_C_COMPILER=/path/to/your/C/compiler` for your C compiler if needed.\n\nExamples on how to use the library from an external code are available in [`fortran/examples/`](https://github.com/libprima/prima/tree/main/fortran/examples).\nBelow is an illustration with COBYLA.\n```bash\ncd fortran/examples/cobyla\ncmake -S . -B build -DCMAKE_INSTALL_PREFIX=install -DPRIMA_DIR=$PWD/../../../install/lib/cmake/prima/\ncmake --build build --target install\nLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/../../../install/lib ./install/bin/cobyla_example_1\n```\n\n#### C\n\nA C binding to the Fortran library is available in the [`c/` folder](https://github.com/libprima/prima/tree/main/c).\nIn the same way as the Fortran library, it can be [compiled using CMake](#cmake),\nwhich should also create the `primac` library for C compilation, located in `install/lib/` to be used with the `prima.h` header in `install/include/prima/`.\n\nExamples on how to use the library from an external code are available in [`c/examples/`](https://github.com/libprima/prima/tree/main/c/examples).\nBelow is an illustration with COBYLA.\n```bash\ncd c/examples/cobyla\ncmake -S . -B build -DCMAKE_INSTALL_PREFIX=install -DPRIMA_DIR=$PWD/../../../install/lib/cmake/prima/\ncmake --build build --target install\nLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/../../../install/lib ./install/bin/cobyla_example\n```\n\n#### Python\n\n- An [interface](./python) is provided for [using the **modern** Fortran implementation in Python](./python/examples/rosenbrock.py).\n- SciPy 1.16.0 replaces the [buggy](#bug-fixes) and unmaintained Fortran 77 version of [COBYLA underlying `scipy.optimize.minimize`](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-cobyla.html#optimize-minimize-cobyla) with the PRIMA version, which is a **faithful** Python translation of the **[modern Fortran implementation](./fortran/cobyla)**.\n\n#### MATLAB\n\n- An [interface](./matlab/interfaces/prima.m) is provided for [using the **modern** Fortran implementation in MATLAB](./README_mat.md).\n- \u003ca name=\"newuoa_mat\"\u003e\u003c/a\u003eA [pure MATLAB version of NEWUOA](./matlab/interfaces/+newuoa_mat/) is implemented. It was\n  generated straightforwardly (indeed, **automatically**) from an earlier version of the\n  **modern** Fortran code (with the help of Mr. Galann Pennec). The other four solvers will be\n  implemented in MATLAB similarly.\n\n#### Julia\n\n- A [Julia interface](https://juliahub.com/ui/Packages/General/PRIMA) is provided\nby [`PRIMA.jl`](https://github.com/libprima/prima.jl).\nIt is registered in the General Registry of Julia as\n[`PRIMA`](https://github.com/JuliaRegistries/General/tree/master/P/PRIMA).\n\n#### Other languages\n\n- Interfaces for using the modern Fortran implementation in other languages will be available later.\n- Given the **modern** Fortran version, **native implementations** in other languages\nbecome **much easier**, because we now have a structured and modularized implementation as a reference.\nMy team will implement the methods in other languages in this way.\nFor instance, see the [MATLAB version of NEWUOA](https://github.com/libprima/prima/blob/main/matlab/interfaces/%2Bnewuoa_mat)\nand the [Python version of COBYLA](https://github.com/libprima/prima/tree/main/pyprima/src/pyprima/cobyla)\n([included in SciPy](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-cobyla.html#optimize-minimize-cobyla) since 1.16.0).\nThis is the main motivation for developing the **modern** Fortran version first \u0026mdash;\nto provide a modernized reference implementation for the development in other languages.\n\n### Bug fixes\n\nPRIMA has fixed some **serious** issues in the **original Fortran 77 implementation** of Powell's methods.\nNote that all of them are problems in the Fortran 77 code rather than flaws in the algorithms.\n\n\u003c!---[NLopt.jl](https://github.com/JuliaOpt/NLopt.jl), --\u003e\nThe examples given below are bugs or requests sent to [SciPy](https://github.com/scipy/scipy),\n[NLopt](https://github.com/stevengj/nlopt),\n[nloptr](https://github.com/astamm/nloptr),\n[OpenTURNS](https://github.com/openturns/openturns),\netc., which are reputable packages that wrap/interface the **original Fortran 77 implementation**\nof Powell's solver. Inevitably, they suffer from the bugs in the Fortran 77 code.\n\n- The Fortran 77 solvers may get **stuck** in infinite loops.\n\n     - [optimize: COBYLA hangs / infinite loop #8998](https://github.com/scipy/scipy/issues/8998)\n     - [BUG: Scipy.optimize / COBYLA hangs on some CPUs #15527](https://github.com/scipy/scipy/issues/15527)\n\n\t - [COBYLA freezes (though maxeval and maxtime are given) #370](https://github.com/stevengj/nlopt/issues/370)\n\n\t - [COBYLA hangs #118](https://github.com/stevengj/nlopt/issues/118)\n\n\t - [NEWUOA_BOUND stuck in infinite loop inside MMA #117](https://github.com/stevengj/nlopt/issues/117)\n\n     - [Cobyla freezes in 0T1.16rc1 #1651](https://github.com/openturns/openturns/issues/1651)\n\n     - [Optimization freezes #25](https://github.com/astamm/nloptr/issues/25)\n\n     - [BOBYQA gets stuck in infinite loop. #7](https://github.com/cureos/csnumerics/issues/7)\n\n     - [Cobyla turns into infinite loop and never finishes #8](https://github.com/cureos/csnumerics/issues/8)\n\n     - [Algorithm turns into infinite loop and never finishes #3](https://github.com/xypron/jcobyla/issues/3)\n\n     - [The Fortran 77 version of UOBYQA encounters infinite cyclings very often if PRIMA_REAL_PRECISION is 32](https://github.com/libprima/prima/issues/98)\n\n- The Fortran 77 solvers may **crash** with [segmentation faults](https://en.wikipedia.org/wiki/Segmentation_fault)\n  due to uninitialized variables that are used as indices.\n\n     - [Fix all uninitialized variable warnings #134](https://github.com/stevengj/nlopt/issues/134)\n\n\t - [BOBYQA uninitialised variables in rare cases #133](https://github.com/stevengj/nlopt/issues/133)\n\n\t - [Use of uninitialized variable in BOBYQA altmov #36](https://github.com/stevengj/nlopt/issues/36)\n\n- Fortran 77 COBYLA may **not return the best point** that is evaluated; sometimes, the returned point can have a\nlarge constraint violation even though the starting point is feasible.\n\n\t - [nlopt COBYLA optimizer gives unexpected output #182](https://github.com/stevengj/nlopt/issues/182)\n\n\t - [Last Result Returned Not Optimized Result #110](https://github.com/stevengj/nlopt/issues/110)\n\n\t - [COBYLA returns last evaluated function which might not be minimum #57](https://github.com/stevengj/nlopt/issues/57)\n\n     - [Successful termination when constraints violated #1](https://github.com/cureos/jcobyla/issues/1)\n\n\u003c!---\n- Thread-safety\n    - [scipy.optimize.minimize(method='COBYLA') not threadsafe #9658](https://github.com/scipy/scipy/issues/9658)\n\n    - [BUG: Make cobyla threadsafe #3](https://github.com/sturlamolden/scipy/pull/3)\n--\u003e\n\n\n### Improvements\n\nThanks to the improvements introduced into the new implementation, PRIMA\ngenerally produces better solutions with fewer function evaluations compared with Powell's Fortran 77 implementation.\nThis makes PRIMA preferable **if function evaluations are expensive**,\nwhich is typically the case for [derivative-free optimization problems](https://github.com/orgs/libprima/discussions/145).\nHowever, if function evaluations are not the dominant cost in your application (e.g., a function\nevaluation takes only milliseconds), the Fortran 77\nsolvers are likely to be faster, as they are more efficient in terms of memory usage and flops\nthanks to the careful and ingenious (but unmaintained and unmaintainable) implementation by Powell.\n\nBelow are the [performance profiles](https://arxiv.org/pdf/cs/0102001.pdf)\nof the PRIMA solvers compared with Powell's implementation in terms of the **number of function evaluations**,\nthe convergence tolerance being $\\tau = 10^{-6}$.\nRoughly speaking, performance profiles plot the percentage of test problems solved against the budget,\nwhich is measured relative to the cost of the most efficient solver in the comparison.\nA **higher** curve indicates a **better** solver.\nSee [Benchmarking Derivative-Free Optimization Algorithms](https://www.mcs.anl.gov/~wild/dfo/benchmarking)\n([J. J. Moré](https://www.anl.gov/profile/jorge-j-more) and [S. M. Wild](https://www.anl.gov/profile/stefan-m-wild))\nfor more information.\n\n\n- NEWUOA on unconstrained CUTEst problems of at most 200 variables\n\u003cimg src=\"./benchmark/latest/prima_newuoa.png\" style=\"width:26em;\"/\u003e\n\n- BOBYQA on bound-constrained CUTEst problems of at most 200 variables\n\u003cimg src=\"./benchmark/latest/prima_bobyqa.png\" style=\"width:26em;\"/\u003e\n\n- LINCOA on linearly constrained CUTEst problems of at most 200 variables and 20000 constraints\n\u003cimg src=\"./benchmark/latest/prima_lincoa.png\" style=\"width:26em;\"/\u003e\n\n- COBYLA on nonlinearly constrained CUTEst problems of at most 100 variables and 10000 constraints\n\u003cimg src=\"./benchmark/latest/prima_cobyla.png\" style=\"width:26em;\"/\u003e\n\n- UOBYQA on unconstrained CUTEst problems of at most 100 variables\n\u003cimg src=\"./benchmark/latest/prima_uobyqa.png\" style=\"width:26em;\"/\u003e\n\n\n### Who was Powell?\n\n[Michael James David Powell FRS](https://en.wikipedia.org/wiki/Michael_J._D._Powell) was\n[\"a British numerical analyst who was among the pioneers of computational mathematics\"](https://royalsocietypublishing.org/doi/full/10.1098/rsbm.2017.0023).\nHe was the inventor/early contributor of\n[quasi-Newton method](https://en.wikipedia.org/wiki/Quasi-Newton_method),\n[trust region method](https://en.wikipedia.org/wiki/Trust_region),\n[augmented Lagrangian method](https://en.wikipedia.org/wiki/Augmented_Lagrangian_method),\nand [SQP method](https://en.wikipedia.org/wiki/Sequential_quadratic_programming).\nEach of them is a pillar of modern numerical optimization. He also made significant contributions\nto [approximation theory and methods](https://www.cambridge.org/highereducation/books/approximation-theory-and-methods/66FD8CD6F18FE1ED499A8CA9A05F2A5A#overview).\n\nAmong numerous honors, Powell was one of the two recipients of the first\n[Dantzig Prize](https://en.wikipedia.org/wiki/Dantzig_Prize)\nfrom the Mathematical Programming Society (MOS) and Society for Industrial and Applied Mathematics (SIAM).\nThis is considered the highest award in optimization.\n\n\n### A \"fun\" fact\n\nIn the past years, while working on PRIMA, I have spotted a dozen of [bugs in reputable Fortran compilers](https://github.com/zequipe/test_compiler)\nand three [bugs in MATLAB](https://github.com/zequipe/test_matlab). Each of them represents days of **bitter** debugging, which finally led to the conclusion\nthat it was not a problem in my code but a flaw in the Fortran compilers or in MATLAB. From a very unusual angle, this reflects how intensive\nthe coding has been.\n\nThe bitterness behind this \"fun\" fact is exactly why I work on PRIMA: I hope that all\nthe frustrations that I have experienced will not happen to any user of Powell's methods anymore.\nI hope I am the last one in the world to decode a maze of 244 GOTOs in 7939 lines of Fortran 77 code \u0026mdash;\nI did this for three years and I do not want anyone else to do it again.\n\n\n### Acknowledgment\n\nPRIMA is dedicated to the memory of the late [Professor Powell](https://www.zhangzk.net/powell.html) with gratitude for his inspiration and\nfor the wealth he left to us.\n\nI am profoundly grateful to [Professor Ya-xiang Yuan](http://lsec.cc.ac.cn/~yyx) for his everlasting encouragement and support.\n\nDuring the years working on PRIMA, due to the gap in my publication record, I needed a lot of\nsupport from the optimization community and beyond.\n**Thank you for help, known or unknown to me, explicit or implicit, without which I would not have survived.**\n\nThe development of PRIMA would have been a mission impossible without the groundwork laid by the [PDFO](https://www.pdfo.net)\npackage of [Tom M. Ragonneau](https://ragonneau.github.io) and Zaikun Zhang.\nPDFO is Chapter 3 of Ragonneau's [thesis](https://theses.lib.polyu.edu.hk/handle/200/12294) co-supervised by Zaikun Zhang\nand Professor [Xiaojun Chen](https://www.polyu.edu.hk/ama/staff/xjchen/ChenXJ.htm),\nwith financial support from the [Hong Kong Ph.D. Fellowship Scheme](https://cerg1.ugc.edu.hk/hkpfs/index.html) (ref. PF18-24698).\n\n\n\nPRIMA is a long-term project, which would not have been sustainable without the continued funds from the\n[National Natural Science Foundation of China](https://www.nsfc.gov.cn/english/site_1/index.html) (NSFC),\n[Hong Kong Research Grants Council](https://www.ugc.edu.hk/eng/rgc) (RGC;\nref. PolyU 253012/17P, PolyU 153054/20P, PolyU 153066/21P, and PolyU 153086/23P)\n[Sun Yat-sen University](https://en.wikipedia.org/wiki/Sun_Yat-sen_University)\n(particularly the [School of Mathematics](https://math.sysu.edu.cn/page/25)), and\n[The Hong Kong Polytechnic University](https://www.polyu.edu.hk) (particularly the\n[Department of Applied Mathematics](https://www.polyu.edu.hk/ama)).\n\nLast but not least, I am deeply grateful to the [contributors](https://github.com/libprima/prima/graphs/contributors)\nfrom the open-source community.\n\n### Citing PRIMA\n\nPRIMA has taken me significant energy and time. I will be delighted if it is useful to you. All I need is a citation / acknowledgment,\n**which is crucial for the sustainability of the project, as software development is not well recognized in academia despite\n[its importance](https://xkcd.com/2347/) and the significant efforts it requires**.\n\nNote that PRIMA contains [bug fixes](#bug-fixes) and [improvements](#improvements) that do not exist in Powell's Fortran 77\nimplementation of the solvers. Results produced by PRIMA are surely different from Powell's original solvers,\neven though the algorithms are essentially the same. Therefore,\n**it is important to point out that you are using PRIMA rather than the original solvers if you want your results to be reproducible**.\nIt is wrong to pretend that PRIMA is just Powell's original solvers.\n\nIf you use PRIMA, please cite it as follows. The citation will be pointed to my paper on PRIMA when I finish it.\n\n[1] Z. Zhang, PRIMA: Reference Implementation for Powell's Methods with Modernization and Amelioration,\navailable at https://www.libprima.net, [DOI: 10.5281/zenodo.8052654](https://doi.org/10.5281/zenodo.8052654), 2023\n\n```bibtex\n@misc{Zhang_2023,\n    title        = {{PRIMA: Reference Implementation for Powell's Methods with Modernization and Amelioration}},\n    author       = {Zhang, Z.},\n    howpublished = {available at http://www.libprima.net, DOI: 10.5281/zenodo.8052654},\n    year         = {2023}\n}\n```\n\nIn addition, Powell’s methods can be cited as follows.\n\n[2] M. J. D. Powell, A direct search optimization method that models the\nobjective and constraint functions by linear interpolation,\nIn *Advances in Optimization and Numerical Analysis*, *eds.* S. Gomez and J. P. Hennart,\npages 51--67, Springer Verlag, Dordrecht, Netherlands, 1994\n\n[3] M. J. D. Powell, UOBYQA: unconstrained optimization by quadratic\napproximation, *Math. Program.*, 92(B):555--582, 2002\n\n[4] M. J. D. Powell, The NEWUOA software for unconstrained optimization\nwithout derivatives, In *Large-Scale Nonlinear Optimization*, *eds.* G. Di Pillo\nand M. Roma, pages 255--297, Springer, New York, US, 2006\n\n[5] M. J. D. Powell, The BOBYQA algorithm for bound constrained\noptimization without derivatives, Technical Report DAMTP 2009/NA06,\nDepartment of Applied Mathematics and Theoretical Physics, Cambridge\nUniversity, Cambridge, UK, 2009\n\n[6] T. M. Ragonneau and Z. Zhang,\n[PDFO: a cross-platform package for Powell's derivative-free optimization solvers](https://link.springer.com/article/10.1007/s12532-024-00257-9),\n*Math. Program. Comput.*, 16:535--559, 2024\n\n\n**Remarks**\n\n- LINCOA seeks the least value of a nonlinear function subject to\nlinear inequality constraints without using derivatives of the objective\nfunction. Powell did not publish a paper to introduce the algorithm.\n\n- [The paper [6]](https://link.springer.com/article/10.1007/s12532-024-00257-9) introduces [the PDFO package](https://www.pdfo.net)\nrather than PRIMA. Nevertheless, it provides probably the most accessible introduction to Powell's methods.\n\n\n### Charityware\n\nPRIMA is [charityware](https://en.wikipedia.org/wiki/Careware), distributed for free under its\n[license](https://github.com/libprima/prima/blob/main/LICENCE.txt).\nIf you appreciate it, you may consider making a donation to a charity that you trust\n(in addition to [citing \\\u0026 acknowledging PRIMA](https://github.com/libprima/prima#citing-prima)).\nThis is only a suggestion, not an obligation.\n\nThe inspiration comes from [Vim](https://www.vim.org/), with which Zaikun Zhang typed all his PRIMA code.\n\n\n### Contact\n\nIn case of problems, [open a GitHub issue](https://github.com/libprima/prima/issues) or [contact\nZaikun Zhang](https://www.zhangzk.net).\n\n\n### Mirrors\n\n- Gitee: [https://gitee.com/libprima/prima](https://gitee.com/libprima/prima)\n\n- GitHub: [https://github.com/libprima/prima](https://github.com/libprima/prima)\n\n- GitLab: [https://gitlab.com/libprima/prima](https://gitlab.com/libprima/prima)\n\n\n### \u003ca href=\"https://star-history.com/#libprima/prima\u0026Date\"\u003eStar history\u003c/a\u003e\n\n[stardev](https://stardev.io/) ranking: [28 among 37,983](https://stardev.io/top/repos/fortran?developer=libprima\u0026repo=prima) Fortran repos as of April 2025.\n\n\u003cimg src=\"https://api.star-history.com/svg?repos=libprima/prima\u0026type=Date\"\u003e\n\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eThank you for your support.\u003c/strong\u003e\u003c/p\u003e\n","funding_links":[],"categories":["Fortran"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibprima%2Fprima","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibprima%2Fprima","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibprima%2Fprima/lists"}