Lines Matching refs:fptr
49 void FscanfOrDie(FILE* fptr, const char* format, T* value) {
50 int num_scanned = fscanf(fptr, format, value);
72 FILE* fptr = fopen(filename.c_str(), "r");
74 if (fptr == NULL) {
80 FscanfOrDie(fptr, "%d", &num_cameras_);
81 FscanfOrDie(fptr, "%d", &num_points_);
82 FscanfOrDie(fptr, "%d", &num_observations_);
96 FscanfOrDie(fptr, "%d", camera_index_ + i);
97 FscanfOrDie(fptr, "%d", point_index_ + i);
99 FscanfOrDie(fptr, "%lf", observations_ + 2*i + j);
104 FscanfOrDie(fptr, "%lf", parameters_ + i);
107 fclose(fptr);
137 FILE* fptr = fopen(filename.c_str(), "w");
139 if (fptr == NULL) {
144 fprintf(fptr, "%d %d %d\n", num_cameras_, num_points_, num_observations_);
147 fprintf(fptr, "%d %d", camera_index_[i], point_index_[i]);
149 fprintf(fptr, " %g", observations_[2 * i + j]);
151 fprintf(fptr, "\n");
164 fprintf(fptr, "%.16g\n", angleaxis[j]);
172 fprintf(fptr, "%.16g\n", point[j]);
176 fclose(fptr);