Aging_MouthReplace / dlibs /docs /algorithms.html
AshanGimhana's picture
Upload folder using huggingface_hub
9375c9a verified
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html xmlns:gcse="googleCustomSearch"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="shortcut icon" href="dlib-icon.ico"><meta name="verify-v1" content="02MiiaFNVzS5/u0eQhsy3/knioFHsia1X3DXRpHkE6I="><meta name="google-site-verification" content="DGSSJMKDomaDaDTIRJ8jDkv0YMx9Cz7OESbXHjjr6Jw"><title>dlib C++ Library
- Algorithms</title><script type="text/javascript" src="dlib.js"></script><link rel="stylesheet" type="text/css" href="dlib.css"></head><body><a name="top"></a><div id="page_header"><a href="http://dlib.net"><img src="dlib-logo.png"></a></div><div id="top_content"><div id="main_menu" class="menu"><div class="menu_top"><b>The Library</b><ul class="tree"><li><a href="algorithms.html" class="menu">Algorithms</a></li><li><a href="api.html" class="menu">API Wrappers</a></li><li><a href="bayes.html" class="menu">Bayesian Nets</a></li><li><a href="compression.html" class="menu">Compression</a></li><li><a href="containers.html" class="menu">Containers</a></li><li><a href="graph_tools.html" class="menu">Graph Tools</a></li><li><a href="imaging.html" class="menu">Image Processing</a></li><li><a href="linear_algebra.html" class="menu">Linear Algebra</a></li><li><a href="ml.html" class="menu">Machine Learning</a></li><li><a href="metaprogramming.html" class="menu">Metaprogramming</a></li><li><a href="other.html" class="menu">Miscellaneous</a></li><li><a href="network.html" class="menu">Networking</a></li><li><a href="optimization.html" class="menu">Optimization</a></li><li><a href="parsing.html" class="menu">Parsing</a></li></ul><br><b>Help/Info</b><ul class="tree"><li><a href="http://blog.dlib.net" class="menu">Dlib Blog</a></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">Examples: C++</a><ul style="display:none;"><li><a href="3d_point_cloud_ex.cpp.html" class="menu">3D Point Cloud</a></li><li><a href="assignment_learning_ex.cpp.html" class="menu">Assignment Learning</a></li><li><a href="file_to_code_ex.cpp.html" class="menu">Base64 Encoder</a></li><li><a href="bayes_net_from_disk_ex.cpp.html" class="menu">Bayesian Network From Disk</a></li><li><a href="bayes_net_gui_ex.cpp.html" class="menu">Bayesian Network GUI</a></li><li><a href="bayes_net_ex.cpp.html" class="menu">Bayesian Network</a></li><li><a href="bridge_ex.cpp.html" class="menu">Bridge</a></li><li><a href="bsp_ex.cpp.html" class="menu">BSP</a></li><li><a href="svm_c_ex.cpp.html" class="menu">C-Support Vector Machine</a></li><li><a href="compress_stream_ex.cpp.html#_top" class="menu">Cmd Line Parser</a></li><li><a href="compress_stream_ex.cpp.html" class="menu">Compress Stream</a></li><li><a href="config_reader_ex.cpp.html" class="menu">Config File Reader</a></li><li><a href="custom_trainer_ex.cpp.html" class="menu">Custom Trainers</a></li><li><a href="dnn_face_recognition_ex.cpp.html" class="menu">Deep Face Recognition</a></li><li><a href="dnn_dcgan_train_ex.cpp.html" class="menu">Deep Learning DCGAN</a></li><li><a href="dnn_mmod_dog_hipsterizer.cpp.html" class="menu">Deep Learning Dog Hipsterizer</a></li><li><a href="dnn_mmod_face_detection_ex.cpp.html" class="menu">Deep Learning Face Detection</a></li><li><a href="dnn_imagenet_ex.cpp.html" class="menu">Deep Learning Imagenet Classifier</a></li><li><a href="dnn_imagenet_train_ex.cpp.html" class="menu">Deep Learning Imagenet Trainer </a></li><li><a href="dnn_inception_ex.cpp.html" class="menu">Deep Learning Inception</a></li><li><a href="dnn_instance_segmentation_train_ex.cpp.html" class="menu">Deep Learning Instance Segmentation Trainer</a></li><li><a href="dnn_instance_segmentation_ex.cpp.html" class="menu">Deep Learning Instance Segmentation</a></li><li><a href="dnn_introduction_ex.cpp.html" class="menu">Deep Learning Introduction Part 1</a></li><li><a href="dnn_introduction2_ex.cpp.html" class="menu">Deep Learning Introduction Part 2</a></li><li><a href="dnn_introduction3_ex.cpp.html" class="menu">Deep Learning Introduction Part 3</a></li><li><a href="dnn_mmod_ex.cpp.html" class="menu">Deep Learning Max-Margin Object Detection</a></li><li><a href="dnn_mmod_find_cars2_ex.cpp.html" class="menu">Deep Learning Multi-Class Vehicle Detection</a></li><li><a href="dnn_semantic_segmentation_train_ex.cpp.html" class="menu">Deep Learning Semantic Segmentation Trainer</a></li><li><a href="dnn_semantic_segmentation_ex.cpp.html" class="menu">Deep Learning Semantic Segmentation</a></li><li><a href="dnn_mmod_train_find_cars_ex.cpp.html" class="menu">Deep Learning Vehicle Detection Trainer</a></li><li><a href="dnn_mmod_find_cars_ex.cpp.html" class="menu">Deep Learning Vehicle Detection</a></li><li><a href="dnn_metric_learning_ex.cpp.html" class="menu">Deep Metric Learning Introduction</a></li><li><a href="dnn_metric_learning_on_images_ex.cpp.html" class="menu">Deep Metric Learning on Images</a></li><li><a href="dir_nav_ex.cpp.html" class="menu">Directory Navigation</a></li><li><a href="empirical_kernel_map_ex.cpp.html" class="menu">Empirical Kernel Map</a></li><li><a href="face_detection_ex.cpp.html" class="menu">Face Detection</a></li><li><a href="face_landmark_detection_ex.cpp.html" class="menu">Face Landmark Detection</a></li><li><a href="fhog_ex.cpp.html" class="menu">FHOG Feature Extraction</a></li><li><a href="fhog_object_detector_ex.cpp.html" class="menu">FHOG Object Detection</a></li><li><a href="graph_labeling_ex.cpp.html" class="menu">Graph Labeling</a></li><li><a href="gui_api_ex.cpp.html" class="menu">GUI</a></li><li><a href="hough_transform_ex.cpp.html" class="menu">Hough Transform</a></li><li><a href="server_http_ex.cpp.html" class="menu">HTTP Server</a></li><li><a href="image_ex.cpp.html" class="menu">Image</a></li><li><a href="iosockstream_ex.cpp.html" class="menu">IO Socket Streams</a></li><li><a href="server_iostream_ex.cpp.html" class="menu">IO Streams Server</a></li><li><a href="kcentroid_ex.cpp.html" class="menu">Kernel Centroid</a></li><li><a href="kkmeans_ex.cpp.html" class="menu">Kernel K-Means Clustering</a></li><li><a href="krr_regression_ex.cpp.html" class="menu">Kernel Ridge Regression</a></li><li><a href="krls_filter_ex.cpp.html" class="menu">Kernel RLS Filtering</a></li><li><a href="krls_ex.cpp.html" class="menu">Kernel RLS Regression</a></li><li><a href="krr_classification_ex.cpp.html" class="menu">KRR Classification</a></li><li><a href="learning_to_track_ex.cpp.html" class="menu">Learning to Track</a></li><li><a href="max_cost_assignment_ex.cpp.html" class="menu">Linear Assignment Problems</a></li><li><a href="linear_manifold_regularizer_ex.cpp.html" class="menu">Linear Manifold Regularizer</a></li><li><a href="mpc_ex.cpp.html" class="menu">Linear Model Predictive Control</a></li><li><a href="logger_ex_2.cpp.html" class="menu">Logger Advanced</a></li><li><a href="logger_custom_output_ex.cpp.html" class="menu">Logger Custom Output</a></li><li><a href="logger_ex.cpp.html" class="menu">Logger</a></li><li><a href="matrix_expressions_ex.cpp.html" class="menu">Matrix Expressions</a></li><li><a href="matrix_ex.cpp.html" class="menu">Matrix</a></li><li><a href="member_function_pointer_ex.cpp.html" class="menu">Member Function Pointer</a></li><li><a href="model_selection_ex.cpp.html" class="menu">Model Selection</a></li><li><a href="multiclass_classification_ex.cpp.html" class="menu">Multiclass Classification</a></li><li><a href="multithreaded_object_ex.cpp.html" class="menu">Multithreaded Object</a></li><li><a href="mlp_ex.cpp.html" class="menu">Neural Network</a></li><li><a href="least_squares_ex.cpp.html" class="menu">Non-Linear Least Squares</a></li><li><a href="svm_ex.cpp.html" class="menu">Nu-Support Vector Machine</a></li><li><a href="integrate_function_adapt_simp_ex.cpp.html" class="menu">Numerical Integration</a></li><li><a href="object_detector_advanced_ex.cpp.html" class="menu">Object Detector Advanced</a></li><li><a href="object_detector_ex.cpp.html" class="menu">Object Detector</a></li><li><a href="one_class_classifiers_ex.cpp.html" class="menu">One Class Classifiers</a></li><li><a href="svm_pegasos_ex.cpp.html" class="menu">Online SVM</a></li><li><a href="optimization_ex.cpp.html" class="menu">Optimization</a></li><li><a href="parallel_for_ex.cpp.html" class="menu">Parallel For Loops</a></li><li><a href="pipe_ex_2.cpp.html" class="menu">Pipe 2</a></li><li><a href="pipe_ex.cpp.html" class="menu">Pipe</a></li><li><a href="quantum_computing_ex.cpp.html" class="menu">Quantum Computing</a></li><li><a href="queue_ex.cpp.html" class="menu">Queue</a></li><li><a href="random_cropper_ex.cpp.html" class="menu">Random Cropper</a></li><li><a href="rank_features_ex.cpp.html" class="menu">Rank Features</a></li><li><a href="rvm_ex.cpp.html" class="menu">Relevance Vector Classification</a></li><li><a href="rvm_regression_ex.cpp.html" class="menu">Relevance Vector Regression</a></li><li><a href="running_stats_ex.cpp.html" class="menu">Running Stats</a></li><li><a href="sequence_labeler_ex.cpp.html" class="menu">Sequence Labeling</a></li><li><a href="sequence_segmenter_ex.cpp.html" class="menu">Sequence Segmentation</a></li><li><a href="sockets_ex.cpp.html" class="menu">Sockets</a></li><li><a href="sockstreambuf_ex.cpp.html" class="menu">Sockstreambuf</a></li><li><a href="svm_sparse_ex.cpp.html" class="menu">Sparse Vectors</a></li><li><a href="sqlite_ex.cpp.html" class="menu">SQLite</a></li><li><a href="std_allocator_ex.cpp.html" class="menu">Std C++ Allocator</a></li><li><a href="svm_struct_ex.cpp.html" class="menu">Structural Support Vector Machines</a></li><li><a href="svr_ex.cpp.html" class="menu">Support Vector Regression</a></li><li><a href="surf_ex.cpp.html" class="menu">SURF</a></li><li><a href="svm_rank_ex.cpp.html" class="menu">SVM-Rank</a></li><li><a href="thread_function_ex.cpp.html" class="menu">Thread Function</a></li><li><a href="thread_pool_ex.cpp.html" class="menu">Thread Pool</a></li><li><a href="threaded_object_ex.cpp.html" class="menu">Threaded Object</a></li><li><a href="threads_ex.cpp.html" class="menu">Threads</a></li><li><a href="timer_ex.cpp.html" class="menu">Timer</a></li><li><a href="train_object_detector.cpp.html" class="menu">Train Object Detector</a></li><li><a href="train_shape_predictor_ex.cpp.html" class="menu">Train Shape Predictor</a></li><li><a href="using_custom_kernels_ex.cpp.html" class="menu">Using Custom Kernels</a></li><li><a href="video_tracking_ex.cpp.html" class="menu">Video Object Tracking</a></li><li><a href="webcam_face_pose_ex.cpp.html" class="menu">Webcam Face Pose Estimation</a></li><li><a href="xml_parser_ex.cpp.html" class="menu">XML Parser</a></li></ul></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">Examples: Python</a><ul style="display:none;"><li><a href="svm_binary_classifier.py.html" class="menu">Binary Classification</a></li><li><a href="cnn_face_detector.py.html" class="menu">CNN Face Detector</a></li><li><a href="face_alignment.py.html" class="menu">Face Alignment</a></li><li><a href="face_clustering.py.html" class="menu">Face Clustering</a></li><li><a href="face_detector.py.html" class="menu">Face Detector</a></li><li><a href="face_jitter.py.html" class="menu">Face Jittering/Augmentation</a></li><li><a href="face_landmark_detection.py.html" class="menu">Face Landmark Detection</a></li><li><a href="face_recognition.py.html" class="menu">Face Recognition</a></li><li><a href="find_candidate_object_locations.py.html" class="menu">Find Candidate Object Locations</a></li><li><a href="global_optimization.py.html" class="menu">Global Optimization</a></li><li><a href="max_cost_assignment.py.html" class="menu">Linear Assignment Problems</a></li><li><a href="sequence_segmenter.py.html" class="menu">Sequence Segmenter</a></li><li><a href="svm_struct.py.html" class="menu">Structural Support Vector Machines</a></li><li><a href="svm_rank.py.html" class="menu">SVM-Rank</a></li><li><a href="train_object_detector.py.html" class="menu">Train Object Detector</a></li><li><a href="train_shape_predictor.py.html" class="menu">Train Shape Predictor</a></li><li><a href="correlation_tracker.py.html" class="menu">Video Object Tracking</a></li></ul></li><li><a href="faq.html" class="menu">FAQ</a></li><li><a href="index.html" class="menu">Home</a></li><li><a href="compile.html" class="menu">How to compile</a></li><li><a href="howto_contribute.html" class="menu">How to contribute</a></li><li><a href="term_index.html" class="menu">Index</a></li><li><a href="intro.html" class="menu">Introduction</a></li><li><a href="license.html" class="menu">License</a></li><li><a href="python/index.html" class="menu">Python API</a></li><li><a href="books.html" class="menu">Suggested Books</a></li><li><a href="http://sourceforge.net/p/dclib/wiki/Known_users/" class="menu">Who uses dlib?</a></li></ul><br><b>Current Release</b><ul class="tree"><li><a href="change_log.html" class="menu">Change Log</a></li><li><a href="release_notes.html" class="menu">Release Notes</a></li><li>Version: 19.22</li></ul><br></div><div class="menu_footer">
Last Modified:<br>Mar 28, 2021</div></div><div id="main_text"><div id="main_text_title">Algorithms</div><div id="main_text_body"><p>
This page documents library components that are all basically just implementations of
mathematical functions or algorithms that don't fit in any of the other pages
of the dlib documentation. So this includes things like checksums, cryptographic hashes,
sorting, etc.
</p></div></div><div id="right_menu" class="menu"><div class="menu_top"><b>Tools</b><ul class="tree"><li><a href="#bigint" class="menu">bigint</a></li><li><a href="#disjoint_subsets" class="menu">disjoint_subsets</a></li><li><a href="#disjoint_subsets_sized" class="menu">disjoint_subsets_sized</a></li><li><a href="#hsort_array" class="menu">hsort_array</a></li><li><a href="#integrate_function_adapt_simp" class="menu">integrate_function_adapt_simp</a></li><li><a href="#isort_array" class="menu">isort_array</a></li><li><a href="#numeric_constants" class="menu">numeric_constants</a></li><li><a href="#put_in_range" class="menu">put_in_range</a></li><li><a href="#qsort_array" class="menu">qsort_array</a></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">Quantum Computing</a><ul style="display:none;"><li><a href="#gate" class="menu">gate</a></li><li><a href="#quantum_register" class="menu">quantum_register</a></li></ul></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">Set Utilities</a><ul style="display:none;"><li><a href="#set_difference" class="menu">set_difference</a></li><li><a href="#set_intersection" class="menu">set_intersection</a></li><li><a href="#set_intersection_size" class="menu">set_intersection_size</a></li><li><a href="#set_union" class="menu">set_union</a></li></ul></li><li><a href="#split_array" class="menu">split_array</a></li><li><a href="#square_root" class="menu">square_root</a></li></ul><br><b>Statistics</b><ul class="tree"><li><a href="#binomial_random_vars_are_different" class="menu">binomial_random_vars_are_different</a></li><li><a href="#correlation" class="menu">correlation</a></li><li><a href="#count_steps_without_decrease" class="menu">count_steps_without_decrease</a></li><li><a href="#count_steps_without_decrease_robust" class="menu">count_steps_without_decrease_robust</a></li><li><a href="#count_steps_without_increase" class="menu">count_steps_without_increase</a></li><li><a href="#covariance" class="menu">covariance</a></li><li><a href="#event_correlation" class="menu">event_correlation</a></li><li><a href="#find_upper_quantile" class="menu">find_upper_quantile</a></li><li><a href="#max_scoring_element" class="menu">max_scoring_element</a></li><li><a href="#mean_sign_agreement" class="menu">mean_sign_agreement</a></li><li><a href="#mean_squared_error" class="menu">mean_squared_error</a></li><li><a href="#median" class="menu">median</a></li><li><a href="#min_scoring_element" class="menu">min_scoring_element</a></li><li><a href="#probability_values_are_increasing" class="menu">probability_values_are_increasing</a></li><li><a href="#probability_values_are_increasing_robust" class="menu">probability_values_are_increasing_robust</a></li><li><a href="#rand" class="menu">rand</a></li><li><a href="#randomly_subsample" class="menu">randomly_subsample</a></li><li><a href="#random_subset_selector" class="menu">random_subset_selector</a></li><li><a href="#running_covariance" class="menu">running_covariance</a></li><li><a href="#running_cross_covariance" class="menu">running_cross_covariance</a></li><li><a href="#running_gradient" class="menu">running_gradient</a></li><li><a href="#running_scalar_covariance" class="menu">running_scalar_covariance</a></li><li><a href="#running_scalar_covariance_decayed" class="menu">running_scalar_covariance_decayed</a></li><li><a href="#running_stats" class="menu">running_stats</a></li><li><a href="#running_stats_decayed" class="menu">running_stats_decayed</a></li><li><a href="#r_squared" class="menu">r_squared</a></li></ul><br><b>Hashing</b><ul class="tree"><li><a href="#count_bits" class="menu">count_bits</a></li><li><a href="#crc32" class="menu">crc32</a></li><li><a href="#create_max_margin_projection_hash" class="menu">create_max_margin_projection_hash</a></li><li><a href="#create_random_projection_hash" class="menu">create_random_projection_hash</a></li><li><a href="#gaussian_random_hash" class="menu">gaussian_random_hash</a></li><li><a href="#hamming_distance" class="menu">hamming_distance</a></li><li><a href="#hash" class="menu">hash</a></li><li><a href="#hash_samples" class="menu">hash_samples</a></li><li><a href="#hash_similar_angles_128" class="menu">hash_similar_angles_128</a></li><li><a href="#hash_similar_angles_256" class="menu">hash_similar_angles_256</a></li><li><a href="#hash_similar_angles_512" class="menu">hash_similar_angles_512</a></li><li><a href="#hash_similar_angles_64" class="menu">hash_similar_angles_64</a></li><li><a href="#md5" class="menu">md5</a></li><li><a href="#murmur_hash3" class="menu">murmur_hash3</a></li><li><a href="#murmur_hash3_128bit" class="menu">murmur_hash3_128bit</a></li><li><a href="#projection_hash" class="menu">projection_hash</a></li><li><a href="#uniform_random_hash" class="menu">uniform_random_hash</a></li></ul><br><b>Filtering</b><ul class="tree"><li><a href="#find_optimal_momentum_filter" class="menu">find_optimal_momentum_filter</a></li><li><a href="#find_optimal_rect_filter" class="menu">find_optimal_rect_filter</a></li><li><a href="#kalman_filter" class="menu">kalman_filter</a></li><li><a href="#momentum_filter" class="menu">momentum_filter</a></li><li><a href="#rect_filter" class="menu">rect_filter</a></li><li><a href="#rls_filter" class="menu">rls_filter</a></li></ul><br></div><div class="menu_footer"></div></div></div><div id="bottom_content"><a name="bigint"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">bigint</h1><BR><BR>
This object represents an arbitrary precision unsigned integer. It's pretty simple.
It's interface is just like a normal int, you don't have to tell it how much memory
to use or anything unusual. It just goes :)
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/bigint/bigint_kernel_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/bigint.h&gt;</div></div><BR><BR><B>Implementations:</B><blockquote><a href="dlib/bigint/bigint_kernel_1.h.html">bigint_kernel_1</a>:
<br>
This implementation is done using an array of unsigned shorts. It is also reference counted.
For further details see the above link. Also note that kernel_2 should be
faster in almost every case so you should really just use that version of the bigint object.
<div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_1a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for bigint_kernel_1</td></tr><tr><td valign="top"><div class="tdn">kernel_1a_c</div></td><td width="100%">
is a typedef for kernel_1a that checks its preconditions.
</td></tr></table></div></blockquote><blockquote><a href="dlib/bigint/bigint_kernel_2.h.html">bigint_kernel_2</a>:
<br>
This implementation is basically the same as kernel_1 except it uses the
Fast Fourier Transform to perform multiplications much faster.
<div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for bigint_kernel_2</td></tr><tr><td valign="top"><div class="tdn">kernel_2a_c</div></td><td width="100%">
is a typedef for kernel_2a that checks its preconditions.
</td></tr></table></div></blockquote></div><a name="binomial_random_vars_are_different"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">binomial_random_vars_are_different</h1><BR><BR>
This function performs a simple statistical test to check if two binomially
distributed random variables have the same parameter (i.e. the chance of
"success"). It uses the simple likelihood ratio test discussed in
the following paper:
<blockquote>
Dunning, Ted. "Accurate methods for the statistics of surprise and
coincidence." Computational linguistics 19.1 (1993): 61-74.
</blockquote>
So for an extended discussion of the method see the above paper.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#binomial_random_vars_are_different">More Details...</a><div class="include_file">#include &lt;dlib/statistics/statistic.h&gt;</div></div></div><a name="correlation"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">correlation</h1><BR><BR>
This is a function for computing the correlation between
matching elements of two std::vectors.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#correlation">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="count_bits"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">count_bits</h1><BR><BR>
This function counts the number of bits in an unsigned integer which are
set to 1.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/general_hash/count_bits_abstract.h.html#count_bits">More Details...</a><div class="include_file">#include &lt;dlib/hash.h&gt;</div></div></div><a name="count_steps_without_decrease"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">count_steps_without_decrease</h1><BR><BR>
Given a potentially noisy time series, this function returns a count of how
long the time series has gone without noticeably decreasing in value. It does
this by adding the elements of the time series into a <a href="#running_gradient">running_gradient</a> object and counting how many
elements, starting with the most recent, you need to examine before you
are confident that the series has been decreasing in value.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/running_gradient_abstract.h.html#count_steps_without_decrease">More Details...</a><div class="include_file">#include &lt;dlib/statistics/running_gradient.h&gt;</div></div></div><a name="count_steps_without_decrease_robust"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">count_steps_without_decrease_robust</h1><BR><BR>
This function behaves just like <a href="#count_steps_without_decrease">count_steps_without_decrease</a> except
that it ignores times series values that are anomalously large. This makes it
robust to sudden noisy but transient spikes in the time series values.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/running_gradient_abstract.h.html#count_steps_without_decrease_robust">More Details...</a><div class="include_file">#include &lt;dlib/statistics/running_gradient.h&gt;</div></div></div><a name="count_steps_without_increase"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">count_steps_without_increase</h1><BR><BR>
Given a potentially noisy time series, this function returns a count of how
long the time series has gone without noticeably increasing in value. It does
this by adding the elements of the time series into a <a href="#running_gradient">running_gradient</a> object and counting how many
elements, starting with the most recent, you need to examine before you
are confident that the series has been increasing in value.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/running_gradient_abstract.h.html#count_steps_without_increase">More Details...</a><div class="include_file">#include &lt;dlib/statistics/running_gradient.h&gt;</div></div></div><a name="covariance"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">covariance</h1><BR><BR>
This is a function for computing the covariance between
matching elements of two std::vectors.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#covariance">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="crc32"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">crc32</h1><BR><BR>
This object represents the CRC-32 algorithm for calculating checksums.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/crc32/crc32_kernel_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/crc32.h&gt;</div></div></div><a name="create_max_margin_projection_hash"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">create_max_margin_projection_hash</h1><BR><BR>
Creates a random projection based locality sensitive
<a href="#projection_hash">hashing function</a>.
This is accomplished using a variation on the random hyperplane generation
technique from the paper:
<blockquote>
Random Maximum Margin Hashing by Alexis Joly and Olivier Buisson
</blockquote>
In particular, we use a linear support vector machine to generate planes.
We train it on randomly selected and randomly labeled points from
the data to be hashed.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/lsh/create_random_projection_hash_abstract.h.html#create_max_margin_projection_hash">More Details...</a><div class="include_file">#include &lt;dlib/lsh.h&gt;</div></div></div><a name="create_random_projection_hash"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">create_random_projection_hash</h1><BR><BR>
Creates a random projection based locality sensitive
<a href="#projection_hash">hashing function</a>. The projection matrix
is generated by sampling its elements from a Gaussian random number generator.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/lsh/create_random_projection_hash_abstract.h.html#create_random_projection_hash">More Details...</a><div class="include_file">#include &lt;dlib/lsh.h&gt;</div></div></div><a name="disjoint_subsets"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">disjoint_subsets</h1><BR><BR>
This object represents a set of integers which is partitioned into
a number of disjoint subsets. It supports the two fundamental operations
of finding which subset a particular integer belongs to as well as
merging subsets.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/disjoint_subsets/disjoint_subsets_abstract.h.html#disjoint_subsets">More Details...</a><div class="include_file">#include &lt;dlib/disjoint_subsets.h&gt;</div></div></div><a name="disjoint_subsets_sized"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">disjoint_subsets_sized</h1><BR><BR>
This object is just like <a href="#disjoint_subsets">disjoint_subsets</a> except that it
also keeps track of the size of each set.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/disjoint_subsets/disjoint_subsets_sized_abstract.h.html#disjoint_subsets_sized">More Details...</a><div class="include_file">#include &lt;dlib/disjoint_subsets.h&gt;</div></div></div><a name="event_correlation"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">event_correlation</h1><BR><BR>
This function does a statistical test to determine if two events co-occur in a
statistically significant way. It uses the simple likelihood ratio
test discussed in the following paper:
<blockquote>
Dunning, Ted. "Accurate methods for the statistics of surprise and
coincidence." Computational linguistics 19.1 (1993): 61-74.
</blockquote>
So for an extended discussion of the method see the above paper.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#event_correlation">More Details...</a><div class="include_file">#include &lt;dlib/statistics/statistic.h&gt;</div></div></div><a name="find_optimal_momentum_filter"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">find_optimal_momentum_filter</h1><BR><BR>
This function finds the "optimal" settings of a <a href="#momentum_filter">momentum_filter</a>
based on unfiltered measurement data.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/filtering/kalman_filter_abstract.h.html#find_optimal_momentum_filter">More Details...</a><div class="include_file">#include &lt;dlib/filtering.h&gt;</div></div></div><a name="find_optimal_rect_filter"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">find_optimal_rect_filter</h1><BR><BR>
This function finds the "optimal" settings of a <a href="#rect_filter">rect_filter</a>
based on unfiltered measurement data.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/filtering/kalman_filter_abstract.h.html#find_optimal_rect_filter">More Details...</a><div class="include_file">#include &lt;dlib/filtering.h&gt;</div></div></div><a name="find_upper_quantile"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">find_upper_quantile</h1><BR><BR>
Finds and returns the scalar value such that a user specified percentage of
the values in a container are greater than said value. For example, 0.5
would find the median value in a container while 0.1 would find the value
that lower bounded the 10% largest values in a container.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/running_gradient_abstract.h.html#find_upper_quantile">More Details...</a><div class="include_file">#include &lt;dlib/statistics/running_gradient.h&gt;</div></div></div><a name="gate"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">gate</h1><BR><BR>
This object represents a quantum gate that operates on a
<a href="#quantum_register">quantum_register</a>.
<BR><BR>C++ Example Programs: <a href="quantum_computing_ex.cpp.html">quantum_computing_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/quantum_computing/quantum_computing_abstract.h.html#gate">More Details...</a><div class="include_file">#include &lt;dlib/quantum_computing.h&gt;</div></div></div><a name="gaussian_random_hash"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">gaussian_random_hash</h1><BR><BR>
This function uses hashing to generate Gaussian distributed random values
with mean 0 and variance 1.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/general_hash/random_hashing_abstract.h.html#gaussian_random_hash">More Details...</a><div class="include_file">#include &lt;dlib/hash.h&gt;</div></div></div><a name="hamming_distance"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">hamming_distance</h1><BR><BR>
This function returns the hamming distance between two unsigned integers.
That is, it returns the number of bits which differer in the two integers.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/general_hash/count_bits_abstract.h.html#hamming_distance">More Details...</a><div class="include_file">#include &lt;dlib/hash.h&gt;</div></div></div><a name="hash"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">hash</h1><BR><BR>
This is a set of convenience functions for invoking <a href="#murmur_hash3">murmur_hash3</a>
on std::strings, std::vectors, std::maps, or <a href="linear_algebra.html#matrix">dlib::matrix</a> objects.
<p>
As an aside, the hash() for matrix objects is defined <a href="dlib/matrix/matrix_utilities_abstract.h.html#hash">here</a>.
It has the same interface as all the others.
</p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/general_hash/hash_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/hash.h&gt;</div></div></div><a name="hash_samples"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">hash_samples</h1><BR><BR>
This is a simple function for hashing a bunch of vectors using a
locality sensitive hashing object such as <a href="#hash_similar_angles_128">hash_similar_angles_128</a>.
It is also capable of running in parallel on a multi-core CPU.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/graph_utils/find_k_nearest_neighbors_lsh_abstract.h.html#hash_samples">More Details...</a><div class="include_file">#include &lt;dlib/graph_utils_threaded.h&gt;</div></div></div><a name="hash_similar_angles_128"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">hash_similar_angles_128</h1><BR><BR>
This object is a tool for computing locality sensitive hashes that give
vectors with small angles between each other similar hash values. In
particular, this object creates 128 random planes which pass though the
origin and uses them to create a 128bit hash.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/lsh/hashes_abstract.h.html#hash_similar_angles_128">More Details...</a><div class="include_file">#include &lt;dlib/lsh.h&gt;</div></div></div><a name="hash_similar_angles_256"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">hash_similar_angles_256</h1><BR><BR>
This object is a tool for computing locality sensitive hashes that give
vectors with small angles between each other similar hash values. In
particular, this object creates 256 random planes which pass though the
origin and uses them to create a 256bit hash.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/lsh/hashes_abstract.h.html#hash_similar_angles_256">More Details...</a><div class="include_file">#include &lt;dlib/lsh.h&gt;</div></div></div><a name="hash_similar_angles_512"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">hash_similar_angles_512</h1><BR><BR>
This object is a tool for computing locality sensitive hashes that give
vectors with small angles between each other similar hash values. In
particular, this object creates 512 random planes which pass though the
origin and uses them to create a 512bit hash.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/lsh/hashes_abstract.h.html#hash_similar_angles_512">More Details...</a><div class="include_file">#include &lt;dlib/lsh.h&gt;</div></div></div><a name="hash_similar_angles_64"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">hash_similar_angles_64</h1><BR><BR>
This object is a tool for computing locality sensitive hashes that give
vectors with small angles between each other similar hash values. In
particular, this object creates 64 random planes which pass though the
origin and uses them to create a 64bit hash.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/lsh/hashes_abstract.h.html#hash_similar_angles_64">More Details...</a><div class="include_file">#include &lt;dlib/lsh.h&gt;</div></div></div><a name="hsort_array"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">hsort_array</h1><BR><BR>
hsort_array is an implementation of the heapsort algorithm. It will sort anything that has an
array like operator[] interface.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/sort.h.html#hsort_array">More Details...</a><div class="include_file">#include &lt;dlib/sort.h&gt;</div></div></div><a name="integrate_function_adapt_simp"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">integrate_function_adapt_simp</h1><BR><BR>
Computes an approximation of the integral of a real valued function using the
adaptive Simpson method outlined in
<blockquote>
Gander, W. and W. Gautshi, "Adaptive
Quadrature -- Revisited" BIT, Vol. 40, (2000), pp.84-101
</blockquote><BR><BR>C++ Example Programs: <a href="integrate_function_adapt_simp_ex.cpp.html">integrate_function_adapt_simp_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/numerical_integration/integrate_function_adapt_simpson_abstract.h.html#integrate_function_adapt_simp">More Details...</a><div class="include_file">#include &lt;dlib/numerical_integration.h&gt;</div></div></div><a name="isort_array"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">isort_array</h1><BR><BR>
isort_array is an implementation of the insertion sort algorithm. It will sort anything that has an
array like operator[] interface.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/sort.h.html#isort_array">More Details...</a><div class="include_file">#include &lt;dlib/sort.h&gt;</div></div></div><a name="kalman_filter"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">kalman_filter</h1><BR><BR>
This object implements the Kalman filter, which is a tool for
recursively estimating the state of a process given measurements
related to that process. To use this tool you will have to
be familiar with the workings of the Kalman filter. An excellent
introduction can be found in the paper:
<blockquote>
An Introduction to the Kalman Filter
by Greg Welch and Gary Bishop
</blockquote><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/filtering/kalman_filter_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/filtering.h&gt;</div></div></div><a name="max_scoring_element"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">max_scoring_element</h1><BR><BR>
This function finds the element of container that has the largest score,
according to a user supplied score function, and returns a std::pair containing
that maximal element along with the score.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#max_scoring_element">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="md5"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">md5</h1><BR><BR>
This is an implementation of The MD5 Message-Digest Algorithm as described in rfc1321.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/md5/md5_kernel_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/md5.h&gt;</div></div></div><a name="mean_sign_agreement"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">mean_sign_agreement</h1><BR><BR>
This is a function for computing the probability that
matching elements of two std::vectors have the same sign.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#mean_sign_agreement">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="mean_squared_error"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">mean_squared_error</h1><BR><BR>
This is a function for computing the mean squared error between
matching elements of two std::vectors.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#mean_squared_error">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="median"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">median</h1><BR><BR>
This function takes three parameters and finds the median of the three. The median is swapped into
the first parameter and the first parameter ends up in one of the other two, unless the first parameter was
the median to begin with of course.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#median">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="min_scoring_element"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">min_scoring_element</h1><BR><BR>
This function finds the element of container that has the smallest score,
according to a user supplied score function, and returns a std::pair containing
that minimal element along with the score.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#min_scoring_element">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="momentum_filter"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">momentum_filter</h1><BR><BR>
This object is a simple tool for filtering a single scalar value that
measures the location of a moving object that has some non-trivial
momentum. Importantly, the measurements are noisy and the object can
experience sudden unpredictable accelerations. To accomplish this
filtering we use a simple <a href="#kalman_filter">Kalman filter</a> with a
state transition model of:
<pre>
position_{i+1} = position_{i} + velocity_{i}
velocity_{i+1} = velocity_{i} + some_unpredictable_acceleration
</pre>
and a measurement model of:
<pre>
measured_position_{i} = position_{i} + measurement_noise
</pre>
Where <tt>some_unpredictable_acceleration</tt> and <tt>measurement_noise</tt> are 0 mean Gaussian
noise sources.
To allow for really sudden and large but infrequent accelerations, at each
step we check if the current measured position deviates from the predicted
filtered position by more than a user specified amount,
and if so we adjust the filter's state to keep it within these bounds.
This allows the moving object to undergo large unmodeled accelerations, far
in excess of what would be suggested by the basic Kalman filter's noise model, without
then experiencing a long lag time where the Kalman filter has to "catch
up" to the new position.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/filtering/kalman_filter_abstract.h.html#momentum_filter">More Details...</a><div class="include_file">#include &lt;dlib/filtering.h&gt;</div></div></div><a name="murmur_hash3"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">murmur_hash3</h1><BR><BR>
This function takes a block of memory and returns a 32bit hash. The
hashing algorithm used is Austin Appleby's excellent
<a href="http://code.google.com/p/smhasher/">MurmurHash3</a>.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/general_hash/murmur_hash3_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/hash.h&gt;</div></div></div><a name="murmur_hash3_128bit"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">murmur_hash3_128bit</h1><BR><BR>
This function takes a block of memory and returns a 128bit hash. The
hashing algorithm used is Austin Appleby's excellent
<a href="http://code.google.com/p/smhasher/">MurmurHash3</a>.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/general_hash/murmur_hash3_abstract.h.html#murmur_hash3_128bit">More Details...</a><div class="include_file">#include &lt;dlib/hash.h&gt;</div></div></div><a name="numeric_constants"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">numeric_constants</h1><BR><BR>
This is just a header file containing definitions of common numeric constants such as pi and e.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/numeric_constants.h.html">More Details...</a><div class="include_file">#include &lt;dlib/numeric_constants.h&gt;</div></div></div><a name="probability_values_are_increasing"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">probability_values_are_increasing</h1><BR><BR>
Given a potentially noisy time series, this function returns the probability that those
values are increasing in magnitude.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/running_gradient_abstract.h.html#probability_values_are_increasing">More Details...</a><div class="include_file">#include &lt;dlib/statistics/running_gradient.h&gt;</div></div></div><a name="probability_values_are_increasing_robust"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">probability_values_are_increasing_robust</h1><BR><BR>
This function behaves just like <a href="#probability_values_are_increasing">probability_values_are_increasing</a> except
that it ignores times series values that are anomalously large. This makes it
robust to sudden noisy but transient spikes in the time series values.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/running_gradient_abstract.h.html#probability_values_are_increasing_robust">More Details...</a><div class="include_file">#include &lt;dlib/statistics/running_gradient.h&gt;</div></div></div><a name="projection_hash"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">projection_hash</h1><BR><BR>
This is a tool for hashing elements of a vector space into the integers.
It is intended to represent locality sensitive hashing functions such as
the popular <a href="#create_random_projection_hash">random projection hashing</a> method.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/lsh/projection_hash_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/lsh.h&gt;</div></div></div><a name="put_in_range"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">put_in_range</h1><BR><BR>
This is a simple function that takes a range and a value and returns the given
value if it is within the range. If it isn't in the range then it returns the
end of range value that is closest.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#put_in_range">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="qsort_array"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">qsort_array</h1><BR><BR>
qsort_array is an implementation of the QuickSort algorithm. It will sort anything that has an array like
operator[] interface. If the quick sort becomes unstable then it switches to a heap sort. This
way sorting is guaranteed to take at most N*log(N) time.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/sort.h.html#qsort_array">More Details...</a><div class="include_file">#include &lt;dlib/sort.h&gt;</div></div></div><a name="quantum_register"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">quantum_register</h1><BR><BR>
This object represents a set of quantum bits. It can be used
with the quantum <a href="#gate">gate</a> object to simulate
quantum algorithms.
<BR><BR>C++ Example Programs: <a href="quantum_computing_ex.cpp.html">quantum_computing_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/quantum_computing/quantum_computing_abstract.h.html#quantum_register">More Details...</a><div class="include_file">#include &lt;dlib/quantum_computing.h&gt;</div></div></div><a name="rand"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">rand</h1><BR><BR>
This object represents a pseudorandom number generator.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/rand/rand_kernel_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/rand.h&gt;</div></div></div><a name="randomly_subsample"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">randomly_subsample</h1><BR><BR>
This is a set of convenience functions for
creating <a href="#random_subset_selector">random subsets</a> of data.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/random_subset_selector_abstract.h.html#randomly_subsample">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="random_subset_selector"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">random_subset_selector</h1><BR><BR>
This object is a tool to help you select a random subset of a large body of data.
In particular, it is useful when the body of data is too large to fit into memory.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/random_subset_selector_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="rect_filter"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">rect_filter</h1><BR><BR>
This object is just a <a href="#momentum_filter">momentum_filter</a> applied to the
four corners of a <a href="linear_algebra.html#rectangle">rectangle</a>. It allows
you to filter a stream of rectangles, for instance, bounding boxes from an object detector
applied to a video stream.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/filtering/kalman_filter_abstract.h.html#rect_filter">More Details...</a><div class="include_file">#include &lt;dlib/filtering.h&gt;</div></div></div><a name="rls_filter"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">rls_filter</h1><BR><BR>
This object is a tool for doing time series prediction using
linear <a href="ml.html#rls">recursive least squares</a>. In particular,
this object takes a sequence of points from the user and, at each
step, attempts to predict the value of the next point.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/filtering/rls_filter_abstract.h.html">More Details...</a><div class="include_file">#include &lt;dlib/filtering.h&gt;</div></div></div><a name="running_covariance"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">running_covariance</h1><BR><BR>
This object is a simple tool for computing the mean and
covariance of a sequence of vectors.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#running_covariance">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="running_cross_covariance"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">running_cross_covariance</h1><BR><BR>
This object is a simple tool for computing the mean and
cross-covariance matrices of a sequence of pairs of vectors.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#running_cross_covariance">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="running_gradient"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">running_gradient</h1><BR><BR>
This object is a tool for estimating if a noisy sequence of numbers is
trending up or down and by how much. It does this by finding the least
squares fit of a line to the data and then allows you to perform a
statistical test on the slope of that line.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/running_gradient_abstract.h.html#running_gradient">More Details...</a><div class="include_file">#include &lt;dlib/statistics/running_gradient.h&gt;</div></div></div><a name="running_scalar_covariance"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">running_scalar_covariance</h1><BR><BR>
This object is a simple tool for computing the covariance of a
sequence of scalar values.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#running_scalar_covariance">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="running_scalar_covariance_decayed"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">running_scalar_covariance_decayed</h1><BR><BR>
This object represents something that can compute the running covariance of
a stream of real number pairs. It is essentially the same as
<a href="#running_scalar_covariance">running_scalar_covariance</a> except that it forgets about data it has seen
after a certain period of time. It does this by exponentially decaying old
statistics.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#running_scalar_covariance_decayed">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="running_stats"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">running_stats</h1><BR><BR>
This object represents something that can compute the running mean,
variance, skewness, and kurtosis statistics of a stream of real numbers.
<BR><BR>C++ Example Programs: <a href="running_stats_ex.cpp.html">running_stats_ex.cpp</a>,
<a href="kcentroid_ex.cpp.html">kcentroid_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#running_stats">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="running_stats_decayed"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">running_stats_decayed</h1><BR><BR>
This object represents something that can compute the running mean and
variance of a stream of real numbers. It is similar to <a href="#running_stats">running_stats</a>
except that it forgets about data it has seen after a certain period of
time. It does this by exponentially decaying old statistics.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#running_stats_decayed">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="r_squared"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">r_squared</h1><BR><BR>
This is a function for computing the R squared coefficient between
matching elements of two std::vectors.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/statistics/statistics_abstract.h.html#r_squared">More Details...</a><div class="include_file">#include &lt;dlib/statistics.h&gt;</div></div></div><a name="set_difference"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">set_difference</h1><BR><BR>
This function takes two <a href="containers.html#set">set</a> objects and
gives you their difference.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/set_utils/set_utils_abstract.h.html#set_difference">More Details...</a><div class="include_file">#include &lt;dlib/set_utils.h&gt;</div></div></div><a name="set_intersection"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">set_intersection</h1><BR><BR>
This function takes two <a href="containers.html#set">set</a> objects and
gives you their intersection.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/set_utils/set_utils_abstract.h.html#set_intersection">More Details...</a><div class="include_file">#include &lt;dlib/set_utils.h&gt;</div></div></div><a name="set_intersection_size"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">set_intersection_size</h1><BR><BR>
This function takes two <a href="containers.html#set">set</a> objects and tells you
how many items they have in common.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/set_utils/set_utils_abstract.h.html#set_intersection_size">More Details...</a><div class="include_file">#include &lt;dlib/set_utils.h&gt;</div></div></div><a name="set_union"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">set_union</h1><BR><BR>
This function takes two <a href="containers.html#set">set</a> objects and
gives you their union.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/set_utils/set_utils_abstract.h.html#set_union">More Details...</a><div class="include_file">#include &lt;dlib/set_utils.h&gt;</div></div></div><a name="split_array"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">split_array</h1><BR><BR>
This function is used to efficiently split <a href="containers.html#array">array</a>
like objects into two parts. It uses the global swap() function instead
of copying to move elements around, so it works on arrays of non-copyable
types.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/array/array_tools_abstract.h.html#split_array">More Details...</a><div class="include_file">#include &lt;dlib/array.h&gt;</div></div></div><a name="square_root"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">square_root</h1><BR><BR>
square_root is a function which takes an unsigned long and returns the square root of it or
if the root is not an integer then it is rounded up to the next integer.
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#square_root">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="uniform_random_hash"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">uniform_random_hash</h1><BR><BR>
This function uses hashing to generate uniform random values in the range [0,1).
<BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/general_hash/random_hashing_abstract.h.html#uniform_random_hash">More Details...</a><div class="include_file">#include &lt;dlib/hash.h&gt;</div></div></div></div></body></html>