aboutsummaryrefslogtreecommitdiffstats
path: root/interface/fortran_example.f90
blob: 024abb2da7834faa8e80ba5cdc715f2defa7912e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function foo(p)
  double precision foo
  double precision p(2)
  foo=p(1)**2+p(2)**2;
  return
end function foo
  

program main
  double precision foo
  double precision p(2)
  integer np
  double precision precision
  np=2
  precision=1e-10
  p(1)=4000
  p(2)=5000
  write(*,*) p,foo(p)
  call optimize_powell(foo,np,p,precision)
  write(*,*) p,foo(p)
end program main