source: tol/tol_pkg/FunRn2R/BaseC2.Concat.tol @ 9fbb134

1941-docker-image-to-testdevel
Last change on this file since 9fbb134 was 9fbb134, checked in by Víctor de Buen <vdebuen@…>, 17 years ago

Tools for handling with multivariate real functions Rn->R

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

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/* -*- mode: C++ -*- */
2//////////////////////////////////////////////////////////////////////////////
3// FILE   : BaseC2.Concat.tol
4// PURPOSE: Defines class @BaseC2.Concat
5//////////////////////////////////////////////////////////////////////////////
6
7Text _.autodoc.member.BaseC2.Concat =
8"Concats a set of linearly independent bases over the same domain "
9"vectorial space.";
10
11//////////////////////////////////////////////////////////////////////////////
12Class @BaseC2.Concat : @BaseC2
13//////////////////////////////////////////////////////////////////////////////
14{
15  Set _.base;   //Set of @BaseC2
16
17  //Auxiliar member to map concatenated bases
18  Set _.map;
19
20  ////////////////////////////////////////////////////////////////////////////
21  Static Text _.autodoc.member.New = "Creates an instance of "
22  "@BaseC2.Concat on R^n with specified maximum degree.";
23  Static @BaseC2.Concat New(Set base)
24  ////////////////////////////////////////////////////////////////////////////
25  {
26    Real n = (base[1])::_.n;
27    Set map = BinGroup("<<", For(1,Card(base),Set(Real h)
28    {
29      If((base[h])::_.n!=n,WriteLn("[@BaseC2.Concat::New] "
30      "Cannot concat bases with different domain vectorial space dimension "
31      <<n+"!="<<(base[h])::_.n),"E");
32      For(1,(base[h])::_.K,Set(Real k)
33      {
34        [[h,k]]
35      })
36    }));
37    @BaseC2.Concat aux = [[
38      Real _.n = base::_.n;
39      Real _.K = Card(map);
40      Set _.base = base;
41      Set _.map = map
42  ]]};
43
44  //For efficience reasonsthe base has specific method for evaluation over
45  //massive data stored in a matrix
46
47  ////////////////////////////////////////////////////////////////////////////
48  Static Text _.autodoc.member._build.function.v =
49  "Evaluates the k-th basic function for an "
50  "array of points given as the rows of a matrix ";
51  VMatrix _build.function.v(Real k, VMatrix X)
52  ////////////////////////////////////////////////////////////////////////////
53  {
54    Set aux = _.map[k];
55    (_.base[aux::h])::_.base::function.v(aux::k, X)
56  };
57  ////////////////////////////////////////////////////////////////////////////
58  Static Text _.autodoc.member._build.partial.derivative.1.v =
59  "Evaluates the first partial derivative of k-th basic function for an "
60  "array of points given as the rows of a matrix";
61  VMatrix _build.partial.derivative.1.v(Real k, VMatrix X, Real i)
62  ////////////////////////////////////////////////////////////////////////////
63  {
64    Set aux = _.map[k];
65    (_.base[aux::h])::_.base::partial.derivative.1.v(aux::k, X, i)
66  };
67  ////////////////////////////////////////////////////////////////////////////
68  Static Text _.autodoc.member._build.partial.derivative.2.v =
69  "Evaluates the second partial derivative of k-th basic function for an "
70  "array of points given as the rows of a matrix";
71  VMatrix _build.partial.derivative.2.v(Real k, VMatrix X, Real i, Real j)
72  ////////////////////////////////////////////////////////////////////////////
73  {
74    Set aux = _.map[k];
75    (_.base[aux::h])::_.base::partial.derivative.2.v(aux::k, X, i, j)
76  }
77};
Note: See TracBrowser for help on using the repository browser.