-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
begarco
committed
Nov 18, 2015
1 parent
96ca0c6
commit f3aa691
Showing
96 changed files
with
1,772 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/** | ||
* | ||
* \file Student.cpp | ||
* \brief Loi de Student. | ||
* \author Benoit GARCON | ||
* \author Benjamin BARBESANGE | ||
* \version 1.0 | ||
* \date 20 Novembre 2015 | ||
* | ||
* Permet d'utiliser la loi de Student. | ||
* | ||
*/ | ||
|
||
#include "Student.h" | ||
|
||
Student::Student() { | ||
/* -------------------------------------------------------------------- */ | ||
/* constructor Genere une "table de Student" a alpha = 5% */ | ||
/* */ | ||
/* En entree: void */ | ||
/* */ | ||
/* En sortie: void */ | ||
/* -------------------------------------------------------------------- */ | ||
// Tableau statique des 30 premieres valeurs | ||
values_ = new double[30]; | ||
values_[0] = 12.706; values_[1] = 4.303; values_[2] = 3.182; values_[3] = 2.776; values_[4] = 2.571; | ||
values_[5] = 2.447; values_[6] = 2.365; values_[7] = 2.308; values_[8] = 2.262; values_[9] = 2.228; | ||
values_[10] = 2.201; values_[11] = 2.179; values_[12] = 2.160; values_[13] = 2.145; values_[14] = 2.131; | ||
values_[15] = 2.120; values_[16] = 2.110; values_[17] = 2.101; values_[18] = 2.093; values_[19] = 2.086; | ||
values_[20] = 2.080; values_[21] = 2.074; values_[22] = 2.069; values_[23] = 2.064; values_[24] = 2.060; | ||
values_[25] = 2.056; values_[26] = 2.052; values_[27] = 2.048; values_[28] = 2.045; values_[29] = 2.042; | ||
|
||
// Equation de droites pour approximation | ||
coeff_40_30_ = (2.021-2.042)/(double)(40-30); off_40_30 = 2.042 - (30. * coeff_40_30_); | ||
coeff_80_40_ = (2.000-2.021)/(double)(80-40); off_80_40 = 2.021 - (40. * coeff_80_40_); | ||
coeff_120_80_ = (1.980-2.00)/(double)(120-80); off_120_80 = 2.00 - (80. * coeff_120_80_); | ||
|
||
infty_ = 1.960; | ||
} | ||
|
||
Student::~Student(){ | ||
/* -------------------------------------------------------------------- */ | ||
/* destructor Libere la memoire de la "table de Student" */ | ||
/* */ | ||
/* En entree: void */ | ||
/* */ | ||
/* En sortie: void */ | ||
/* -------------------------------------------------------------------- */ | ||
if(values_) { | ||
delete [] values_; | ||
} | ||
} | ||
|
||
double Student::getQuantile(int p_degre_liberte) { | ||
/* -------------------------------------------------------------------- */ | ||
/* getQuantile Permet de recuperer le quantile pour n experiences */ | ||
/* */ | ||
/* En entree: p_degre_liberte : un entier */ | ||
/* */ | ||
/* En sortie: double */ | ||
/* -------------------------------------------------------------------- */ | ||
double quantile = 0.; | ||
|
||
if(p_degre_liberte > 0) { | ||
if(p_degre_liberte < 31) { | ||
quantile = values_[p_degre_liberte - 1]; | ||
} else if (p_degre_liberte < 41) { | ||
quantile = p_degre_liberte * coeff_40_30_ + off_40_30; | ||
} else if (p_degre_liberte < 81) { | ||
quantile = p_degre_liberte * coeff_80_40_ + off_80_40; | ||
} else if (p_degre_liberte <= 120) { | ||
quantile = p_degre_liberte * coeff_120_80_ + off_80_40; | ||
} else { | ||
quantile = infty_; | ||
} | ||
} | ||
return quantile; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* | ||
* \file Student.cpp | ||
* \brief Loi de Student. | ||
* \author Benoit GARCON | ||
* \author Benjamin BARBESANGE | ||
* \version 1.0 | ||
* \date 20 Novembre 2015 | ||
* | ||
* Permet d'utiliser la loi de Student. | ||
* | ||
*/ | ||
|
||
#ifndef STUDENT_H | ||
#define STUDENT_H | ||
|
||
/** | ||
* | ||
* \class Student | ||
* \brief Classe de la loi de Student. | ||
* | ||
* Loi de Student pour les quantiles. | ||
* | ||
*/ | ||
class Student { | ||
protected: | ||
/// Valeurs de 1 a 30 | ||
double * values_, | ||
/// Valeurs 30 a 40 | ||
coeff_40_30_, | ||
/// Valeurs 30 a 40 | ||
off_40_30, | ||
/// Valeurs 40 a 80 | ||
coeff_80_40_, | ||
/// Valeurs 40 a 80 | ||
off_80_40, | ||
/// Valeurs 80 a 120 | ||
coeff_120_80_, | ||
/// Valeurs 80 a 120 | ||
off_120_80, | ||
/// Valeurs a l'infini | ||
infty_; | ||
|
||
public: | ||
/** | ||
* \brief Constructeur de la classe Student. | ||
*/ | ||
Student(); | ||
/** | ||
* \brief Destructeur de la classe Student. | ||
*/ | ||
~Student(); | ||
/** | ||
* \brief Permet de recuperer le quantile pour n experiences. | ||
* \fn double getQuantile(int p_nbExp) | ||
* \param p_nbExp : entier donnant le nombre d'experiences | ||
* \return Double representant le quantile demande. | ||
*/ | ||
double getQuantile(int); | ||
}; | ||
|
||
#endif // STUDENT_H |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
var _classe_lapins_8h = | ||
[ | ||
[ "ClasseLapins", "class_classe_lapins.html", "class_classe_lapins" ], | ||
[ "INTEGER", "_classe_lapins_8h.html#a91d43eadec33c80149f92e5abf5df58c", null ] | ||
[ "INTEGER", "_classe_lapins_8h.html#a0391012cd99f054647804c6a44d6f53b", null ] | ||
]; |
Oops, something went wrong.