PythonãRãªã©ã®èšèªã¯ããŒã¿ãµã€ãšã³ã¹ã§ãŸããŸã人æ°ãé«ãŸã£ãŠããŸãããCããã³C ++ã¯ããŒã¿ãµã€ãšã³ã¹ã®åé¡ãå¹ççã«è§£æ±ºããããã®åŒ·åãªéžæè¢ã«ãªãåŸãŸãããã®èšäºã§ã¯ãC99ãšC ++ 11ã䜿çšããŠãAnscombeã«ã«ãããã§åäœããããã°ã©ã ãäœæããŸããããã«ã€ããŠã¯ã次ã«èª¬æããŸãã
ç§ã¯PythonãšGNU Octaveã®èšäºã§åžžã«èšèªãåŠã¶åæ©ã«ã€ããŠæžããã®ã§ãèªã䟡å€ããããŸãããã¹ãŠã®ããã°ã©ã ã¯ã³ãã³ãã©ã€ã³çšã§ãããã°ã©ãã£ã«ã«ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ïŒGUIïŒã§ã¯ãããŸãããå®å šãªäŸã¯polyglot_fitãªããžããªã«ãããŸãã
ããã°ã©ãã³ã°ã®èª²é¡
ãã®ã·ãªãŒãºã§äœæããããã°ã©ã ïŒ
- CSVãã¡ã€ã«ããããŒã¿ãèªã¿åããŸã
- çŽç·ã§ããŒã¿ãè£éããŸãïŒã€ãŸããfïŒxïŒ= mâ x + qïŒã
- çµæãç»åãã¡ã€ã«ã«æžã蟌ã¿ãŸã
ããã¯ãå€ãã®ããŒã¿ãµã€ãšã³ãã£ã¹ããçŽé¢ããå ±éã®èª²é¡ã§ããããŒã¿ã®äŸã¯ã次ã®è¡šã«ç€ºãAnscombeã«ã«ãããã®æåã®ã»ããã§ããããã¯äººå·¥çã«äœæãããããŒã¿ã®ã»ããã§ãããçŽç·ã«åœãŠã¯ãããšåãçµæã«ãªããŸãããã°ã©ãã¯å€§ããç°ãªããŸããããŒã¿ãã¡ã€ã«ã¯ãåãåºåãããã®ã¿ããšããããŒã圢æããè€æ°ã®è¡ãå«ãããã¹ããã¡ã€ã«ã§ãããã®åé¡ã¯ãæåã®ã»ããïŒã€ãŸããæåã®2åïŒã®ã¿ã䜿çšããŸãã
ã¢ã³ã¹ã³ã ã«ã«ããã
Cã®ãœãªã¥ãŒã·ã§ã³
Cã¯ãä»æ¥äœ¿çšãããŠããæã人æ°ã®ããèšèªã®1ã€ã§ããæ±çšããã°ã©ãã³ã°èšèªã§ãïŒTIOBEã€ã³ããã¯ã¹ãRedMonkããã°ã©ãã³ã°èšèªã©ã³ãã³ã°ãããã°ã©ãã³ã°èšèªäººæ°åºŠã€ã³ããã¯ã¹ãããã³GitHub調æ»ã«ãããšïŒãããã¯å€ãèšèªã§ããïŒ1973幎é ã«äœæãããŸããïŒãå€ãã®æåããããã°ã©ã ããã®èšèªã§èšè¿°ãããŠããŸãïŒããšãã°ãLinuxã«ãŒãã«ãGitïŒããã®èšèªã¯ãçŽæ¥çãªã¡ã¢ãªç®¡çã«äœ¿çšããããããã³ã³ãã¥ãŒã¿ã®å éšåäœã«ãã§ããéãè¿ããã®ã§ããããã¯ã³ã³ãã€ã«ãããèšèªã§ããããããœãŒã¹ã³ãŒãã¯ã³ã³ãã€ã©ã«ãã£ãŠãã·ã³ã³ãŒãã«å€æãããå¿ èŠããããŸãã圌ã®æšæºã©ã€ãã©ãªã¯ãµã€ãºãå°ãã軜ããããäžè¶³ããŠããæ©èœãæäŸããããã«ä»ã®ã©ã€ãã©ãªãéçºãããŠããŸãã
ããã¯ãäž»ã«ãã®ããã©ãŒãã³ã¹ã®ããã«ãæ°å€ã®å§çž®ã«æããã䜿çšããèšèªã§ããå€ãã®ãã€ã©ãŒãã¬ãŒãã³ãŒããå¿ èŠãªããã䜿çšããã®ã¯éåžžã«éå±ã§ãããããŸããŸãªç°å¢ã§ååã«ãµããŒããããŠããŸããC99æšæºã¯ãããã€ãã®æ°ã®å©ããæ©èœãè¿œå ããæè¿ã®ãªããžã§ã³ã§ãããã³ã³ãã€ã©ãŒã«ãã£ãŠååã«ãµããŒããããŠããŸãã
åå¿è ãšçµéšè±å¯ãªãŠãŒã¶ãŒã®äž¡æ¹ããããã®èšèªã䜿çšã§ããããã«ãCããã³C ++ã§ã®ããã°ã©ãã³ã°ã®åææ¡ä»¶ã«ã€ããŠèª¬æããŸãã
åãä»ã
C99éçºã«ã¯ã³ã³ãã€ã©ãå¿ èŠã§ããç§ã¯éåžžClangã䜿çšããŸããããã1ã€ã®æ¬æ ŒçãªãªãŒãã³ãœãŒã¹ã³ã³ãã€ã©ã§ããGCCã䜿çšããŸããããŒã¿ã«åãããããã«ãGNUç§åŠã©ã€ãã©ãªãŒã䜿çšããããšã«ããŸãããããããã®ããã«ãç§ã¯åŠ¥åœãªã©ã€ãã©ãªãèŠã€ããããšãã§ããªãã£ãããããã®ããã°ã©ã ã¯å€éšããã°ã©ã Gnuplotã«äŸåããŠããŸãããã®äŸã§ã¯ãåçããŒã¿æ§é ã䜿çšããŠããŒã¿ãæ ŒçŽããŸããããã¯ãBerkeley Software DistributionïŒBSDïŒã§å®çŸ©ãããŠããŸããFedoraãžã®
ã€ã³ã¹ããŒã«ã¯éåžžã«ç°¡åã§ãïŒ
sudo dnf install clang gnuplot gsl gsl-devel
ã³ãŒãã³ã¡ã³ã
C99ã§ã¯ãã³ã¡ã³ãã¯è¡ã®å é ã«//ãè¿œå ããããšã§ãã©ãŒããããããè¡ã®æ®ãã®éšåã¯ã€ã³ã¿ãŒããªã¿ãŒã«ãã£ãŠç Žæ£ãããŸãã/ *ãš* /ã®éã®ãã¹ãŠãç Žæ£ãããŸãã
// .
/* */
å¿ èŠãªã©ã€ãã©ãª
ã©ã€ãã©ãªã¯2ã€ã®éšåã§æ§æãããŠããŸãã
- é¢æ°ã®èª¬æãå«ãããããŒãã¡ã€ã«
- é¢æ°å®çŸ©ãå«ããœãŒã¹ãã¡ã€ã«
ããããŒãã¡ã€ã«ã¯ãœãŒã¹ã³ãŒãã«å«ãŸããŠãããã©ã€ãã©ãªã®ãœãŒã¹ã³ãŒãã¯å®è¡å¯èœãã¡ã€ã«ã«ãªã³ã¯ãããŠããŸãããããã£ãŠããã®äŸã§ã¯ããããŒãã¡ã€ã«ãå¿ èŠã§ãã
// -
#include <stdio.h>
//
#include <stdlib.h>
//
#include <string.h>
// "" BSD
#include <sys/queue.h>
// GSL
#include <gsl/gsl_fit.h>
#include <gsl/gsl_statistics_double.h>
äž»ãªæ©èœ
Cã§ã¯ãããã°ã©ã ã¯mainïŒïŒãšããç¹å¥ãªé¢æ°å ã«ãªããã°ãªããŸããã
int main(void) {
...
}
ããã§ã¯ãååã®ãã¥ãŒããªã¢ã«ã§èª¬æããPythonãšã®éãã«æ°ä»ãã§ããããPythonã®å ŽåããœãŒã¹ãã¡ã€ã«ã§èŠã€ãã£ãã³ãŒãã¯ãã¹ãŠå®è¡ãããããã§ãã
å€æ°ã®å®çŸ©
Cã§ã¯ãå€æ°ã䜿çšããåã«å®£èšããåã«é¢é£ä»ããå¿ èŠããããŸããå€æ°ã䜿çšããå Žåã¯åžžã«ãå€æ°ã«æ ŒçŽããããŒã¿ã決å®ããå¿ èŠããããŸããå€æ°ãå®æ°å€ãšããŠäœ¿çšãããã©ãããæå®ããããšãã§ããŸãããããã¯å¿ é ã§ã¯ãããŸããããã³ã³ãã€ã©ãŒã¯ãã®æ å ±ãå©çšã§ããŸãããªããžããªãŒã®ç¶ãæ_C99.cããã°ã©ã ã®äŸïŒ
const char *input_file_name = "anscombe.csv";
const char *delimiter = "\t";
const unsigned int skip_header = 3;
const unsigned int column_x = 0;
const unsigned int column_y = 1;
const char *output_file_name = "fit_C99.csv";
const unsigned int N = 100;
Cã®é åã¯ãé·ããäºåã«ïŒã€ãŸããã³ã³ãã€ã«åã«ïŒæ±ºå®ããå¿ èŠããããšããæå³ã§åçã§ã¯ãããŸããã
int data_array[1024];
éåžžããã¡ã€ã«å ã®ããŒã¿ãã€ã³ãã®æ°ãããããªããããåäžãªã³ã¯ãªã¹ãã䜿çšããŸããããã¯ãç¡æéã«æ¡åŒµã§ããåçãªããŒã¿æ§é ã§ãã幞ããBSD ã¯åäžã«ãªã³ã¯ããããªã¹ããæäŸããŸããå®çŸ©äŸã¯æ¬¡ã®ãšããã§ãã
struct data_point {
double x;
double y;
SLIST_ENTRY(data_point) entries;
};
SLIST_HEAD(data_list, data_point) head = SLIST_HEAD_INITIALIZER(head);
SLIST_INIT(&head);
ãã®äŸã§ã¯ãxå€ãšyå€ã®äž¡æ¹ãå«ãæ§é åãããå€ã§æ§æããããªã¹ãdata_pointãå®çŸ©ããŠããŸããæ§æã¯ããªãè€éã§ãããçŽæçã§ããã詳现ãªèª¬æã¯åé·ãããŸãã
ããªã³ãã¢ãŠã
端æ«ã«åºåããã«ã¯ãOctaveã®printfïŒïŒé¢æ°ïŒæåã®èšäºã§èª¬æïŒã®ããã«æ©èœããprintfïŒïŒé¢æ°ã䜿çšã§ããŸãã
printf("#### C99 ####\n");
printfïŒïŒé¢æ°ã¯ãå°å·ãããè¡ã®çµããã«èªåçã«æ¹è¡ãè¿œå ããªããããèªåã§è¿œå ããå¿ èŠããããŸããæåã®åŒæ°ã¯æååã§ãé¢æ°ã«æž¡ãããšãã§ããä»ã®åŒæ°ã®åœ¢åŒã«é¢ããæ å ±ãå«ããããšãã§ããŸãã次ã«äŸã瀺ããŸãã
printf("Slope: %f\n", slope);
ããŒã¿ã®èªã¿åã
ããã§æ³šæãå¿ èŠãªéšåããããŸã... Cã«ã¯CSVãã¡ã€ã«ã解æããããã®ã©ã€ãã©ãªãããã€ããããŸãããFedoraããã±ãŒãžãªããžããªã«ããã»ã©ååã«å®å®ããŠããã人æ°ã®ãããã®ã¯ãããŸããããã®ãã¥ãŒããªã¢ã«ã«äŸåé¢ä¿ãè¿œå ãã代ããã«ããã®éšåãèªåã§äœæããããšã«ããŸãããç¹°ãè¿ãã«ãªããŸããã詳现ã«èª¬æããã®ã¯åé·ãããŸãããã®ãããäžè¬çãªã¢ã€ãã¢ã«ã€ããŠã®ã¿èª¬æããŸãããœãŒã¹ã³ãŒãã®ããã€ãã®è¡ã¯ç°¡æœã«ããããã«ç¡èŠãããŸãããå®å šãªäŸã¯ãªããžããªã§èŠã€ããããšãã§ããŸãã
æåã«å ¥åãã¡ã€ã«ãéããŸãã
FILE* input_file = fopen(input_file_name, "r");
次ã«ããšã©ãŒãçºçãããŸã§ããŸãã¯ãã¡ã€ã«ãçµäºãããŸã§ããã¡ã€ã«ã1è¡ãã€èªã¿åããŸãã
while (!ferror(input_file) && !feof(input_file)) {
size_t buffer_size = 0;
char *buffer = NULL;
getline(&buffer, &buffer_size, input_file);
...
}
getlineïŒïŒ é¢æ°ã¯ãPOSIX.1-2008æšæºã«æè¿è¿œå ãããçŽ æŽãããæ©èœã§ãããã¡ã€ã«ã®è¡å šäœãèªã¿åããå¿ èŠãªã¡ã¢ãªãå²ãåœãŠãããšãã§ããŸãã次ã«ãåè¡ã¯strtokïŒïŒé¢æ°ã䜿çšããŠããŒã¯ã³ã«åå²ãããŸããããŒã¯ã³ãèŠãŠãå¿ èŠãªåãéžæããŸãã
char *token = strtok(buffer, delimiter);
while (token != NULL)
{
double value;
sscanf(token, "%lf", &value);
if (column == column_x) {
x = value;
} else if (column == column_y) {
y = value;
}
column += 1;
token = strtok(NULL, delimiter);
}
æåŸã«ãxå€ãšyå€ãéžæããŠãæ°ãããã€ã³ãããªã¹ãã«è¿œå ããŸãã
struct data_point *datum = malloc(sizeof(struct data_point));
datum->x = x;
datum->y = y;
SLIST_INSERT_HEAD(&head, datum, entries);
mallocïŒïŒ é¢æ°ã¯ãæ°ãããã€ã³ãã«äžå®éã®æ°žç¶ã¡ã¢ãªãåçã«å²ãåœãŠïŒäºçŽïŒããŸãã
ãã£ããã£ã³ã°ããŒã¿
GSLã® ç·åœ¢è£éé¢æ°gsl_fit_linearïŒïŒã¯ãå ¥åãšããŠéåžžã®é åãåãå ¥ããŸãããããã£ãŠãäœæãããé åã®ãµã€ãºãäºåã«ç¥ãããšãã§ããªããããæåã§é åã«ã¡ã¢ãªãå²ãåœãŠãå¿ èŠããããŸãã
const size_t entries_number = row - skip_header - 1;
double *x = malloc(sizeof(double) * entries_number);
double *y = malloc(sizeof(double) * entries_number);
次ã«ããªã¹ãã調ã¹ãŠãé¢é£ããããŒã¿ãé åã«æ ŒçŽããŸãã
SLIST_FOREACH(datum, &head, entries) {
const double current_x = datum->x;
const double current_y = datum->y;
x[i] = current_x;
y[i] = current_y;
i += 1;
}
ãªã¹ããå®æããã®ã§ã泚æãæŽçããŸããã¡ã¢ãªãªãŒã¯ãé²ãããã«ãæåã§å²ãåœãŠãã¡ã¢ãªã¯åžžã«è§£æŸããŠãã ãããã¡ã¢ãªãªãŒã¯ã¯ãã²ã©ããã²ã©ãããŸãã²ã©ããã®ã§ããèšæ¶ã解æŸãããªããã³ã«ãåºã®ããŒã ã¯é ã倱ããŸãã
while (!SLIST_EMPTY(&head)) {
struct data_point *datum = SLIST_FIRST(&head);
SLIST_REMOVE_HEAD(&head, entries);
free(datum);
}
æåŸã«ãæåŸã«ïŒïŒïŒãããŒã¿ãé©åãããããšãã§ããŸãã
gsl_fit_linear(x, 1, y, 1, entries_number,
&intercept, &slope,
&cov00, &cov01, &cov11, &chi_squared);
const double r_value = gsl_stats_correlation(x, 1, y, 1, entries_number);
printf("Slope: %f\n", slope);
printf("Intercept: %f\n", intercept);
printf("Correlation coefficient: %f\n", r_value);
ã°ã©ãããããããã
ã°ã©ããããããããã«ã¯ãå€éšããã°ã©ã ã䜿çšããå¿ èŠããããŸãããããã£ãŠããã£ããã£ã³ã°é¢æ°ãå€éšãã¡ã€ã«ã«ä¿åããŸãã
const double step_x = ((max_x + 1) - (min_x - 1)) / N;
for (unsigned int i = 0; i < N; i += 1) {
const double current_x = (min_x - 1) + step_x * i;
const double current_y = intercept + slope * current_x;
fprintf(output_file, "%f\t%f\n", current_x, current_y);
}
Gnuplotããããã³ãã³ãã¯æ¬¡ã®ããã«ãªããŸãã
plot 'fit_C99.csv' using 1:2 with lines title 'Fit', 'anscombe.csv' using 1:2 with points pointtype 7 title 'Data'
çµæ
ããã°ã©ã ãå®è¡ããåã«ãããã°ã©ã ãã³ã³ãã€ã«ããå¿ èŠããããŸãã
clang -std=c99 -I/usr/include/ fitting_C99.c -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_C99
ãã®ã³ãã³ãã¯ãã³ã³ãã€ã©ãŒã«C99æšæºã䜿çšããfitting_C99.cãã¡ã€ã«ãèªã¿åããgslããã³gslcblasã©ã€ãã©ãªãŒãããŒãããŠãçµæãFitting_C99ã«ä¿åããããã«æ瀺ããŸããã³ãã³ãã©ã€ã³ã®çµæã®åºåïŒ
#### C99 ####
: 0.500091
: 3.000091
: 0.816421
以äžã¯ãGnuplotã䜿çšããŠçæãããçµæã®ç»åã§ãã
C ++ 11ãœãªã¥ãŒã·ã§ã³
C ++ã¯ãä»æ¥äœ¿çšãããŠããæã人æ°ã®ããèšèªã®1ã€ã§ãããæ±çšããã°ã©ãã³ã°èšèªã§ãããªããžã§ã¯ãæåããã°ã©ãã³ã°ïŒOOPïŒã«éç¹ã眮ããŠãCèšèªïŒ1983幎ïŒã®åŸç¶ãšããŠäœæãããŸããã C ++ã¯äžè¬ã«Cã®ã¹ãŒããŒã»ãããšèŠãªããããããCããã°ã©ã ã¯C ++ã³ã³ãã€ã©ã§ã³ã³ãã€ã«ããå¿ èŠããããŸããåäœãç°ãªãããã€ãã®ãšããžã±ãŒã¹ããããããããã¯åžžã«åœãŠã¯ãŸãããã§ã¯ãããŸãããç§ã®çµéšã§ã¯ãC ++ã¯Cãããã€ã©ãŒãã¬ãŒãã³ãŒããå¿ èŠãšããŸãããããªããžã§ã¯ããèšèšããå Žåããã®æ§æã¯ããè€éã§ãã C ++ 11æšæºã¯æè¿ã®ãªããžã§ã³ã§ãããã³ã³ãã€ã©ãŒã«ãã£ãŠãµããŒããããå€ããå°ãªããããã€ãã®æ°ã®å©ããæ©èœãè¿œå ããŠããŸãã
C ++ã¯Cãšã»ãŒäºææ§ãããããããã®2ã€ã®éãã«ã®ã¿çŠç¹ãåœãŠãŸãããã®éšåã§ã»ã¯ã·ã§ã³ã説æããªãå Žåãããã¯Cãšåãã§ããããšãæå³ããŸãã
åãä»ã
C ++ã®äŸåé¢ä¿ã¯ãäŸCãšåãã§ããFedoraã§ã¯ã次ã®ã³ãã³ããå®è¡ããŸãã
sudo dnf install clang gnuplot gsl gsl-devel
å¿ èŠãªã©ã€ãã©ãª
ã©ã€ãã©ãªã¯Cãšåãããã«æ©èœããŸãããincludeãã£ã¬ã¯ãã£ãã¯å°ãç°ãªããŸãã
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
extern "C" {
#include <gsl/gsl_fit.h>
#include <gsl/gsl_statistics_double.h>
}
GSLã©ã€ãã©ãªã¯Cã§èšè¿°ãããŠããããããã®æ©èœã«ã€ããŠã³ã³ãã€ã©ã«éç¥ããå¿ èŠããããŸãã
å€æ°ã®å®çŸ©
C ++ã¯ãCãããå€ãã®ããŒã¿åïŒã¯ã©ã¹ïŒããµããŒãããŸããããšãã°ãæåååã¯ã察å¿ããCãããå€ãã®æ©èœãåããŠããŸããããã«å¿ããŠå€æ°å®çŸ©ãæŽæ°ããŸãã
const std::string input_file_name("anscombe.csv");
æååãªã©ã®æ§é åãªããžã§ã¯ãã®å Žåã=èšå·ã䜿çšããã«å€æ°ãå®çŸ©ã§ããŸãã
ããªã³ãã¢ãŠã
printfïŒïŒ é¢æ°ã䜿çšã§ããŸãããcoutã䜿çšããæ¹ãäžè¬çã§ãã<<æŒç®åã䜿çšããŠãcoutã§å°å·ããæååïŒãŸãã¯ãªããžã§ã¯ãïŒãæå®ããŸãã
std::cout << "#### C++11 ####" << std::endl;
...
std::cout << " : " << slope << std::endl;
std::cout << ": " << intercept << std::endl;
std::cout << " : " << r_value << std::endl;
ããŒã¿ã®èªã¿åã
åè·¯ã¯ä»¥åãšåãã§ãããã¡ã€ã«ãéããã1è¡ãã€èªã¿èŸŒãŸããŸãããæ§æã¯ç°ãªããŸãã
std::ifstream input_file(input_file_name);
while (input_file.good()) {
std::string line;
getline(input_file, line);
...
}
æååããŒã¯ã³ã¯ãC99ã®äŸãšåãé¢æ°ã«ãã£ãŠååŸãããŸããæšæºã®Cé åã®ä»£ããã«2ã€ã®ãã¯ãã«ã䜿çšããŸãããã¯ãã«ã¯ãC ++ æšæºã©ã€ãã©ãªã®Cé åã®æ¡åŒµã§ãmallocïŒïŒãåŒã³åºããã«ã¡ã¢ãªãåçã«ç®¡çããŸãã
std::vector<double> x;
std::vector<double> y;
// x y
x.emplace_back(value);
y.emplace_back(value);
ãã£ããã£ã³ã°ããŒã¿
ãã¯ãã«ã¯ã·ãŒã±ã³ã·ã£ã«ã¡ã¢ãªãæã£ãŠããããšãä¿èšŒãããŠããã®ã§ãC ++ã§ããŒã¿ãåããããã«ããªã¹ãã«ã€ããŠå¿é ããå¿ èŠã¯ãããŸããããã¯ãã«ãããã¡ãŒãžã®ãã€ã³ã¿ãŒããã£ããã£ã³ã°é¢æ°ã«çŽæ¥æž¡ãããšãã§ããŸãã
gsl_fit_linear(x.data(), 1, y.data(), 1, entries_number,
&intercept, &slope,
&cov00, &cov01, &cov11, &chi_squared);
const double r_value = gsl_stats_correlation(x.data(), 1, y.data(), 1, entries_number);
std::cout << " : " << slope << std::endl;
std::cout << ": " << intercept << std::endl;
std::cout << " : " << r_value << std::endl;
ã°ã©ãããããããã
ããããã¯ä»¥åãšåãæ¹æ³ã§è¡ãããŸãããã¡ã€ã«ã«æžã蟌ãïŒ
const double step_x = ((max_x + 1) - (min_x - 1)) / N;
for (unsigned int i = 0; i < N; i += 1) {
const double current_x = (min_x - 1) + step_x * i;
const double current_y = intercept + slope * current_x;
output_file << current_x << "\t" << current_y << std::endl;
}
output_file.close();
次ã«ãGnuplotã䜿çšããŠã°ã©ããããããããŸãã
çµæ
ããã°ã©ã ãå®è¡ããåã«ãåæ§ã®ã³ãã³ãã§ã³ã³ãã€ã«ããå¿ èŠããããŸãã
clang++ -std=c++11 -I/usr/include/ fitting_Cpp11.cpp -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_Cpp11
ã³ãã³ãã©ã€ã³ã§ã®çµæã®åºåïŒ
#### C++11 ####
: 0.500091
: 3.00009
: 0.816421
ãããŠããããGnuplotã§çæãããçµæã®ç»åã§ãã
çµè«
ãã®èšäºã§ã¯ãC99ããã³C ++ 11ã§ã®ããŒã¿ã®ãã£ããã£ã³ã°ãšããããã®äŸã瀺ããŸãã C ++ã¯Cãšã»ãŒäºææ§ãããããããã®èšäºã§ã¯é¡äŒŒç¹ã䜿çšããŠ2çªç®ã®äŸãèšè¿°ããŸããäžéšã®åŽé¢ã§ã¯ãC ++ã¯æ瀺çãªã¡ã¢ãªç®¡çã®è² æ ãéšåçã«è»œæžããããã䜿ãããããªã£ãŠããŸãããOOPã®ã¯ã©ã¹ãäœæããæ©èœãå°å ¥ããŠãããããæ§æã¯ããè€éã§ãããã ããOOPã¯ããã°ã©ãã³ã°ã¹ã¿ã€ã«ã§ãããããOOPãã¯ããã¯ã䜿çšããŠCã§èšè¿°ããããšãã§ããŸããããã¯ãã©ã®èšèªã§ã䜿çšã§ããŸããGObjectãJanssonã©ã€ãã©ãªãªã©ãCã§ã®OOPã®åªããäŸãããã€ããããŸãã
æ°å€ã®åŠçã«ã¯ãæ§æãåçŽã§ãµããŒãç¯å²ãåºããããC99ã䜿çšããããšã奜ã¿ãŸããæè¿ãŸã§ãC ++ 11ã¯åºããµããŒããããŠããªãã£ãããã以åã®ããŒãžã§ã³ã§ã¯èåããªéšåãé¿ããããšããŸãããããè€éãªãœãããŠã§ã¢ã®å Žåã¯ãC ++ãéžæããããšããå§ãããŸãã
ããŒã¿ãµã€ãšã³ã¹ã«CãŸãã¯C ++ã䜿çšããŠããŸããïŒã³ã¡ã³ãã§ããªãã®çµéšãå ±æããŠãã ããã
SkillFactoryã®ææãªã³ã©ã€ã³ã³ãŒã¹ãåè¬ããŠãã¹ãã«ãšçµŠäžã®æ³šç®ã®è·æ¥ããŒãããååŸããæ¹æ³ã®è©³çŽ°ãã芧ãã ããã
- æ©æ¢°åŠç¿ã³ãŒã¹ïŒ12é±éïŒ
- ããŒã¿ãµã€ãšã³ã¹ã®å°éè·ããŒããããã¬ãŒãã³ã°ããïŒ12ãæïŒ
- åå¿è ã¬ãã«ã®åæè·ïŒ9ãæïŒ
- Python for Web Developmentã³ãŒã¹ïŒ9ãæïŒ