Home | Develop | Download | Contact
example_matrixmath_erf.cpp

Programa para el testeo de las funciones.

Programa para el testeo de las funciones.Para compilar o código example_matrixmath_erf.cpp:

g++ -static -o example_matrixmath_erf example_matrixmath_erf.cpp -lpdsramm

Para executar o programa:

./example_matrixmath_erf

Retornando por consola:

Pds::CDF::Probit(0.0):  -inf
Pds::CDF::Probit(0.1):  -1.28155
Pds::CDF::Probit(0.3):  -0.524401
Pds::CDF::Probit(0.5):  0
Pds::CDF::Probit(0.7):  0.524401
Pds::CDF::Probit(0.9):  1.28155
Pds::CDF::Probit(1.0):  inf
P.T():  0   0.1 0.3 0.5 0.7 0.9 1   
Pds::CDF::Probit(P).T():
-inf             -1.2815515641402 -0.5244005132793 0                0.5244005132793  1.2815515641402  inf              
Pds::CDF::Phi(Pds::CDF::Probit(P)).T():
0                0.10000000024648 0.29999999980138 0.5              0.70000000019862 0.89999999975352 1    

Código example_matrixmath_erf.cpp:

#include <Pds/Ra>
int main(void)
{
std::cout<<"Pds::CDF::Probit(0.0):\t"<<Pds::CDF::Probit(0.0)<<"\n";
std::cout<<"Pds::CDF::Probit(0.1):\t"<<Pds::CDF::Probit(0.1)<<"\n";
std::cout<<"Pds::CDF::Probit(0.3):\t"<<Pds::CDF::Probit(0.3)<<"\n";
std::cout<<"Pds::CDF::Probit(0.5):\t"<<Pds::CDF::Probit(0.5)<<"\n";
std::cout<<"Pds::CDF::Probit(0.7):\t"<<Pds::CDF::Probit(0.7)<<"\n";
std::cout<<"Pds::CDF::Probit(0.9):\t"<<Pds::CDF::Probit(0.9)<<"\n";
std::cout<<"Pds::CDF::Probit(1.0):\t"<<Pds::CDF::Probit(1.0)<<"\n";
Pds::Vector P("0.0 0.1 0.3 0.5 0.7 0.9 1.0");
P.T().Print("P.T():\t");
Pds::CDF::Probit(P).T().Print("Pds::CDF::Probit(P).T():\n");
Pds::CDF::Phi(Pds::CDF::Probit(P)).T().Print("Pds::CDF::Phi(Pds::CDF::Probit(P)).T():\n");
return 0;
}
La clase tipo Pds::Vector . Esta clase genera una matriz de Nlin lineas y 1 columna....
Definition: Vector.hpp:80
double Phi(double x)
Calcula el valor de la función .
double Probit(double p)
Calcula el valor de la función que es la inversa de Pds::CDF::Phi().
Pds::Matrix T(void) const
Transpuesta de si mismo (A), el resultado es cargado en B.
void Print(const std::string &str, unsigned int precision) const
Imprime en pantalla el contenido de la matriz después del texto indicado en str.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed