https://github.com/cran/fields
Raw File
Tip revision: 6c8b30169bba182a68765ee3cb9b4e2ef7d38332 authored by Doug Nychka on 16 November 2011, 00:00:00 UTC
version 6.6.3
Tip revision: 6c8b301
evlpoly.f


      subroutine evlpoly(x,n,coef,j,result)

c evaluates a polynomial: coef(1) + sum_i= 2,j coef(i)x**i

      integer j,n, i
      double precision x(n), result(n), coef(j)
      double precision temp, tempx, temp2
      
      do 10 i = 1,n

         temp= coef(1)
         tempx= x(i)
         temp2= tempx 

c      temp is set to constant now loop over powers

         do 20 kk= 2, j
           temp= temp + coef(kk)* temp2
           temp2= temp2*tempx
   20    continue

      result(i)= temp

   10 continue
 
      return
      end
back to top