Giter Club home page Giter Club logo

powellopt's Introduction

Optimization algorithms by M.J.D. Powell

Build Status

About

This is a collection of derivative-free optimization algorithms by M.J.D. Powell. The package contains:

  • LINCOA (LINearly Constrained Optimization Algorithm)
  • BOBYQA (Bound Optimization BY Quadratic Approximation)
  • NEWUOA (NEW Unconstrained Optimization Algorithm)
  • UOBYQA (Unconstrained Optimization BY Quadratic Approximation)
  • COBYLA (Constrained Optimization BY Linear Approximations)

Building

The Fortran Package Manager (fpm) is a great package manager and build system for Fortran. You can build using provided fpm.toml:

fpm build

To use PowellOpt within your fpm project, add the following to your fpm.toml file:

[dependencies]
PowellOpt = { git="https://github.com/jacobwilliams/PowellOpt.git" }

Documentation

  • The API documentation for the current master branch can be found here. This is generated by processing the source files with FORD.

License

The original routines were written in FORTRAN 77. They have been refactored into modern Fortran for this package. The original sourcecode was written by Powell and released without charges or restrictions (see below). The modifications are released under a BSD-style license.

See also

powellopt's People

Contributors

jacobwilliams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powellopt's Issues

add topics

I suggest adding the topics constrained-optimization, unconstrained-optimization, nonlinear-optimization in the About section in case someone searches those terms, especially the first.

I am successfully using newuoa.f90 in a program -- thanks.

Build fails on Sonoma (x86_64, arm64): `Error: Symbol 'n' at (1) has no IMPLICIT type`

 + gfortran -c ././src/cobyla.f90   -O3 -funroll-loops -Wimplicit-interface -fPIC -fmax-errors=1 -fcoarray=single -fimplicit-none -Werror=implicit-interface -ffree-form -J build/gfortran_2654F75F5833692A -Ibuild/gfortran_2654F75F5833692A -o build/gfortran_2654F75F5833692A/PowellOpt/src_cobyla.f90.o
././src/cobyla.f90:138:24:

  138 |     subroutine cobylb (n, m, mpp, x, rhobeg, rhoend, iprint, maxfun, con, sim, simi, &
      |                        1
Error: Symbol 'n' at (1) has no IMPLICIT type
compilation terminated due to -fmax-errors=1.
[ 25%]                     cobyla.f90  done.

././src/cobyla.f90:138:24:

  138 |     subroutine cobylb (n, m, mpp, x, rhobeg, rhoend, iprint, maxfun, con, sim, simi, &
      |                        1
Error: Symbol 'n' at (1) has no IMPLICIT type
compilation terminated due to -fmax-errors=1.
<ERROR> Compilation failed for object " src_cobyla.f90.o "
<ERROR> stopping due to failed compilation
STOP 1

https://build.macports.org/builders/ports-14_x86_64-builder/builds/11972/steps/install-port/logs/stdio

Windows compilation instructions

Thanks for your project. For the *nix challenged (like me), I will point out that
gfortran kind_module.f90 bobyqa.f90 cobyla.f90 lincoa.f90 uobyqa.f90 newuoa.f90 powellopt.f90 tests\tests.f90

produces an executable.

Change declaration orders, replace tabs with spaces

gfortran -std=f2018 kind_module.f90 bobyqa.f90 cobyla.f90 lincoa.f90 uobyqa.f90 newuoa.f90 powellopt.f90 tests\tests.f90
says

kind_module.f90:6:2:

    6 |         module kind_module
      |         1
Warning: Nonconforming tab character at (1) [-Wtabs]
kind_module.f90:8:2:

    8 |         use iso_fortran_env
      |         1
Warning: Nonconforming tab character at (1) [-Wtabs]
kind_module.f90:10:2:

   10 |         implicit none
      |         1
Warning: Nonconforming tab character at (1) [-Wtabs]
kind_module.f90:12:2:

   12 |         private
      |         1
Warning: Nonconforming tab character at (1) [-Wtabs]
kind_module.f90:17:2:

   17 |         integer,parameter,public :: wp = real64    !! double precision [default]
      |         1
Warning: Nonconforming tab character at (1) [-Wtabs]
kind_module.f90:20:2:

   20 |         end module kind_module
      |         1
Warning: Nonconforming tab character at (1) [-Wtabs]
lincoa.f90:71:27:

   71 |         real(wp),dimension(ia,*),intent(in) :: a       !! a matrix whose columns are the constraint gradients, which are
      |                           1
Error: GNU Extension: Symbol 'ia' is used before it is typed at (1)
lincoa.f90:1133:34:

 1133 |         go to (50, 60, 280), iflag
      |                                  1
Warning: Obsolescent feature: Computed GOTO at (1)
lincoa.f90:60:35:

   60 |     subroutine lincoa (n, npt, m, a, ia, b, x, rhobeg, rhoend, iprint, maxfun, calfun)
      |                                   1
Error: Symbol 'a' at (1) has no IMPLICIT type
lincoa.f90:2290:76:

 2290 |             call lincoa(n,npt,m,a,ia,b,x,rhobeg,rhoend,iprint,maxfun,calfun)
      |                                                                            1
Error: Type mismatch in argument 'a' at (1); passed REAL(8) to UNKNOWN
lincoa.f90:156:33:

  156 |                     sum = sum + a (i, j) * x (i)
      |                                 1
Error: Function 'a' at (1) has no IMPLICIT type
lincoa.f90:157:35:

  157 |                     temp = temp + a (i, j) ** 2
      |                                   1
Error: Function 'a' at (1) has no IMPLICIT type
lincoa.f90:170:30:

  170 |                     w (iw) = a (i, j) / temp
      |                              1
Error: Function 'a' at (1) has no IMPLICIT type
powellopt.f90:9:9:

    9 |     use lincoa_module
      |         1
Fatal Error: Cannot open module file 'lincoa_module.mod' for reading at (1): No such file or directory
compilation terminated.

Uninitialized value used in cobyla.f90

For test problem 10 of Cobyla (hexagon problem) xopt(9) is used without initialization. The variable should be set to zero (which is its expected value at the optimum point) before line 1262 of file cobyla.f90.

add intents in abstract interface func of newuoa_module

I suggest that the abstract interface look as follows:

    abstract interface
    subroutine func (n, x, f)  !! calfun interface
        import :: wp
        implicit none
        integer  , intent(in)  :: n
        real (wp), intent(in)  :: x (*)
        real (wp), intent(out) :: f
    end subroutine func
    end interface

License

Hi, @jacobwilliams,

Thank you for your wonderful project!

The original sourcecode for LINCOA, BOBYQA, NEWUOA, UOBYQA, and COBYLA) was
written by M.J.D. Powell and released for use without restrictions or charges.

I am afraid that this is not precise. Before Professor Powell left, he had chosen LGPL as the license for his code. See the code at https://www.zhangzk.net/software.html and https://github.com/pdfo/pdfo/tree/master/fsrc/original for the licenses.

It would be much appreciated if you could update your LICENSE file accordingly. Many thanks for everything!

Best regards,
Zaikun

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.