Changeset 09bb52b in tol


Ignore:
Timestamp:
Mar 27, 2013, 11:01:02 AM (14 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
9b9575f
Parents:
b6c14f4
Message:

Fixes #1587

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

Location:
tol
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • tol/bmath/bstat/stat.cpp

    rb6c14f4 r09bb52b  
    8686    return((*stat)(x));
    8787}
     88//--------------------------------------------------------------------
     89BDat Known(const BArray<BDat>& vec)
     90
     91/*! Returns the Sum statistic of a vector of real numbers
     92 */
     93//--------------------------------------------------------------------
     94{
     95    if(!vec.Size()) { return(0); }
     96    BDat result = 0;
     97    for(BInt k = 0; k<vec.Size(); k++)
     98    {
     99        if(vec(k).IsKnown())
     100        {
     101            result += 1;
     102        }
     103    }
     104    return(result);
     105}
     106
    88107//--------------------------------------------------------------------
    89108BDat Sum(const BArray<BDat>& vec)
  • tol/bmath/bstat/tol_bstat.h

    rb6c14f4 r09bb52b  
    3333                      const BArray<BDat>& vec);
    3434
     35TOL_API BDat Known                (const BArray<BDat>& vec);
    3536TOL_API BDat Sum                        (const BArray<BDat>& vec);
    3637TOL_API BDat Product                (const BArray<BDat>& vec);
  • tol/btol/real_type/datgrast.cpp

    rb6c14f4 r09bb52b  
    153153
    154154//--------------------------------------------------------------------
    155   DeclareContensClass(BDat, BDatTemporary, BDatAsimetry);
    156   DefIntOpr(1, BDatAsimetry, "Asymmetry", 1, 0,
     155  DeclareContensClass(BDat, BDatTemporary, BDatAsymmetry);
     156  DefIntOpr(1, BDatAsymmetry, "Asymmetry", 1, 0,
    157157  "(Real x1 [, Real x2, ...])",
    158158  I2("Returns the asymmetry ceficient of all arguments.",
    159159     "Devuelve el coeficiente de asimetría de todos sus argumentos."),
    160160     BOperClassify::Statistic_);
    161   void BDatAsimetry::CalcContens()
     161  void BDatAsymmetry::CalcContens()
    162162//--------------------------------------------------------------------
    163163{
    … …  
    320320
    321321//--------------------------------------------------------------------
     322  DeclareContensClass(BDat, BDatTemporary, BDatMatCount);
     323  DefExtOpr(1, BDatMatCount, "MatCount", 1, 1, "Matrix",
     324  "(Matrix mat)",
     325  I2("Returns the number of cells of a matrix (rows x columns).",
     326     "Devuelve el número de celdas de una matriz (filas x columnas)."),
     327     BOperClassify::Statistic_);
     328  void BDatMatCount::CalcContens()
     329//--------------------------------------------------------------------
     330{
     331  BMat& x = Mat(Arg(1));
     332  contens_ = x.Rows() * x.Columns();
     333}
     334
     335//--------------------------------------------------------------------
     336  DeclareContensClass(BDat, BDatTemporary, BDatMatKnown);
     337  DefExtOpr(1, BDatMatKnown, "MatKnown", 1, 1, "Matrix",
     338  "(Matrix mat)",
     339  I2("Returns the number of cells of a matrix (rows x columns).",
     340     "Devuelve el número de celdas de una matriz (filas x columnas)."),
     341     BOperClassify::Statistic_);
     342  void BDatMatKnown::CalcContens()
     343//--------------------------------------------------------------------
     344{
     345  BMat& x = Mat(Arg(1));
     346  contens_ = Known(x.Data());
     347}
     348
     349//--------------------------------------------------------------------
     350  DeclareContensClass(BDat, BDatTemporary, BDatSetKnown);
     351  DefExtOpr(1, BDatSetKnown, "SetKnown", 1, 1, "Set",
     352  I2("(Set set)","(Set cto)"),
     353  I2("Returns the global sum of all elements of a set of numbers.",
     354     "Devuelve el número de elementos no omitidos de un conjunto de números."),
     355     BOperClassify::Statistic_);
     356  void BDatSetKnown::CalcContens()
     357//--------------------------------------------------------------------
     358{
     359  BSet& set = Set(Arg(1));
     360  if(!CheckRealElement("SetSum",set)) { return; }
     361  BArray<BDat> vec(set.Card());
     362  for(BInt n=0; n<vec.Size(); n++)
     363  {
     364    vec[n] = Dat(set[n+1]);
     365  }
     366  contens_ = Known(vec);
     367}
     368
     369//--------------------------------------------------------------------
    322370  DeclareContensClass(BDat, BDatTemporary, BDatSetSum);
    323371  DefExtOpr(1, BDatSetSum, "SetSum", 1, 1, "Set",
    324372  I2("(Set set)","(Set cto)"),
    325   I2("Returns the global sum of all elements of a set.",
    326      "Devuelve el sumatorio de todos los elementos de un conjunto."),
     373  I2("Returns the global sum of all elements of a set of numbers.",
     374     "Devuelve el sumatorio de todos los elementos de un conjunto de números."),
    327375     BOperClassify::Statistic_);
    328376  void BDatSetSum::CalcContens()
    … …  
    339387}
    340388
    341 
    342389//--------------------------------------------------------------------
    343390  DeclareContensClass(BDat, BDatTemporary, BDatMatSum);
    … …  
    360407  DefExtOpr(1, BDatSetProduct, "SetProd", 1, 1, "Set",
    361408  I2("(Set set)","(Set cto)"),
    362   I2("Returns the global product of all elements of a set.",
    363      "Devuelve el productorio de todos los elementos de un conjunto."),
     409  I2("Returns the global product of all elements of a set of numbers.",
     410     "Devuelve el productorio de todos los elementos de un conjunto de números."),
    364411     BOperClassify::Statistic_);
    365412  void BDatSetProduct::CalcContens()
    … …  
    394441  DefExtOpr(1, BDatSetMedian, "SetMedian", 1, 1, "Set",
    395442  I2("(Set set)","(Set cto)"),
    396   I2("Returns the median of all elements of a set.",
    397      "Devuelve la mediana de todos los elementos de un conjunto."),
     443  I2("Returns the median of all elements of a set of numbers.",
     444     "Devuelve la mediana de todos los elementos de un conjunto de números."),
    398445     BOperClassify::Statistic_);
    399446  void BDatSetMedian::CalcContens()
    … …  
    428475  DefExtOpr(1, BDatSetMin, "SetMin", 1, 1, "Set",
    429476  I2("(Set set)","(Set cto)"),
    430   I2("Returns the minimum of all elements of a set.",
    431      "Devuelve la mínimo de todos los elementos de un conjunto."),
     477  I2("Returns the minimum of all elements of a set of numbers.",
     478     "Devuelve el mínimo de todos los elementos de un conjunto de números."),
    432479     BOperClassify::Statistic_);
    433480  void BDatSetMin::CalcContens()
    … …  
    462509  DefExtOpr(1, BDatSetMax, "SetMax", 1, 1, "Set",
    463510  I2("(Set set)","(Set cto)"),
    464   I2("Returns the maximum of all elements of a set.",
    465      "Devuelve la máximo de todos los elementos de un conjunto."),
     511  I2("Returns the maximum of all elements of a set of numbers.",
     512     "Devuelve la máximo de todos los elementos de un conjunto de números."),
    466513     BOperClassify::Statistic_);
    467514  void BDatSetMax::CalcContens()
    … …  
    496543  DefExtOpr(1, BDatSetAvr, "SetAvr", 1, 1, "Set",
    497544  I2("(Set set)","(Set cto)"),
    498   I2("Returns the arithmetic average of all elements of a set.",
    499      "Devuelve la media aritmética de todos los elementos de un conjunto."),
     545  I2("Returns the arithmetic average of all elements of a set of numbers.",
     546     "Devuelve la media aritmética de todos los elementos de un conjunto de números."),
    500547     BOperClassify::Statistic_);
    501548  void BDatSetAvr::CalcContens()
    … …  
    530577  DefExtOpr(1, BDatSetHarmonicAvr, "SetHarmonicAvr", 1, 1, "Set",
    531578  I2("(Set set)","(Set cto)"),
    532   I2("Returns the harmonic average of all elements of a set.",
    533      "Devuelve la media armónica de todos los elementos de un conjunto."),
     579  I2("Returns the harmonic average of all elements of a set of numbers.",
     580     "Devuelve la media armónica de todos los elementos de un conjunto de números."),
    534581     BOperClassify::Statistic_);
    535582  void BDatSetHarmonicAvr::CalcContens()
    … …  
    564611  DefExtOpr(1, BDatSetGeometricAvr, "SetGeometricAvr", 1, 1, "Set",
    565612  I2("(Set set)","(Set cto)"),
    566   I2("Returns the geometric average of all elements of a set.",
    567      "Devuelve la media geométrica de todos los elementos de un conjunto."),
     613  I2("Returns the geometric average of all elements of a set of numbers.",
     614     "Devuelve la media geométrica de todos los elementos de un conjunto de números."),
    568615     BOperClassify::Statistic_);
    569616  void BDatSetGeometricAvr::CalcContens()
    … …  
    598645  DefExtOpr(1, BDatSetQuantile, "SetQuantile", 2, 2, "Set Real",
    599646  I2("(Set set, Real p)","(Set cto, Real p)"),
    600   I2("Returns the quantile of probability p of all elements of a set.",
     647  I2("Returns the quantile of probability p of all elements of a set of numbers.",
    601648     "Devuelve el cuantil de probabilidad p de todos los elementos "
    602      "de un conjunto."),
     649     "de un conjunto de números."),
    603650     BOperClassify::Statistic_);
    604651  void BDatSetQuantile::CalcContens()
    … …  
    636683  DefExtOpr(1, BDatSetStDs, "SetStDs", 1, 1, "Set",
    637684  I2("(Set set)","(Set cto)"),
    638   I2("Returns the standard deviation of all elements of a set.",
     685  I2("Returns the standard deviation of all elements of a set of numbers.",
    639686     "Devuelve la desviación típica de todos los elementos de un "
    640687     "conjunto."),
    … …  
    671718  DefExtOpr(1, BDatSetVar, "SetVar", 1, 1, "Set",
    672719  I2("(Set set)","(Set cto)"),
    673   I2("Returns the varianze of all elements of a set.",
    674      "Devuelve la varianza de todos los elementos de un conjunto."),
     720  I2("Returns the varianze of all elements of a set of numbers.",
     721     "Devuelve la varianza de todos los elementos de un conjunto de números."),
    675722     BOperClassify::Statistic_);
    676723  void BDatSetVar::CalcContens()
    … …  
    700747}
    701748
     749//--------------------------------------------------------------------
     750  DeclareContensClass(BDat, BDatTemporary, BDatMatMoment);
     751  DefExtOpr(1, BDatMatMoment, "MatMoment", 2, 2, "Matrix Real",
     752  "(Matrix mat, Real n)",
     753  I2("Returns the n-th moment of all cells of a matrix.",
     754     "Devuelve el momento de orden n de todas las celdas de una "
     755     "matriz."),
     756     BOperClassify::Statistic_);
     757  void BDatMatMoment::CalcContens()
     758//--------------------------------------------------------------------
     759{
     760  BMat& mat = Mat(Arg(1));
     761  BInt  m   = (BInt)Real(Arg(2));
     762  const BArray<BDat>& vec = mat.Data();
     763  contens_ = Moment(vec,m);
     764}
     765
     766//--------------------------------------------------------------------
     767  DeclareContensClass(BDat, BDatTemporary, BDatMatCenterMoment);
     768  DefExtOpr(1, BDatMatCenterMoment, "MatCenterMoment", 2, 2, "Matrix Real",
     769  "(Matrix mat, Real n)",
     770  I2("Returns the n-th centered moment of all cells of a matrix.",
     771     "Devuelve el momento centrado de orden n de todas las celdas de una "
     772     "matriz."),
     773     BOperClassify::Statistic_);
     774  void BDatMatCenterMoment::CalcContens()
     775//--------------------------------------------------------------------
     776{
     777  BMat& mat = Mat(Arg(1));
     778  BInt  m   = (BInt)Real(Arg(2));
     779  const BArray<BDat>& vec = mat.Data();
     780  contens_ = CenterMoment(vec,m);
     781}
     782
     783/*
     784//--------------------------------------------------------------------
     785  DeclareContensClass(BDat, BDatTemporary, BDatSetMoment);
     786  DefExtOpr(1, BDatSetMoment, "MatMoment", 2, 2, "Set Real",
     787  I2("(Set set, Real n)","(Set cto, Real n)"),
     788  I2("Returns the n-th moment of all elements of a set of numbers.",
     789     "Devuelve el momento de orden n de todos los elementos de un "
     790     "conjunto."),
     791     BOperClassify::Statistic_);
     792  void BDatSetMoment::CalcContens()
     793//--------------------------------------------------------------------
     794{
     795  BSet& set = Set (Arg(1));
     796  if(!CheckRealElement("SetMoment",set)) { return; }
     797  BInt  m   = (BInt)Real(Arg(2));
     798  BArray<BDat> vec(set.Card());
     799  for(BInt n=0; n<vec.Size(); n++) { vec[n] = Dat(set[n+1]); }
     800  contens_ = Moment(vec,m);
     801}
     802
     803
     804//--------------------------------------------------------------------
     805  DeclareContensClass(BDat, BDatTemporary, BDatSetCenterMoment);
     806  DefExtOpr(1, BDatSetCenterMoment, "SetCenterMoment", 2, 2, "Set Real",
     807  I2("(Set set, Real n)","(Set cto, Real n)"),
     808  I2("Returns the n-th centered moment of all elements of a set of numbers.",
     809     "Devuelve el momento centrado de orden n de todos los elementos de un "
     810     "conjunto."),
     811     BOperClassify::Statistic_);
     812  void BDatSetCenterMoment::CalcContens()
     813//--------------------------------------------------------------------
     814{
     815  BSet& set = Set (Arg(1));
     816  if(!CheckRealElement("SetCenterMoment",set)) { return; }
     817  BInt  m   = (BInt)Real(Arg(2));
     818  BArray<BDat> vec(set.Card());
     819  for(BInt n=0; n<vec.Size(); n++) { vec[n] = Dat(set[n+1]); }
     820  contens_ = CenterMoment(vec,m);
     821}
     822*/
    702823
    703824//--------------------------------------------------------------------
    … …  
    705826  DefExtOpr(1, BDatSetKurtosis, "SetKurtosis", 1, 1, "Set",
    706827  I2("(Set set)","(Set cto)"),
    707   I2("Returns the kurtosis of all elements of a set.",
    708      "Devuelve la curtosis de todos los elementos de un conjunto."),
     828  I2("Returns the kurtosis of all elements of a set of numbers.",
     829     "Devuelve la curtosis de todos los elementos de un conjunto de números."),
    709830     BOperClassify::Statistic_);
    710831  void BDatSetKurtosis::CalcContens()
    … …  
    739860  DefExtOpr(1, BDatSetAsymmetry, "SetAsymmetry", 1, 1, "Set",
    740861  I2("(Set set)","(Set cto)"),
    741   I2("Returns the asymmetry coefficient of all elements of a set.",
     862  I2("Returns the asymmetry coefficient of all elements of a set of numbers.",
    742863     "Devuelve el coeficiente de asimetría de todos los elementos de un "
    743864     "conjunto."),
    … …  
    775896  DefExtOpr(1, BDatSetMoment, "SetMoment", 2, 2, "Set Real",
    776897  I2("(Set set, Real n)","(Set cto, Real n)"),
    777   I2("Returns the n-th moment of all elements of a set.",
     898  I2("Returns the n-th moment of all elements of a set of numbers.",
    778899     "Devuelve el momento de orden n de todos los elementos de un "
    779900     "conjunto."),
    … …  
    795916  DefExtOpr(1, BDatSetCenterMoment, "SetCenterMoment", 2, 2, "Set Real",
    796917  I2("(Set set, Real n)","(Set cto, Real n)"),
    797   I2("Returns the n-th centered moment of all elements of a set.",
     918  I2("Returns the n-th centered moment of all elements of a set of numbers.",
    798919     "Devuelve el momento centrado de orden n de todos los elementos de un "
    799920     "conjunto."),
  • tol/btol/real_type/datgsrst.cpp

    rb6c14f4 r09bb52b  
    165165
    166166//--------------------------------------------------------------------
     167  DefExtOpr(1, BDatStatKnown,   "KnownS", 1, 3, "Serie Date Date",
     168  I2("(Serie ser [, Date from, Date until])",
     169     "(Serie ser [, Date desde, Date hasta])"),
     170  I2("Returns the number of non missing data of a serie between two dates. "
     171     "If they do not appear, it is assumed the calculation with the "
     172     "first and last dates of the series. Finally, if the series lacks "
     173     "dates, is calculated with the dates by defect. ",
     174     "Devuelve el número de datos no omitidos de una serie entre dos fechas. "
     175     "Si no aparecen, se asume el cálculo con las fechas primera "
     176     "y última de la serie. Por último, si la serie carece de fechas, "
     177     "se calcula con las fechas por defecto."),
     178     BOperClassify::Statistic_);
     179  void BDatStatKnown::CalcContens()
     180//--------------------------------------------------------------------
     181{
     182  if(ser_ && TsrR(ser_).Dating())
     183  {
     184    if(TsrR(ser_).FirstDate()>TsrR(ser_).LastDate())
     185    {
     186      contens_ = 0;
     187    }
     188    else
     189    {
     190      contens_ = Known(vec_); //1 + TsrR(ser_).Dating()->Difference(ini_, fin_);
     191    }
     192  }
     193}
     194
     195//--------------------------------------------------------------------
    167196  DefExtOpr(1, BDatStatMax,     "MaxS", 1, 3, "Serie Date Date",
    168197  I2("(Serie ser [, Date from, Date until])",
    … …  
    233262
    234263//--------------------------------------------------------------------
     264  DefExtOpr(1, BDatStatProd,    "ProdS", 1, 3, "Serie Date Date",
     265  I2("(Serie ser [, Date from, Date until])",
     266     "(Serie ser [, Date desde, Date hasta])"),
     267  I2("Returns the product of a serie between two dates. "
     268     "If they do not appear, it is assumed the calculation with the "
     269     "first and last dates of the series. Finally, if the series lacks "
     270     "dates, is calculated with the dates by defect.",
     271     "Devuelve el producto de una serie entre dos fechas. "
     272     "Si no aparecen, se asume el cálculo con las fechas primera "
     273     "y última de la serie. Por último, si la serie carece de fechas, "
     274     "se calcula con las fechas por defecto."),
     275     BOperClassify::Statistic_);
     276  void BDatStatProd::CalcContens()
     277//--------------------------------------------------------------------
     278{
     279  if(ser_ && TsrR(ser_).Dating())
     280  {
     281    contens_ = Product(vec_);
     282  }
     283}
     284
     285//--------------------------------------------------------------------
    235286  DefExtOpr(1, BDatStatAverage, "AvrS",   1, 3, "Serie Date Date",
    236287  I2("(Serie ser [, Date from, Date until])",
    … …  
    253304  }
    254305}
     306
     307
     308//--------------------------------------------------------------------
     309  DefExtOpr(1, BDatStatGeometricAverage, "GeometricAvrS",         1, 3, "Serie Date Date",
     310  I2("(Serie ser [, Date from, Date until])",
     311     "(Serie ser [, Date desde, Date hasta])"),
     312  I2("Returns the geometric average of a serie between two dates. "
     313     "If they do not appear, it is assumed the calculation with the "
     314     "first and last dates of the series. Finally, if the series lacks "
     315     "dates, is calculated with the dates by defect.",
     316     "Devuelve la media geométrica de una serie entre dos fechas. "
     317     "Si no aparecen, se asume el cálculo con las fechas primera "
     318     "y última de la serie. Por último, si la serie carece de fechas, "
     319     "se calcula con las fechas por defecto."),
     320     BOperClassify::Statistic_);
     321  void BDatStatGeometricAverage::CalcContens()
     322//--------------------------------------------------------------------
     323{
     324  if(ser_ && TsrR(ser_).Dating())
     325  {
     326    contens_ = GeometricAverage(vec_);
     327  }
     328}
     329
     330
     331//--------------------------------------------------------------------
     332  DefExtOpr(1, BDatStatHarmonicAverage, "HarmonicAvrS",   1, 3, "Serie Date Date",
     333  I2("(Serie ser [, Date from, Date until])",
     334     "(Serie ser [, Date desde, Date hasta])"),
     335  I2("Returns the harmonic average of a serie between two dates. "
     336     "If they do not appear, it is assumed the calculation with the "
     337     "first and last dates of the series. Finally, if the series lacks "
     338     "dates, is calculated with the dates by defect.",
     339     "Devuelve la media armónica de una serie entre dos fechas. "
     340     "Si no aparecen, se asume el cálculo con las fechas primera "
     341     "y última de la serie. Por último, si la serie carece de fechas, "
     342     "se calcula con las fechas por defecto."),
     343     BOperClassify::Statistic_);
     344  void BDatStatHarmonicAverage::CalcContens()
     345//--------------------------------------------------------------------
     346{
     347  if(ser_ && TsrR(ser_).Dating())
     348  {
     349    contens_ = HarmonicAverage(vec_);
     350  }
     351}
     352
    255353
    256354
    … …  
    374472}
    375473
    376 
    377 //--------------------------------------------------------------------
    378   DefExtOpr(1, BDatStatAsimetry,    "AsimetryS",  1, 3, "Serie Date Date",
    379   I2("(Serie ser [, Date from, Date until])",
    380      "(Serie ser [, Date desde, Date hasta])"),
     474static BText _asymmetry_types = "Serie Date Date";
     475static BText _asymmetry_args =
     476  I2("(Serie ser [, Date from, Date until])",
     477     "(Serie ser [, Date desde, Date hasta])");
     478static BText _asymmetry_desc =
    381479  I2("Returns the asymmetry coefficient of a serie between two dates. "
    382480     "If they do not appear, it is assumed the calculation with the "
    … …  
    386484     "Si no aparecen, se asume el cálculo con las fechas primera "
    387485     "y última de la serie. Por último, si la serie carece de fechas, "
    388      "se calcula con las fechas por defecto."),
    389      BOperClassify::Statistic_);
    390   void BDatStatAsimetry::CalcContens()
     486     "se calcula con las fechas por defecto.");
     487
     488//--------------------------------------------------------------------
     489  DefExtOpr(1, BDatStatAsymmetry,    "AsymmetryS",  1, 3,
     490    _asymmetry_types,_asymmetry_args,_asymmetry_desc,
     491    BOperClassify::Statistic_);
     492  DefExtOpr(2, BDatStatAsymmetry,    "AsimetryS",  1, 3,
     493    _asymmetry_types,_asymmetry_args,_asymmetry_desc + "\n"+
     494    I2("DEPRECATED! Please, use AymmetryS",
     495       "OBSOLETO! Por favor, use AymmetryS"),
     496    BOperClassify::Statistic_);
     497  void BDatStatAsymmetry::CalcContens()
    391498//--------------------------------------------------------------------
    392499{
    … …  
    448555  I2("(Serie ser, Date from, Date until, Real p)",
    449556     "(Serie ser, Date desde, Date hasta, Real p)"),
    450   I2("Returns the quantile of a given probability of a serie between two "
     557  I2("Returns the quantile of a given probability p of a serie between two "
    451558     "dates. ",
    452559     "Devuelve el cuantil de probabilidad p de una serie entre dos "
    … …  
    525632{ return(BDatStatVarianze (NCons(ser)).Contens()); }
    526633
    527 BDat StatAsimetry(BSyntaxObject* ser)
    528 { return(BDatStatAsimetry (NCons(ser)).Contens()); }
     634BDat StatAsymmetry(BSyntaxObject* ser)
     635{ return(BDatStatAsymmetry (NCons(ser)).Contens()); }
    529636
    530637BDat StatKurtosis(BSyntaxObject* ser)
  • tol/btol/real_type/tol_bdatgra.h

    rb6c14f4 r09bb52b  
    109109DeclareStatisticClass(BDatStatLast);
    110110DeclareStatisticClass(BDatStatCount);
     111DeclareStatisticClass(BDatStatKnown);
    111112DeclareStatisticClass(BDatStatMax);
    112113DeclareStatisticClass(BDatStatMin);
    … …  
    114115DeclareStatisticClass(BDatStatQuantile);
    115116DeclareStatisticClass(BDatStatSum);
     117DeclareStatisticClass(BDatStatProd);
    116118DeclareStatisticClass(BDatStatAverage);
     119DeclareStatisticClass(BDatStatGeometricAverage);
     120DeclareStatisticClass(BDatStatHarmonicAverage);
    117121DeclareStatisticClass(BDatStatVarianze);
    118122DeclareStatisticClass(BDatStatStDs);
    … …  
    120124DeclareStatisticClass(BDatStatSubSampleVarianze);
    121125DeclareStatisticClass(BDatStatSubSampleStDs);
    122 DeclareStatisticClass(BDatStatAsimetry);
     126DeclareStatisticClass(BDatStatAsymmetry);
    123127DeclareStatisticClass(BDatStatKurtosis);
    124128DeclareStatisticClass(BDatStatMoment);
    … …  
    168172DeclareCStatisticClass(BDatCStatSubSampleVarianze);
    169173DeclareCStatisticClass(BDatCStatSubSampleStDs);
    170 DeclareCStatisticClass(BDatCStatAsimetry);
     174DeclareCStatisticClass(BDatCStatAsymmetry);
    171175DeclareCStatisticClass(BDatCStatKurtosis);
    172176DeclareCStatisticClass(BDatCStatMoment);
    … …  
    189193TOL_API BDat StatStDs (BSyntaxObject* ser);
    190194TOL_API BDat StatVarianze (BSyntaxObject* ser);
    191 TOL_API BDat StatAsimetry (BSyntaxObject* ser);
     195TOL_API BDat StatAsymmetry (BSyntaxObject* ser);
    192196TOL_API BDat StatKurtosis (BSyntaxObject* ser);
    193197TOL_API BDat StatMedian (BSyntaxObject* ser);
    … …  
    206210TOL_API BDat CStatStDs (BSyntaxObject* cser);
    207211TOL_API BDat CStatVarianze (BSyntaxObject* cser);
    208 TOL_API BDat CStatAsimetry (BSyntaxObject* cser);
     212TOL_API BDat CStatAsymmetry (BSyntaxObject* cser);
    209213TOL_API BDat CStatKurtosis (BSyntaxObject* cser);
    210214TOL_API BDat CStatMedian (BSyntaxObject* cser);
  • tol/btol/vmatrix_type/vmatgra.cpp

    rb6c14f4 r09bb52b  
    3939#include <tol/tol_blanguag.h>
    4040#include <tol/tol_bvmat_bsr.h>
     41#include <tol/tol_bstat.h>
    4142#include <tol/tol_bdir.h>
    4243
    … …  
    23442345
    23452346//--------------------------------------------------------------------
     2347  DeclareContensClass(BDat, BDatTemporary, BDatVMatCount);
     2348  DefExtOpr(1, BDatVMatCount, "VMatCount", 1, 1, "VMatrix",
     2349  "(VMatrix mat)",
     2350  I2("Returns the number of cells of a matrix (rows x columns).",
     2351     "Devuelve el número de celdas de una matriz (filas x columnas)."),
     2352     BOperClassify::Statistic_);
     2353  void BDatVMatCount::CalcContens()
     2354//--------------------------------------------------------------------
     2355{
     2356  BVMat& x = VMat(Arg(1));
     2357  contens_ = x.Rows() * x.Columns();
     2358}
     2359
     2360//--------------------------------------------------------------------
     2361  DeclareContensClass(BDat, BDatTemporary, BDatVMatKnown);
     2362  DefExtOpr(1, BDatVMatKnown, "VMatKnown", 1, 1, "VMatrix",
     2363  "(VMatrix mat)",
     2364  I2("Returns the number of cells of a matrix (rows x columns).",
     2365     "Devuelve el número de celdas de una matriz (filas x columnas)."),
     2366     BOperClassify::Statistic_);
     2367  void BDatVMatKnown::CalcContens()
     2368//--------------------------------------------------------------------
     2369{
     2370  BVMat& x = VMat(Arg(1));
     2371  BMat y;
     2372  x.GetDMatT(*((DMat*)&y));
     2373  contens_ = Known(y.Data());
     2374}
     2375
     2376//--------------------------------------------------------------------
    23462377  DeclareContensClass(BDat, BDatTemporary, BDatVMatSum);
    23472378  DefExtOpr(1, BDatVMatSum, "VMatSum", 1, 1, "VMatrix",
    … …  
    23572388
    23582389//--------------------------------------------------------------------
     2390  DeclareContensClass(BDat, BDatTemporary, BDatVMatProduct);
     2391  DefExtOpr(1, BDatVMatProduct, "VMatProduct", 1, 1, "VMatrix",
     2392  "(VMatrix mat)",
     2393  I2("Returns the product of all elements of a matrix.",
     2394     "Devuelve el producto de todos los elementos de una matriz."),
     2395     BOperClassify::Statistic_);
     2396  void BDatVMatProduct::CalcContens()
     2397//--------------------------------------------------------------------
     2398{
     2399  BVMat& x = VMat(Arg(1));
     2400  BMat y;
     2401  x.GetDMatT(*((DMat*)&y));
     2402  contens_ = Product(y.Data());
     2403}
     2404
     2405//--------------------------------------------------------------------
    23592406  DeclareContensClass(BDat, BDatTemporary, BDatVMatAvr);
    23602407  DefExtOpr(1, BDatVMatAvr, "VMatAvr", 1, 1, "VMatrix",
    … …  
    23702417
    23712418//--------------------------------------------------------------------
     2419  DeclareContensClass(BDat, BDatTemporary, BDatVMatGeometricAvr);
     2420  DefExtOpr(1, BDatVMatGeometricAvr, "VMatGeometricAvr", 1, 1, "VMatrix",
     2421  "(VMatrix mat)",
     2422  I2("Returns the geometric average of all elements of a matrix.",
     2423     "Devuelve la media geométrica de todos los elementos de una matriz."),
     2424     BOperClassify::Statistic_);
     2425  void BDatVMatGeometricAvr::CalcContens()
     2426//--------------------------------------------------------------------
     2427{
     2428  BVMat& x = VMat(Arg(1));
     2429  BMat y;
     2430  x.GetDMatT(*((DMat*)&y));
     2431  contens_ = GeometricAverage(y.Data());
     2432}
     2433
     2434//--------------------------------------------------------------------
     2435  DeclareContensClass(BDat, BDatTemporary, BDatVMatHarmonicAvr);
     2436  DefExtOpr(1, BDatVMatHarmonicAvr, "VMatHarmonicAvr", 1, 1, "VMatrix",
     2437  "(VMatrix mat)",
     2438  I2("Returns the harmonic average of all elements of a matrix.",
     2439     "Devuelve la media armónica de todos los elementos de una matriz."),
     2440     BOperClassify::Statistic_);
     2441  void BDatVMatHarmonicAvr::CalcContens()
     2442//--------------------------------------------------------------------
     2443{
     2444  BVMat& x = VMat(Arg(1));
     2445  BMat y;
     2446  x.GetDMatT(*((DMat*)&y));
     2447  contens_ = GeometricAverage(y.Data());
     2448}
     2449
     2450
     2451//--------------------------------------------------------------------
    23722452  DeclareContensClass(BDat, BDatTemporary, BDatVMatVar);
    23732453  DefExtOpr(1, BDatVMatVar, "VMatVar", 1, 1, "VMatrix",
    … …  
    24202500  contens_ = VMat(Arg(1)).Kurtosis();
    24212501}
     2502
     2503//--------------------------------------------------------------------
     2504  DeclareContensClass(BDat, BDatTemporary, BDatVMatMedian);
     2505  DefExtOpr(1, BDatVMatMedian, "VMatMedian", 1, 1, "VMatrix",
     2506  "(VMatrix mat)",
     2507  I2("Returns the median of all elements of a matrix.",
     2508     "Devuelve la mediana de todos los elementos de una matriz."),
     2509     BOperClassify::Statistic_);
     2510  void BDatVMatMedian::CalcContens()
     2511//--------------------------------------------------------------------
     2512{
     2513  BVMat& x = VMat(Arg(1));
     2514  BMat y;
     2515  x.GetDMatT(*((DMat*)&y));
     2516  contens_ = Median(y.Data());
     2517}
     2518
     2519//--------------------------------------------------------------------
     2520  DeclareContensClass(BDat, BDatTemporary, BDatVMatQunatile);
     2521  DefExtOpr(1, BDatVMatQunatile, "VMatQuantile", 2, 2, "VMatrix Real",
     2522  "(VMatrix mat, Real p)",
     2523  I2("Returns the the quantile of a given probability p of all elements of a matrix.",
     2524     "Devuelve el cuantil de probabilidad p de todos los elementos de una matriz."),
     2525     BOperClassify::Statistic_);
     2526  void BDatVMatQunatile::CalcContens()
     2527//--------------------------------------------------------------------
     2528{
     2529  BVMat& x = VMat(Arg(1));
     2530  BDat p = Dat(Arg(2));
     2531  BMat y;
     2532  x.GetDMatT(*((DMat*)&y));
     2533  contens_ = Quantile(y.Data(),p);
     2534}
     2535
    24222536
    24232537//--------------------------------------------------------------------
  • tol/lang/language.cpp

    rb6c14f4 r09bb52b  
    768768  if(header=="_DEFAULT_HEADER_")
    769769  {
    770     table[i++][0] = I2("Statistic  ", "Estadᅵstico");
     770    table[i++][0] = I2("Statistic  ", "Estadístico");
    771771    table[i++][0] = I2("Count      ", "Longitud   ");
    772     table[i++][0] = I2("Maximum    ", "Mᅵximo     ");
    773     table[i++][0] = I2("Minimum    ", "Mᅵnimo     ");
     772    table[i++][0] = I2("Maximum    ", "Máximo     ");
     773    table[i++][0] = I2("Minimum    ", "Mínimo     ");
    774774    table[i++][0] = I2("Sum        ", "Suma       ");
    775775    table[i++][0] = I2("Average    ", "Media      ");
    776776    table[i++][0] = I2("Std. Desv. ", "Desv. Tip. ");
    777777    table[i++][0] = I2("Varianze   ", "Varianza   ");
    778     table[i++][0] = I2("Asymmetry   ", "Asimetrᅵa  ");
     778    table[i++][0] = I2("Asymmetry  ", "Asimetría  ");
    779779    table[i++][0] = I2("Kurtosis   ", "Curtosis   ");
    780780    table[i++][0] = I2("Median     ", "Mediana    ");
    … …  
    798798      i=0;
    799799      table[i++][j] = ser->Identify();
    800       table[i++][j] = StatCount   (ser).Name();
    801       table[i++][j] = StatMax     (ser).Name();
    802       table[i++][j] = StatMin     (ser).Name();
    803       table[i++][j] = StatSum     (ser).Name();
    804       table[i++][j] = StatAverage (ser).Name();
    805       table[i++][j] = StatStDs    (ser).Name();
    806       table[i++][j] = StatVarianze(ser).Name();
    807       table[i++][j] = StatAsimetry(ser).Name();
    808       table[i++][j] = StatKurtosis(ser).Name();
    809       table[i++][j] = StatMedian  (ser).Name();
     800      table[i++][j] = StatCount    (ser).Name();
     801      table[i++][j] = StatMax      (ser).Name();
     802      table[i++][j] = StatMin      (ser).Name();
     803      table[i++][j] = StatSum      (ser).Name();
     804      table[i++][j] = StatAverage  (ser).Name();
     805      table[i++][j] = StatStDs     (ser).Name();
     806      table[i++][j] = StatVarianze (ser).Name();
     807      table[i++][j] = StatAsymmetry(ser).Name();
     808      table[i++][j] = StatKurtosis (ser).Name();
     809      table[i++][j] = StatMedian   (ser).Name();
    810810    }
    811811    lst = Cdr(lst);
Note: See TracChangeset for help on using the changeset viewer.