void ShadingModel::reload() { ++current_revision; if (file_name_ != "") { TextFile file(file_name_); if (file.is_valid()) { construct_from_file(file); } else { Logger::LOG_WARNING << "Failed to load shading model \"" << file_name_ << "\": " "File does not exist!" << std::endl; } } }
int main (int argc, char **argv) { // If bad input, bail if (argc != 4) return 1; int num_verts = num_nodes (argv[1]); int **weights = malloc (num_verts * sizeof (int *)); int i; // Don't need to zero, as construct_f_f will write over every entry for (i = 0; i < num_verts; i++) weights[i] = malloc (num_verts * sizeof (int)); struct node **graph = init_cache (num_verts); construct_from_file (weights, graph, argv[1]); struct path *shortest = find_shortest (weights, graph, num_verts, atoi(argv[2]), atoi(argv[3])); print_path (shortest); return 0; }