Much code can be clarified by using C++ STL-like algorithms. Not
all uses of these algorithms are listed below, only the ones where
the change to an algorithm was the only change of interest.
* frequencies.q: Remove a lot of old #if'd out code at the end.
(internal_cmd_frequencies) Use calc() instead of calc_no_weight()
or calc_weight(). Initialize percentile_values.
(calc) New function based on calc_weight() from frequencies.g.
(precalc) Use hash functions.
(static var comparison_func) Removed.
(static var comparison_param) Removed.
(comparison_helper) Removed.
(get_freq_comparator) New function.
(not_missing) New function.
(add_freq) Removed.
(postprocess_freq_tab) Use hash table functions, algorithms,
get_freq_comparator(). Rewrite.
(cleanup_freq_tab) Rephrase.
(add_percentile) Clean up spacing.
(hash_value_numeric) New function.
(hash_value_alpha) New function.
(compare_value_numeric_a) Rewrite.
(compare_value_alpha_a) Rewrite.
(compare_value_numeric_d) Rewrite.
(compare_value_alpha_d) Rewrite.
(compare_freq_numeric_a) Rewrite.
(compare_freq_alpha_a) Rewrite.
(compare_freq_numeric_d) Rewrite.
(compare_freq_alpha_d) Rewrite.
(calc_stats) Clean up mode, percentiles, max.
(dump_statistics) Clean up spacing.
* frequencies.g: Removed.
* var.h: (struct freq_tab) Change `data' to hash table.
Fri Dec 19 14:15:46 2003 Ben Pfaff <blp@gnu.org>
* file-handle.h: Remove declaration of global variable `files',
which wasn't used anywhere.
* sfm-read.c: [linux] (bswap_int32) Drop ntohl() non-portable
version.
* temporary.c: [0] (display_tree) Removed.
Fri Dec 19 14:13:04 2003 Ben Pfaff <blp@gnu.org>
Implement a new random number generator based on the alleged RC4
algorithm.
* expr-evl.c: (expr_evaluate) Use rng_get_double_normal() instead
of rand_normal().
* random.c: [!HAVE_GOOD_RANDOM] (real_rand) Removed.
[!HAVE_GOOD_RANDOM] (real_srand) Removed.
(macro k) Removed.
(static var V[]) Removed.
(static var Y) Removed.
(static var X2) Removed.
(setup_randomize) Removed.
(shuffle) Removed.
(rand_uniform) Removed.
(rand_normal) Removed.
(struct rng) New structure.
(rng_create) New function.
(rng_destroy) New function.
(swap_byte) New static function.
(rng_seed) New function.
(rng_get_bytes) New function.
(rng_get_int) New function.
(rng_get_unsigned) New function.
(rng_get_double) New function.
(rng_get_double_normal) New function.
(pspp_rng) New function.
* random.h: Sync up to random.c.
* sample.c: (struct sample_trns) Make `frac' unsigned and a
fraction of UINT_MAX, not 65536.
(cmd_sample) Use rng_get_unsigned(), rng_get_double(), UINT_MAX
fraction.
* vfm.c: (open_active_file) No need to call setup_randomize() any
longer.
Fri Dec 19 12:05:56 2003 Ben Pfaff <blp@gnu.org>
Change dictionary name indexes to use hash tables instead of AVL
trees.
* crosstabs.q: (free_var_dict) Use hash tables.
(crs_custom_tables) Ditto.
(calc_general) Ditto.
(compare_table_entry) Rewrite.
(enum_var_values) Reorder parameters. All references updated.
Rewrite.
* get.c: (rename_variable) Use hash tables.
(mtf_merge_dictionary) Ditto.
* glob.c: (init_glob) Use hash tables.
(cmp_variable) Removed.
* means.q: (mns_custom_tables) Use hash tables.
* modify-vars.c: (rearrange_dict) Use hash tables.
* rename-vars.c: (cmd_rename_variables) Use hash tables.
* sfm-read.c: (read_header) Use hash tables.
(read_variables) Ditto.
* temporary.c: (new_dictionary) Use hash tables.
(save_dictionary) Ditto.
(restore_dictionary) Ditto.
* var.h: (struct dictionary) Change AVL tree `var_by_name' into
hash table `name_tab'.