Changeset 9e84556 in tol


Ignore:
Timestamp:
Dec 30, 2009, 6:20:22 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
d9c5d1e
Parents:
bb01c80
Message:

Generalización para entornos de radio variable

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol_pkg/MulVarFunAprox/DesignC2.Monomial.Spheric.Grid.tol

    rbb01c80 r9e84556  
    2525//Auxiliar members
    2626//////////////////////////////////////////////////////////////////////////////
    27   VMatrix _.Y.h = Rand(0,0,0,0);
    2827  VMatrix _.Y.neighbourhood = Rand(0,0,0,0);
    2928
    … …  
    5049
    5150  //////////////////////////////////////////////////////////////////////////////
    52   VMatrix get.radius(VMatrix Y.idx)
    53   //////////////////////////////////////////////////////////////////////////////
    54   {
    55     Constant(VRows(Y.idx),1,_.radius)
    56   };
    57 
    58   //////////////////////////////////////////////////////////////////////////////
    59   VMatrix closest.reference.index(VMatrix X)
    60   //////////////////////////////////////////////////////////////////////////////
    61   {
    62     WriteLn("TRACE [closest.reference.index] 1");
    63     SubRow(_.Y.neighbourhood, Col2Set(_.grid::point2index(X)))
    64   };
    65 
    66   //////////////////////////////////////////////////////////////////////////////
    6751  Real build.reference.points(Real void)
    6852  //////////////////////////////////////////////////////////////////////////////
    … …  
    7054    Text _MID = "[@DesignC2.Monomial.Spheric.Grid::build.reference.points] ";
    7155    VMatrix _.Y := _.grid::_.Y;
    72     VMatrix _.Y.h := Mat2VMat(_.grid::_.Y.h);
    73     VMatrix _.Y.neighbourhood := _.Y.h | Group("ConcatColumns",
     56    VMatrix Y.h = Mat2VMat(_.grid::_.Y.h);
     57    VMatrix _.Y.neighbourhood := Y.h | Group("ConcatColumns",
    7458    For(1,2*_.n, VMatrix(Real i)
    7559    {
    7660      VMatrix aux = SubCol(_.grid::_.Y.neighbourhood.index,[[i]]);
    77       IfVMat(aux,aux,_.Y.h)
     61      IfVMat(aux,aux,Y.h)
    7862    }));
    7963    Set X.class = Classify(Col2Set(_.grid::point2index(_.X)),Compare);
    … …  
    8771  //////////////////////////////////////////////////////////////////////////////
    8872  {
    89     Text _MID = "[@DesignC2.Spheric::build.stress.points] ";
     73    Text _MID = "[@DesignC2.Monomial.Spheric.Grid::build.stress.points] ";
    9074    WriteLn("TRACE "+_MID+"1");
    9175    Real _.Z.maxNeighbour := If(prior.Z.order>=0,2,0);
    … …  
    133117    VMatrix _.Z.h := SubRow(Z.h.interior, sel.unique);
    134118    Real _.Tz := VRows(_.Z);
    135     VMatrix _.Z.Y.neighbour :=
     119    VMatrix Z.Y.neighbour =
    136120    {
    137121      Matrix Z.t = DifEq(1/(1-B),Rand(_.Tz,1,1,1));
    … …  
    147131      SubRow(Mat2VMat(Z.Y.idx),MatQuery::SelectMatch(Z.Y.match))
    148132    };
    149     VMatrix aux = MatQuery::SortAndCount(SubCol(_.Z.Y.neighbour,[[2]]));
     133    VMatrix aux = MatQuery::SortAndCount(SubCol(Z.Y.neighbour,[[2]]));
    150134    VMatrix _.Yt := Triplet(VMat2Mat(SubCol(aux,[[1]])) | 
    151135                            Rand(VRows(aux),1,1,1) |
    … …  
    186170  };
    187171
     172  //////////////////////////////////////////////////////////////////////////////
     173  VMatrix get.radius(VMatrix Y.idx)
     174  //////////////////////////////////////////////////////////////////////////////
     175  {
     176    Constant(VRows(Y.idx),1,_.radius)
     177  };
     178
     179  //////////////////////////////////////////////////////////////////////////////
     180  VMatrix closest.reference.index(VMatrix X)
     181  //////////////////////////////////////////////////////////////////////////////
     182  {
     183    WriteLn("TRACE [closest.reference.index] 1");
     184    SubRow(_.Y.neighbourhood, Col2Set(_.grid::point2index(X)))
     185  };
     186
     187  ////////////////////////////////////////////////////////////////////////////
     188    VMatrix match.evaluable(VMatrix X)
     189  ////////////////////////////////////////////////////////////////////////////
     190  {
     191    Real m = VRows(X);
     192    Mat2VMat(_.grid::point2index(X))
     193  };
     194
    188195  ///////////////////////////////////////////////////////////////////////////
    189     VMatrix generate.internal.points(
    190       Real m,
    191       Real force.reference.near.nodal)
     196    VMatrix generate.internal.points(Real m)
    192197  ///////////////////////////////////////////////////////////////////////////
    193198  {
    … …  
    197202    VMatrix u = v*(VMatDat(MtMSqr(v),1,1)^-0.5);
    198203    y+u*(Rand(0,1)*_.radius)
    199   };
    200 
    201   ////////////////////////////////////////////////////////////////////////////
    202     VMatrix match.evaluable(VMatrix X)
    203   ////////////////////////////////////////////////////////////////////////////
    204   {
    205     Real m = VRows(X);
    206     Mat2VMat(_.grid::point2index(X))
    207 /*
    208     VMatrix X.closest.index = closest.reference.index(X);
    209     VMatrix X.h=SubRow(SubCol(_.Y.neighbourhood,[[1]]),
    210                        VCol2Set(X.closest.index));
    211     VMatrix X.dif = X - SubRow(_.Y,VCol2Set(X.h));
    212     VMatrix X.norm2 = RPow(X.dif,2)*Rand(_.n,1,1,1);
    213     VMatrix X.tao = RPow(X.norm2,0.5)/_.radius;
    214     LE(X.tao,Rand(m,1,1,1))
    215 */
    216204  }
    217205
     206
    218207};
Note: See TracChangeset for help on using the changeset viewer.