| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 34f1bb7 commit 38bac87
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | #ifndef lint | |
| 2 | - static char *RCSid() { return RCSid("$Id: fit.c,v 1.16 1999/10/01 14:54:30 lhecking Exp $"); } | ||
| 2 | + static char *RCSid() { return RCSid("$Id: fit.c,v 1.17 1999/10/29 18:50:55 lhecking Exp $"); } | ||
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | 5 | /* NOTICE: Change of Copyright Status | |
@@ -62,10 +62,17 @@ static char *RCSid() { return RCSid("$Id: fit.c,v 1.16 1999/10/01 14:54:30 lheck | |||
| 62 | 62 | #include <signal.h> | |
| 63 | 63 | ||
| 64 | 64 | #include "plot.h" | |
| 65 | - #include "matrix.h" | ||
| 66 | - #include "fit.h" | ||
| 67 | - #include "setshow.h" /* for load_range */ | ||
| 68 | 65 | #include "alloc.h" | |
| 66 | + #include "command.h" | ||
| 67 | + #include "datafile.h" | ||
| 68 | + #include "eval.h" | ||
| 69 | + #include "fit.h" | ||
| 70 | + #include "graphics.h" | ||
| 71 | + #include "matrix.h" | ||
| 72 | + #include "misc.h" | ||
| 73 | + #include "parse.h" | ||
| 74 | + #include "setshow.h" | ||
| 75 | + #include "util.h" | ||
| 69 | 76 | ||
| 70 | 77 | /* Just temporary */ | |
| 71 | 78 | #if defined(VA_START) && defined(ANSI_C) | |
@@ -683,22 +690,22 @@ double a[]; | |||
| 683 | 690 | /* compute errors in the parameters */ | |
| 684 | 691 | ||
| 685 | 692 | if (num_data == num_params) { | |
| 686 | - int i; | ||
| 693 | + int k; | ||
| 687 | 694 | ||
| 688 | 695 | Dblf("\nExactly as many data points as there are parameters.\n"); | |
| 689 | 696 | Dblf("In this degenerate case, all errors are zero by definition.\n\n"); | |
| 690 | 697 | Dblf("Final set of parameters \n"); | |
| 691 | 698 | Dblf("======================= \n\n"); | |
| 692 | - for (i = 0; i < num_params; i++) | ||
| 693 | - Dblf3("%-15.15s = %-15g\n", par_name[i], a[i]); | ||
| 699 | + for (k = 0; k < num_params; k++) | ||
| 700 | + Dblf3("%-15.15s = %-15g\n", par_name[k], a[k]); | ||
| 694 | 701 | } else if (chisq < NEARLY_ZERO) { | |
| 695 | - int i; | ||
| 702 | + int k; | ||
| 696 | 703 | ||
| 697 | 704 | Dblf("\nHmmmm.... Sum of squared residuals is zero. Can't compute errors.\n\n"); | |
| 698 | 705 | Dblf("Final set of parameters \n"); | |
| 699 | 706 | Dblf("======================= \n\n"); | |
| 700 | - for (i = 0; i < num_params; i++) | ||
| 701 | - Dblf3("%-15.15s = %-15g\n", par_name[i], a[i]); | ||
| 707 | + for (k = 0; k < num_params; k++) | ||
| 708 | + Dblf3("%-15.15s = %-15g\n", par_name[k], a[k]); | ||
| 702 | 709 | } else { | |
| 703 | 710 | Dblf2("degrees of freedom (ndf) : %d\n", num_data - num_params); | |
| 704 | 711 | Dblf2("rms of residuals (stdfit) = sqrt(WSSR/ndf) : %g\n", sqrt(chisq / | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | #ifndef lint | |
| 2 | - static char *RCSid() { return RCSid("$Id: graph3d.c,v 1.16 1999/10/21 21:05:18 lhecking Exp $"); } | ||
| 2 | + static char *RCSid() { return RCSid("$Id: graph3d.c,v 1.17 1999/10/29 18:51:21 lhecking Exp $"); } | ||
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - graph3d.c */ | |
@@ -51,9 +51,15 @@ static char *RCSid() { return RCSid("$Id: graph3d.c,v 1.16 1999/10/21 21:05:18 l | |||
| 51 | 51 | */ | |
| 52 | 52 | ||
| 53 | 53 | #include "plot.h" | |
| 54 | - #include "graph3d.h" /* HBB 990826: new file */ | ||
| 54 | + #include "alloc.h" | ||
| 55 | + #include "graph3d.h" | ||
| 56 | + #include "graphics.h" | ||
| 55 | 57 | #include "hidden3d.h" | |
| 58 | + #include "misc.h" | ||
| 56 | 59 | #include "setshow.h" | |
| 60 | + #include "term_api.h" | ||
| 61 | + #include "util.h" | ||
| 62 | + #include "util3d.h" | ||
| 57 | 63 | ||
| 58 | 64 | static int p_height; | |
| 59 | 65 | static int p_width; /* pointsize * t->h_tic */ | |
@@ -235,7 +241,7 @@ struct lp_style_type style; | |||
| 235 | 241 | } | |
| 236 | 242 | ||
| 237 | 243 | /* And the functions to map from user 3D space to terminal coordinates */ | |
| 238 | - void | ||
| 244 | + static void | ||
| 239 | 245 | map3d_xy(x, y, z, xt, yt) | |
| 240 | 246 | double x, y, z; | |
| 241 | 247 | unsigned int *xt, *yt; | |
@@ -1003,8 +1009,8 @@ static void | |||
| 1003 | 1009 | plot3d_impulses(plot) | |
| 1004 | 1010 | struct surface_points *plot; | |
| 1005 | 1011 | { | |
| 1006 | - int i; /* point index */ | ||
| 1007 | - unsigned int x, y, x0, y0; /* point in terminal coordinates */ | ||
| 1012 | + int i; /* point index */ | ||
| 1013 | + unsigned int x, y, xx0, yy0; /* point in terminal coordinates */ | ||
| 1008 | 1014 | struct iso_curve *icrvs = plot->iso_crvs; | |
| 1009 | 1015 | ||
| 1010 | 1016 | while (icrvs) { | |
@@ -1017,14 +1023,14 @@ struct surface_points *plot; | |||
| 1017 | 1023 | map3d_xy(points[i].x, points[i].y, points[i].z, &x, &y); | |
| 1018 | 1024 | ||
| 1019 | 1025 | if (inrange(0.0, min3d_z, max3d_z)) { | |
| 1020 | - map3d_xy(points[i].x, points[i].y, 0.0, &x0, &y0); | ||
| 1026 | + map3d_xy(points[i].x, points[i].y, 0.0, &xx0, &yy0); | ||
| 1021 | 1027 | } else if (inrange(min3d_z, 0.0, points[i].z)) { | |
| 1022 | - map3d_xy(points[i].x, points[i].y, min3d_z, &x0, &y0); | ||
| 1028 | + map3d_xy(points[i].x, points[i].y, min3d_z, &xx0, &yy0); | ||
| 1023 | 1029 | } else { | |
| 1024 | - map3d_xy(points[i].x, points[i].y, max3d_z, &x0, &y0); | ||
| 1030 | + map3d_xy(points[i].x, points[i].y, max3d_z, &xx0, &yy0); | ||
| 1025 | 1031 | } | |
| 1026 | 1032 | ||
| 1027 | - clip_move(x0, y0); | ||
| 1033 | + clip_move(xx0, yy0); | ||
| 1028 | 1034 | clip_vector(x, y); | |
| 1029 | 1035 | ||
| 1030 | 1036 | break; | |
@@ -1037,7 +1043,7 @@ struct surface_points *plot; | |||
| 1037 | 1043 | ||
| 1038 | 1044 | if (inrange(0.0, min3d_z, max3d_z)) { | |
| 1039 | 1045 | /* zero point is INRANGE */ | |
| 1040 | - map3d_xy(points[i].x, points[i].y, 0.0, &x0, &y0); | ||
| 1046 | + map3d_xy(points[i].x, points[i].y, 0.0, &xx0, &yy0); | ||
| 1041 | 1047 | ||
| 1042 | 1048 | /* must cross z = min3d_z or max3d_z limits */ | |
| 1043 | 1049 | if (inrange(min3d_z, 0.0, points[i].z) && | |
@@ -1052,14 +1058,14 @@ struct surface_points *plot; | |||
| 1052 | 1058 | inrange(max3d_z, 0.0, points[i].z)) { | |
| 1053 | 1059 | /* crosses z = min3d_z or max3d_z limits */ | |
| 1054 | 1060 | map3d_xy(points[i].x, points[i].y, max3d_z, &x, &y); | |
| 1055 | - map3d_xy(points[i].x, points[i].y, min3d_z, &x0, &y0); | ||
| 1061 | + map3d_xy(points[i].x, points[i].y, min3d_z, &xx0, &yy0); | ||
| 1056 | 1062 | } else { | |
| 1057 | 1063 | /* doesn't cross z = min3d_z or max3d_z limits */ | |
| 1058 | 1064 | break; | |
| 1059 | 1065 | } | |
| 1060 | 1066 | } | |
| 1061 | 1067 | ||
| 1062 | - clip_move(x0, y0); | ||
| 1068 | + clip_move(xx0, yy0); | ||
| 1063 | 1069 | clip_vector(x, y); | |
| 1064 | 1070 | ||
| 1065 | 1071 | break; | |
@@ -1087,7 +1093,7 @@ plot3d_lines(plot) | |||
| 1087 | 1093 | struct surface_points *plot; | |
| 1088 | 1094 | { | |
| 1089 | 1095 | int i; | |
| 1090 | - unsigned int x, y, x0, y0; /* point in terminal coordinates */ | ||
| 1096 | + unsigned int x, y, xx0, yy0; /* point in terminal coordinates */ | ||
| 1091 | 1097 | double clip_x, clip_y, clip_z; | |
| 1092 | 1098 | struct iso_curve *icrvs = plot->iso_crvs; | |
| 1093 | 1099 | struct coordinate GPHUGE *points; | |
@@ -1122,9 +1128,9 @@ struct surface_points *plot; | |||
| 1122 | 1128 | */ | |
| 1123 | 1129 | edge3d_intersect(points, i, &clip_x, &clip_y, &clip_z); | |
| 1124 | 1130 | ||
| 1125 | - map3d_xy(clip_x, clip_y, clip_z, &x0, &y0); | ||
| 1131 | + map3d_xy(clip_x, clip_y, clip_z, &xx0, &yy0); | ||
| 1126 | 1132 | ||
| 1127 | - clip_move(x0, y0); | ||
| 1133 | + clip_move(xx0, yy0); | ||
| 1128 | 1134 | clip_vector(x, y); | |
| 1129 | 1135 | } | |
| 1130 | 1136 | } else { | |
@@ -1145,9 +1151,9 @@ struct surface_points *plot; | |||
| 1145 | 1151 | ||
| 1146 | 1152 | edge3d_intersect(points, i, &clip_x, &clip_y, &clip_z); | |
| 1147 | 1153 | ||
| 1148 | - map3d_xy(clip_x, clip_y, clip_z, &x0, &y0); | ||
| 1154 | + map3d_xy(clip_x, clip_y, clip_z, &xx0, &yy0); | ||
| 1149 | 1155 | ||
| 1150 | - clip_vector(x0, y0); | ||
| 1156 | + clip_vector(xx0, yy0); | ||
| 1151 | 1157 | } | |
| 1152 | 1158 | } else if (prev == OUTRANGE) { | |
| 1153 | 1159 | /* from outrange to outrange */ | |
@@ -1160,10 +1166,10 @@ struct surface_points *plot; | |||
| 1160 | 1166 | ||
| 1161 | 1167 | map3d_xy(lx[0], ly[0], lz[0], &x, &y); | |
| 1162 | 1168 | ||
| 1163 | - map3d_xy(lx[1], ly[1], lz[1], &x0, &y0); | ||
| 1169 | + map3d_xy(lx[1], ly[1], lz[1], &xx0, &yy0); | ||
| 1164 | 1170 | ||
| 1165 | 1171 | clip_move(x, y); | |
| 1166 | - clip_vector(x0, y0); | ||
| 1172 | + clip_vector(xx0, yy0); | ||
| 1167 | 1173 | } | |
| 1168 | 1174 | } | |
| 1169 | 1175 | } | |
@@ -1247,17 +1253,17 @@ cntr3d_impulses(cntr, plot) | |||
| 1247 | 1253 | struct gnuplot_contours *cntr; | |
| 1248 | 1254 | struct surface_points *plot; | |
| 1249 | 1255 | { | |
| 1250 | - int i; /* point index */ | ||
| 1251 | - unsigned int x, y, x0, y0; /* point in terminal coordinates */ | ||
| 1256 | + int i; /* point index */ | ||
| 1257 | + unsigned int x, y, xx0, yy0; /* point in terminal coordinates */ | ||
| 1252 | 1258 | ||
| 1253 | 1259 | if (draw_contour & CONTOUR_SRF) { | |
| 1254 | 1260 | for (i = 0; i < cntr->num_pts; i++) { | |
| 1255 | 1261 | map3d_xy(cntr->coords[i].x, cntr->coords[i].y, cntr->coords[i].z, | |
| 1256 | 1262 | &x, &y); | |
| 1257 | 1263 | map3d_xy(cntr->coords[i].x, cntr->coords[i].y, base_z, | |
| 1258 | - &x0, &y0); | ||
| 1264 | + &xx0, &yy0); | ||
| 1259 | 1265 | ||
| 1260 | - clip_move(x0, y0); | ||
| 1266 | + clip_move(xx0, yy0); | ||
| 1261 | 1267 | clip_vector(x, y); | |
| 1262 | 1268 | } | |
| 1263 | 1269 | } else { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments