function r8lib_test ( )

%*****************************************************************************80
%
%% r8lib_test tests r8lib.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 December 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../r8lib' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8lib_test\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test r8lib.\n' );

  c8_sqrt_r8_test ( );

  i4_log_10_test ( );
  i4_modp_test ( );
  i4_sign_test ( );
  i4_uniform_ab_test ( );

  i4int_to_r8int_test ( );

  ksub_next4_test ( );

  perm0_check_test ( );
  perm0_uniform_test ( );

  perm1_check_test ( );
  perm1_uniform_test ( );

  r8_abs_test ( );
  r8_acos_test ( );
  r8_acosh_test ( );
  r8_add_test ( );
  r8_agm_test ( );
  r8_aint_test ( );
  r8_asinh_test ( );
  r8_atan_test ( );
  r8_atanh_test ( );
  r8_big_test ( );
  r8_cas_test ( );
  r8_ceiling_test ( );
  r8_choose_test ( );
  r8_chop_test ( );
  r8_cosd_test ( );
  r8_cot_test ( );
  r8_cotd_test ( );
  r8_csc_test ( );
  r8_cscd_test ( );
  r8_cube_root_test ( );
  r8_days_to_dhms_test ( );
  r8_degrees_test ( );
  r8_dhms_to_days_test ( );
  r8_diff_test ( );
  r8_digit_test ( );
  r8_divide_i4_test ( );
  r8_e_test ( );
  r8_epsilon_test ( );
  r8_epsilon_compute_test ( );
  r8_exp_test ( );
  r8_factorial_test ( );
  r8_factorial_stirling_test ( );
  r8_factorial2_test ( );
  r8_fall_test ( );
  r8_floor_test ( );
  r8_fractional_test ( );
  r8_gamma_test ( );
  r8_gamma_log_test ( );
  r8_haversine_test ( );
  r8_huge_test ( );
  r8_hypot_test ( );
  r8_is_in_01_test ( );
  r8_is_inf_test ( );
  r8_is_insignificant_test ( );
  r8_is_integer_test ( );
  r8_is_nan_test ( );
  r8_log_2_test ( );
  r8_log_10_test ( );
  r8_log_b_test ( );
  r8_mant_test ( );
  r8_max_test ( );
  r8_min_test ( );
  r8_mod_test ( );
  r8_modp_test ( );
  r8_mop_test ( );
  r8_nint_test ( );
  r8_normal_01_test ( );
  r8_normal_ab_test ( );
  r8_nth_root_test ( );
  r8_pi_test ( );
  r8_power_test ( );
  r8_power_fast_test ( );
  r8_print_test ( );
  r8_radians_test ( );
  r8_relu_test ( );
  r8_rise_test ( );
  r8_round_test ( );
  r8_round2_test ( );
  r8_roundb_test ( );
  r8_roundx_test ( );
  r8_secd_test ( );
  r8_sech_test ( );
  r8_sigmoid_test ( );
  r8_sign_test ( );
  r8_sign_char_test ( );
  r8_sign_match_test ( );
  r8_sign_match_strict_test ( );
  r8_sign_opposite_test ( );
  r8_sign_opposite_strict_test ( );
  r8_sign3_test ( );
  r8_sincos_sum_test ( );
  r8_sind_test ( );
  r8_softplus_test ( );
  r8_sqrt_i4_test ( );
  r8_sqrt_pi_test ( );
  r8_swap_test ( );
  r8_swap3_test ( );
  r8_tand_test ( );
  r8_tiny_test ( );
  r8_to_i4_test ( );
  r8_to_r8_discrete_test ( );
  r8_uniform_01_test ( );
  r8_uniform_ab_test ( );
  r8_unswap3_test ( );
  r8_walsh_1d_test ( );
  r8_wrap_test ( );
 
  r82_print_test ( );

  r82col_print_part_test ( );

  r82row_order_type_test ( );
  r82row_part_quick_a_test ( );
  r82row_print_part_test ( );
  r82row_sort_heap_index_a_test ( );
  r82row_sort_quick_a_test ( );
  r82row_uniform_ab_test ( );

  r82vec_order_type_test ( );
  r82vec_part_quick_a_test ( );
  r82vec_permute_test ( );
  r82vec_print_test ( );
  r82vec_print_part_test ( );
  r82vec_sort_heap_index_a_test ( );
  r82vec_sort_quick_a_test ( );
  r82vec_uniform_01_test ( );
  r82vec_uniform_ab_test ( );

  r83col_print_part_test ( );

  r83row_print_part_test ( );

  r8block_expand_linear_test ( );
  r8block_print_test ( );

  r8int_to_i4int_test ( );

  r8mat_add_test ( );
  r8mat_amax_test ( );
  r8mat_border_add_test ( );
  r8mat_border_cut_test ( );
  r8mat_cholesky_factor_test ( );
  r8mat_cholesky_factor_upper_test ( );
  r8mat_cholesky_inverse_test ( );
  r8mat_cholesky_solve_test ( );
  r8mat_cholesky_solve_upper_test ( );
  r8mat_covariance_test ( );
  r8mat_det_2d_test ( );
  r8mat_det_3d_test ( );
  r8mat_det_4d_test ( );
  r8mat_det_5d_test ( );
  r8mat_diag_add_scalar_test ( );
  r8mat_diag_add_vector_test ( );
  r8mat_diag_get_vector_test ( );
  r8mat_diag_set_scalar_test ( );
  r8mat_diag_set_vector_test ( );
  r8mat_diagonal_test ( );
  r8mat_expand_linear_test ( );
  r8mat_expand_linear2_test ( );
  r8mat_flip_cols_test ( );
  r8mat_flip_rows_test ( );
  r8mat_fs_test ( );
  r8mat_fss_test ( );
  r8mat_givens_post_test ( );
  r8mat_givens_pre_test ( );
  r8mat_hess_test ( );
  r8mat_house_axh_test ( );
  r8mat_house_form_test ( );
  r8mat_house_post_test ( );
  r8mat_house_pre_test ( );
  r8mat_indicator_test ( );
  r8mat_inverse_2d_test ( );
  r8mat_inverse_3d_test ( );
  r8mat_inverse_4d_test ( );
  r8mat_is_binary_test ( );
  r8mat_jac_test ( );
  r8mat_kronecker_test ( );
  r8mat_l_inverse_test ( );
  r8mat_l_print_test ( );
  r8mat_l_solve_test ( );
  r8mat_l1_solve_test ( );
  r8mat_l1_inverse_test ( );
  r8mat_ldlt_solve_test ( );
  r8mat_lt_solve_test ( );
  r8mat_lu_test ( );
  r8mat_max_test ( );
  r8mat_max_index_test ( );
  r8mat_min_test ( );
  r8mat_min_index_test ( );
  r8mat_maxcol_minrow_test ( );
  r8mat_maxrow_mincol_test ( );
  r8mat_mean_test ( );
  r8mat_mincol_maxrow_test ( );
  r8mat_minrow_maxcol_test ( );
  r8mat_mm_test ( );
  r8mat_mmt_test ( );
  r8mat_mtm_test ( );
  r8mat_mtv_test ( );
  r8mat_mv_test ( );
  r8mat_nint_test ( );
  r8mat_nonzeros_test ( );
  r8mat_norm_eis_test ( );
  r8mat_norm_fro_test ( );
  r8mat_norm_fro_affine_test ( );
  r8mat_norm_l1_test ( );
  r8mat_norm_l2_test ( );
  r8mat_norm_li_test ( );
  r8mat_norm_rms_test ( );
  r8mat_normal_01_test ( );
  r8mat_nullspace_test ( );
  r8mat_nullspace_size_test ( );
  r8mat_orth_uniform_test ( );
  r8mat_plot_test ( );
  r8mat_power_test ( );
  r8mat_power_method_test ( );
  r8mat_print_test ( );
  r8mat_print_some_test ( );
  r8mat_product_elementwise_test ( );
  r8mat_ref_test ( );
  r8mat_rref_test ( );
  r8mat_rref_solve_binary_test ( );
  r8mat_rref_solve_binary_nz_test ( );
  r8mat_scale_01_test ( );
  r8mat_scale_ab_test ( );
  r8mat_solve_test ( );
  r8mat_solve_2d_test ( );
  r8mat_solve_3d_test ( );
  r8mat_solve2_test ( );
  r8mat_standardize_test ( );
  r8mat_sum_test ( );
  r8mat_symm_jacobi_test ( );
  r8mat_to_r8plu_test ( );
  r8mat_trace_test ( );
  r8mat_transpose_print_test ( );
  r8mat_transpose_print_some_test ( );
  r8mat_u_inverse_test ( );
  r8mat_u_solve_test ( );
  r8mat_u1_inverse_test ( );
  r8mat_uniform_01_test ( );
  r8mat_uniform_ab_test ( );
  r8mat_uniform_abvec_test ( );
  r8mat_ut_solve_test ( );
  r8mat_vand2_test ( );

  r8plu_det_test ( );
  r8plu_inverse_test ( );
  r8plu_mul_test ( );
  r8plu_sol_test ( );
  r8plu_to_r8mat_test ( );

  r8r8_print_test ( );

  r8r8vec_index_insert_unique_test ( );

  r8r8r8vec_index_insert_unique_test ( );

  r8rows_to_r8mat_test ( );

  r8slmat_print_test ( );

  r8vec_amax_test ( );
  r8vec_amax_index_test ( );
  r8vec_amin_test ( );
  r8vec_amin_index_test ( );
  r8vec_any_normal_test ( );
  r8vec_asum_test ( );
  r8vec_bin_test ( );
  r8vec_binary_next_test ( );
  r8vec_blend_test ( );
  r8vec_bracket_test ( );
  r8vec_bracket2_test ( );
  r8vec_bracket3_test ( );
  r8vec_bracket4_test ( );
  r8vec_bracket5_test ( );
  r8vec_bracket6_test ( );
  r8vec_cheby_extreme_test ( );
  r8vec_cheby_zero_test ( );
  r8vec_cheby1space_test ( );
  r8vec_cheby2space_test ( );
  r8vec_compare_test ( );
  r8vec_concatenate_test ( );
  r8vec_convolution_test ( );
  r8vec_convolution_circ_test ( );
  r8vec_copy_test ( );
  r8vec_correlation_test ( );
  r8vec_cross_product_2d_test ( );
  r8vec_cross_product_3d_test ( );
  r8vec_dif_test ( );
  r8vec_diff_norm_test ( );
  r8vec_diff_norm_l1_test ( );
  r8vec_diff_norm_l2_test ( );
  r8vec_diff_norm_li_test ( );
  r8vec_direct_product_test ( );
  r8vec_direct_product2_test ( );
  r8vec_dot_product_test ( );
  r8vec_eq_test ( );
  r8vec_even_test ( );
  r8vec_even2_test ( );
  r8vec_even3_test ( );
  r8vec_expand_linear_test ( );
  r8vec_fill_test ( );
  r8vec_frac_test ( );
  r8vec_gt_test ( );
  r8vec_heap_a_test ( );
  r8vec_heap_d_test ( );
  r8vec_histogram_test ( );
  r8vec_house_column_test ( );
  r8vec_identity_row_test ( );
  r8vec_index_delete_all_test ( );
  r8vec_index_delete_dupes_test ( );
  r8vec_index_delete_one_test ( );
  r8vec_index_insert_test ( );
  r8vec_index_insert_unique_test ( );
  r8vec_index_order_test ( );
  r8vec_index_search_test ( );
  r8vec_index_sorted_range_test ( );
  r8vec_indexed_heap_d_test ( );
  r8vec_indexed_heap_d_extract_test ( );
  r8vec_indexed_heap_d_insert_test ( );
  r8vec_indexed_heap_d_max_test ( );
  r8vec_indicator0_test ( );
  r8vec_indicator1_test ( );
  r8vec_insert_test ( );
  r8vec_is_ascending_test ( );
  r8vec_is_binary_test ( );
  r8vec_is_distinct_test ( );
  r8vec_is_integer_test ( );
  r8vec_legendre_test ( );
  r8vec_linspace_test ( );
  r8vec_linspace2_test ( );
  r8vec_lt_test ( );
  r8vec_max_test ( );
  r8vec_max_abs_index_test ( );
  r8vec_max_index_test ( );
  r8vec_mean_test ( );
  r8vec_mean_geometric_test ( );
  r8vec_mean_running_test ( );
  r8vec_mean_update_test ( );
  r8vec_median_test ( );
  r8vec_midspace_test ( );
  r8vec_min_test ( );
  r8vec_min_index_test ( );
  r8vec_min_pos_test ( );
  r8vec_mirror_next_test ( );
  r8vec_mirror_ab_next_test ( );
  r8vec_multispace_test ( );
  r8vec_nint_test ( );
  r8vec_norm_test ( );
  r8vec_norm_affine_test ( );
  r8vec_norm_l0_test ( );
  r8vec_norm_l1_test ( );
  r8vec_norm_l2_test ( );
  r8vec_norm_li_test ( );
  r8vec_norm_lp_test ( );
  r8vec_norm_rms_test ( );
  r8vec_normal_01_test ( );
  r8vec_normal_ab_test ( );
  r8vec_normalize_test ( );
  r8vec_normalize_l1_test ( );
  r8vec_normsq_test ( );
  r8vec_order_type_test ( );
  r8vec_part_quick_a_test ( );
  r8vec_permute_test ( );
  r8vec_permute_cyclic_test ( );
  r8vec_permute_uniform_test ( );
  r8vec_polarize_test ( );
  r8vec_print_test ( );
  r8vec_print_16_test ( );
  r8vec_print_mask_test ( );
  r8vec_print_part_test ( );
  r8vec_print_some_test ( );
  r8vec_product_test ( );
  r8vec_rsquared_test ( );
  r8vec_rsquared_adjusted_test ( );
  r8vec_rotate_test ( );
  r8vec_reverse_test ( );
  r8vec_scalar_triple_product_test ( );
  r8vec_scale_test ( );
  r8vec_scale_01_test ( );
  r8vec_scale_ab_test ( );
  r8vec_search_binary_a_test ( );
  r8vec_shift_test ( );
  r8vec_shift_circular_test ( );
  r8vec_sign3_running_test ( );
  r8vec_smooth_test ( );
  r8vec_softmax_test ( );
  r8vec_sort_bubble_a_test ( );
  r8vec_sort_bubble_d_test ( );
  r8vec_sort_heap_a_test ( );
  r8vec_sort_heap_d_test ( );
  r8vec_sort_heap_index_a_test ( );
  r8vec_sort_heap_index_d_test ( );
  r8vec_sort_heap_mask_a_test ( );
  r8vec_sort_insert_a_test ( );
  r8vec_sort_insert_index_a_test ( );
  r8vec_sort_insert_index_d_test ( );
  r8vec_sort_quick_a_test ( );
  r8vec_sort_shell_a_test ( );
  r8vec_sorted_merge_a_test ( );
  r8vec_sorted_nearest_test ( );
  r8vec_sorted_range_test ( );
  r8vec_sorted_split_test ( );
  r8vec_sorted_undex_test ( );
  r8vec_sorted_unique_test ( );
  r8vec_sorted_unique_count_test ( );
  r8vec_sorted_unique_hist_test ( );
  r8vec_split_test ( );
  r8vec_standardize_test ( );
  r8vec_std_test ( );
  r8vec_std_sample_test ( );
  r8vec_std_update_test ( );
  r8vec_step_test ( );
  r8vec_stutter_test ( );
  r8vec_sum_test ( );
  r8vec_sum_running_test ( );
  r8vec_swap_test ( );
  r8vec_transpose_print_test ( );
  r8vec_undex_test ( );
  r8vec_uniform_01_test ( );
  r8vec_uniform_ab_test ( );
  r8vec_uniform_abvec_test ( );
  r8vec_uniform_unit_test ( );
  r8vec_unique_count_test ( );
  r8vec_unique_index_test ( );
  r8vec_variance_test ( );
  r8vec_variance_circular_test ( );
  r8vec_variance_sample_test ( );
  r8vec_variance_update_test ( );
  r8vec_vector_triple_product_test ( );
  r8vec_write_test ( );

  r8vec2_print_test ( );
  r8vec2_print_some_test ( );
  r8vec2_sort_a_test ( );
  r8vec2_sort_d_test ( );
  r8vec2_sort_heap_index_a_test ( );
  r8vec2_sorted_unique_test ( );
  r8vec2_sorted_unique_index_test ( );
  r8vec2_sum_max_index_test ( );

  r8vec3_print_test ( );

  rms_test ( );

  sort_heap_external_test ( );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8lib_test\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../r8lib' );

  return
end
