Ignore:
Timestamp:
Dec 15, 2009, 5:39:55 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
8fd1737
Parents:
8642d7e
Message:

Enabling cache for integration methods

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1813 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol_pkg/FunRn2R/BaseC2.Cache.tol

    r8642d7e rdac8deb  
    1717  Set _.partial.derivative.1 = Copy(Empty);
    1818  Set _.partial.derivative.2 = Copy(Empty);
     19  Set _.partial.integrate.1 = Copy(Empty);
    1920
    2021  //Returns the cached value of the k-th basic function for an
    … …  
    3738    Real j_ = Min(i,j);
    3839    SubCol(_.partial.derivative.2[i_][j_],[[k]])
     40  };
     41  //Returns the cached value of the first partial integration of k-th basic
     42  //function for an  array of points given as the rows of a matrix
     43  VMatrix partial.integrate.1.v(Real k, VMatrix X, Real i)
     44  {
     45    SubCol(_.partial.integrate.1[i],[[k]])
    3946  };
    4047
    … …  
    6269  };
    6370
     71  //Evaluates the first partial integration of all basic functions, one in
     72  //each returned column, for an  array of points given as the rows of a
     73  //matrix
     74  VMatrix partial.integrate.1.m(VMatrix X, Real i)
     75  {
     76    _.partial.integrate.1[i]
     77  };
    6478  //Some bases are more efficient using cache
    65   Real _build.cache(VMatrix X, Real order)
     79  Real _build.cache(VMatrix X, Real deriv.order, Real integ.order)
    6680  {
    67     VMatrix If(order>=0, { _.function.r :=
    68       _build.function.m(X)
    69     });
    70     Set If(order>=1, { _.partial.derivative.1 :=
     81    VMatrix _.function := _build.function.m(X);
     82    Set If(deriv.order>=1, { _.partial.derivative.1 :=
    7183      For(1, _.n, VMatrix(Real i)
    7284      { _build.partial.derivative.1.m(X,i) })
    7385    });
    74     Set If(order>=2, { _.partial.derivative.2 :=
     86    Set If(deriv.order>=2, { _.partial.derivative.2 :=
    7587      For(1, _.n, Set(Real i)
    7688      {
    … …  
    8193      })
    8294    });
     95    Set If(integ.order>=1, { _.partial.integrate.1 :=
     96      For(1, _.n, VMatrix(Real i)
     97      { _build.partial.integrate.1.m(X,i) })
     98    });
    8399    True
    84100  }
Note: See TracChangeset for help on using the changeset viewer.