/usr/share/gtk-doc/html/libgwyddion/libgwyddion-Math.html is in libgwyddion20-doc 2.44-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Math: Gwyddion Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Gwyddion Library Reference Manual">
<link rel="up" href="index.html" title="Gwyddion Library Reference Manual">
<link rel="prev" href="libgwyddion-gwyentities.html" title="gwyentities">
<link rel="next" href="libgwyddion-Math-Fallback.html" title="Math Fallback">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#libgwyddion-Math.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="libgwyddion-gwyentities.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libgwyddion-Math-Fallback.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libgwyddion-Math"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgwyddion-Math.top_of_page"></a>Math</span></h2>
<p>Math — Mathematical utility functions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libgwyddion-Math.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#ROUND:CAPS" title="ROUND()">ROUND</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#GWY-ROUND:CAPS" title="GWY_ROUND()">GWY_ROUND</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-humanize-numbers" title="gwy_math_humanize_numbers ()">gwy_math_humanize_numbers</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-is-in-polygon" title="gwy_math_is_in_polygon ()">gwy_math_is_in_polygon</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-find-nearest-line" title="gwy_math_find_nearest_line ()">gwy_math_find_nearest_line</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-find-nearest-point" title="gwy_math_find_nearest_point ()">gwy_math_find_nearest_point</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-lin-solve" title="gwy_math_lin_solve ()">gwy_math_lin_solve</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-lin-solve-rewrite" title="gwy_math_lin_solve_rewrite ()">gwy_math_lin_solve_rewrite</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-tridiag-solve-rewrite" title="gwy_math_tridiag_solve_rewrite ()">gwy_math_tridiag_solve_rewrite</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-fit-polynom" title="gwy_math_fit_polynom ()">gwy_math_fit_polynom</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-choleski-decompose" title="gwy_math_choleski_decompose ()">gwy_math_choleski_decompose</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-choleski-solve" title="gwy_math_choleski_solve ()">gwy_math_choleski_solve</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-curvature" title="gwy_math_curvature ()">gwy_math_curvature</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-refine-maximum" title="gwy_math_refine_maximum ()">gwy_math_refine_maximum</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-median" title="gwy_math_median ()">gwy_math_median</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-sort" title="gwy_math_sort ()">gwy_math_sort</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-math-median-uncertainty" title="gwy_math_median_uncertainty ()">gwy_math_median_uncertainty</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
</td>
<td class="function_name">
<a class="link" href="libgwyddion-Math.html#gwy-xlnx-int" title="gwy_xlnx_int ()">gwy_xlnx_int</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgwyddion-Math.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libgwyddion-Math.html#GWY-SQRT3:CAPS" title="GWY_SQRT3">GWY_SQRT3</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libgwyddion-Math.html#GWY-SQRT-PI:CAPS" title="GWY_SQRT_PI">GWY_SQRT_PI</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgwyddion-Math.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <libgwyddion/gwyddion.h>
</pre>
</div>
<div class="refsect1">
<a name="libgwyddion-Math.description"></a><h2>Description</h2>
<p>Functions <code class="function">gwy_math_SI_prefix()</code> and <a class="link" href="libgwyddion-Math.html#gwy-math-humanize-numbers" title="gwy_math_humanize_numbers ()"><code class="function">gwy_math_humanize_numbers()</code></a> deal with
number representation.</p>
<p>Nearest object finding functions <a class="link" href="libgwyddion-Math.html#gwy-math-find-nearest-line" title="gwy_math_find_nearest_line ()"><code class="function">gwy_math_find_nearest_line()</code></a> and
<a class="link" href="libgwyddion-Math.html#gwy-math-find-nearest-point" title="gwy_math_find_nearest_point ()"><code class="function">gwy_math_find_nearest_point()</code></a> can be useful in widget and vector layer
implementation.</p>
<p>And <a class="link" href="libgwyddion-Math.html#gwy-math-lin-solve" title="gwy_math_lin_solve ()"><code class="function">gwy_math_lin_solve()</code></a>, <a class="link" href="libgwyddion-Math.html#gwy-math-lin-solve-rewrite" title="gwy_math_lin_solve_rewrite ()"><code class="function">gwy_math_lin_solve_rewrite()</code></a>, and
<a class="link" href="libgwyddion-Math.html#gwy-math-fit-polynom" title="gwy_math_fit_polynom ()"><code class="function">gwy_math_fit_polynom()</code></a> are general purpose numeric methods.</p>
</div>
<div class="refsect1">
<a name="libgwyddion-Math.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="ROUND:CAPS"></a><h3>ROUND()</h3>
<pre class="programlisting">#define ROUND(x) ((gint)floor((x) + 0.5))
</pre>
<div class="warning"><p><code class="literal">ROUND</code> is deprecated and should not be used in newly-written code.</p></div>
<p>Rounds a number to nearest integer. Use <a class="link" href="libgwyddion-Math.html#GWY-ROUND:CAPS" title="GWY_ROUND()"><code class="literal">GWY_ROUND</code></a> instead.</p>
<div class="refsect3">
<a name="id-1.9.7.2.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>A double value.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GWY-ROUND:CAPS"></a><h3>GWY_ROUND()</h3>
<pre class="programlisting">#define GWY_ROUND(x) ((gint)floor((x) + 0.5))
</pre>
<p>Rounds a number to nearest integer.</p>
<div class="refsect3">
<a name="id-1.9.7.3.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>A double value.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-5.html#api-index-2.5">2.5</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-humanize-numbers"></a><h3>gwy_math_humanize_numbers ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
gwy_math_humanize_numbers (<em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> unit</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> maximum</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *precision</code></em>);</pre>
<p>Finds a human-friendly representation for a range of numbers.</p>
<div class="refsect3">
<a name="id-1.9.7.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>unit</p></td>
<td class="parameter_description"><p>The smallest possible step.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>maximum</p></td>
<td class="parameter_description"><p>The maximum possible value.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>precision</p></td>
<td class="parameter_description"><p>A location to store <code class="function">printf()</code> precession, if not <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.4.6"></a><h4>Returns</h4>
<p> The magnitude i.e., a power of 1000.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-is-in-polygon"></a><h3>gwy_math_is_in_polygon ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gwy_math_is_in_polygon (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> x</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> y</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *poly</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n</code></em>);</pre>
<p>Establishes wether the test point <em class="parameter"><code>x</code></em>
, <em class="parameter"><code>y</code></em>
is inside the polygon <em class="parameter"><code>poly</code></em>
.
The polygon can be defined either clockwise or anti-clockwise and
can be a concave, convex or self-intersecting polygon.</p>
<div class="warning"> Result can be either TRUE or FALSE if the test point
is *exactly* on an edge. </div>
<div class="refsect3">
<a name="id-1.9.7.5.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>The x coordinate of the test point.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>The y coordinate of the test point.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>poly</p></td>
<td class="parameter_description"><p>An array of coordinate pairs (points) that define a
polygon.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>The number of corners of the polygon.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.5.7"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the test point is inside poly and <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-7.html#api-index-2.7">2.7</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-find-nearest-line"></a><h3>gwy_math_find_nearest_line ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gwy_math_find_nearest_line (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> x</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> y</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *d2min</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *coords</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *metric</code></em>);</pre>
<p>Finds the line from <em class="parameter"><code>coords</code></em>
nearest to the point (<em class="parameter"><code>x</code></em>
, <em class="parameter"><code>y</code></em>
).</p>
<div class="refsect3">
<a name="id-1.9.7.6.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>X-coordinate of the point to search.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>Y-coordinate of the point to search.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>d2min</p></td>
<td class="parameter_description"><p>Where to store the squared minimal distance, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>The number of lines (i.e. <em class="parameter"><code>coords</code></em>
has 4<em class="parameter"><code>n</code></em>
items).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>coords</p></td>
<td class="parameter_description"><p>Line coordinates stored as x00, y00, x01, y01, x10, y10, etc.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>metric</p></td>
<td class="parameter_description"><p>Metric matrix (2x2, but stored sequentially by rows: m11, m12,
m21, m22), it must be positive definite. Vector norm is then
calculated as m11*x*x + (m12 + m21)*x*y + m22*y*y.
It can be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, standard Euclidean metric is then used.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.6.6"></a><h4>Returns</h4>
<p> The line number. It may return -1 if (<em class="parameter"><code>x</code></em>
, <em class="parameter"><code>y</code></em>
) doesn't lie
in the orthogonal stripe of any of the lines.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-find-nearest-point"></a><h3>gwy_math_find_nearest_point ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gwy_math_find_nearest_point (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> x</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> y</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *d2min</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *coords</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *metric</code></em>);</pre>
<p>Finds the point from <em class="parameter"><code>coords</code></em>
nearest to the point (<em class="parameter"><code>x</code></em>
, <em class="parameter"><code>y</code></em>
).</p>
<div class="refsect3">
<a name="id-1.9.7.7.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>X-coordinate of the point to search.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>Y-coordinate of the point to search.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>d2min</p></td>
<td class="parameter_description"><p>Location to store the squared minimal distance to, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>The number of points (i.e. <em class="parameter"><code>coords</code></em>
has 2<em class="parameter"><code>n</code></em>
items).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>coords</p></td>
<td class="parameter_description"><p>Point coordinates stored as x0, y0, x1, y1, x2, y2, etc.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>metric</p></td>
<td class="parameter_description"><p>Metric matrix (2x2, but stored sequentially by rows: m11, m12,
m21, m22). Vector norm is then calculated as
m11*x*x + (m12 + m21)*x*y + m22*y*y.
It can be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, standard Euclidean metric is then used.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.7.6"></a><h4>Returns</h4>
<p> The point number.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-lin-solve"></a><h3>gwy_math_lin_solve ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> *
gwy_math_lin_solve (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *matrix</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *rhs</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *result</code></em>);</pre>
<p>Solve a regular system of linear equations.</p>
<div class="refsect3">
<a name="id-1.9.7.8.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>The size of the system.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>matrix</p></td>
<td class="parameter_description"><p>The matrix of the system (<em class="parameter"><code>n</code></em>
times <em class="parameter"><code>n</code></em>
), ordered by row, then
column.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rhs</p></td>
<td class="parameter_description"><p>The right hand side of the sytem.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>result</p></td>
<td class="parameter_description"><p>Where the result should be stored. May be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to allocate
a fresh array for the result.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.8.6"></a><h4>Returns</h4>
<p> The solution (<em class="parameter"><code>result</code></em>
if it wasn't <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>), may be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the
matrix is singular.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-lin-solve-rewrite"></a><h3>gwy_math_lin_solve_rewrite ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> *
gwy_math_lin_solve_rewrite (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *matrix</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *rhs</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *result</code></em>);</pre>
<p>Solves a regular system of linear equations.</p>
<p>This is a memory-conservative version of <a class="link" href="libgwyddion-Math.html#gwy-math-lin-solve" title="gwy_math_lin_solve ()"><code class="function">gwy_math_lin_solve()</code></a> overwriting
<em class="parameter"><code>matrix</code></em>
and <em class="parameter"><code>rhs</code></em>
with intermediate results.</p>
<div class="refsect3">
<a name="id-1.9.7.9.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>The size of the system.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>matrix</p></td>
<td class="parameter_description"><p>The matrix of the system (<em class="parameter"><code>n</code></em>
times <em class="parameter"><code>n</code></em>
), ordered by row, then
column.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rhs</p></td>
<td class="parameter_description"><p>The right hand side of the sytem.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>result</p></td>
<td class="parameter_description"><p>Where the result should be stored. May be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to allocate
a fresh array for the result.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.9.7"></a><h4>Returns</h4>
<p> The solution (<em class="parameter"><code>result</code></em>
if it wasn't <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>), may be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the
matrix is singular.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-tridiag-solve-rewrite"></a><h3>gwy_math_tridiag_solve_rewrite ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gwy_math_tridiag_solve_rewrite (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *d</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *a</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *b</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *rhs</code></em>);</pre>
<p>Solves a tridiagonal system of linear equations.</p>
<div class="refsect3">
<a name="id-1.9.7.10.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>The dimension of <em class="parameter"><code>d</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>d</p></td>
<td class="parameter_description"><p>The diagonal of a tridiagonal matrix, its contents will be overwritten.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>a</p></td>
<td class="parameter_description"><p>The above-diagonal stripe (it has <em class="parameter"><code>n</code></em>
-1 elements).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>b</p></td>
<td class="parameter_description"><p>The below-diagonal stripe (it has <em class="parameter"><code>n</code></em>
-1 elements).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rhs</p></td>
<td class="parameter_description"><p>The right hand side of the system, upon return it will contain the
solution.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.10.6"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the elimination suceeded, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the system is
(numerically) singular. The contents of <em class="parameter"><code>d</code></em>
and <em class="parameter"><code>rhs</code></em>
may be
overwritten in the case of failure too, but not to any meaningful
values.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-fit-polynom"></a><h3>gwy_math_fit_polynom ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> *
gwy_math_fit_polynom (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> ndata</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *xdata</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *ydata</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *coeffs</code></em>);</pre>
<p>Fits a polynom through a general (x, y) data set.</p>
<div class="refsect3">
<a name="id-1.9.7.11.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>ndata</p></td>
<td class="parameter_description"><p>The number of items in <em class="parameter"><code>xdata</code></em>
, <em class="parameter"><code>ydata</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>xdata</p></td>
<td class="parameter_description"><p>Independent variable data (of size <em class="parameter"><code>ndata</code></em>
).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>ydata</p></td>
<td class="parameter_description"><p>Dependent variable data (of size <em class="parameter"><code>ndata</code></em>
).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>The degree of polynom to fit.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>coeffs</p></td>
<td class="parameter_description"><p>An array of size <em class="parameter"><code>n</code></em>
+1 to store the coefficients to, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
(a fresh array is allocated then).</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.11.6"></a><h4>Returns</h4>
<p> The coefficients of the polynom (<em class="parameter"><code>coeffs</code></em>
when it was not <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
otherwise a newly allocated array).</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-choleski-decompose"></a><h3>gwy_math_choleski_decompose ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gwy_math_choleski_decompose (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *matrix</code></em>);</pre>
<p>Decomposes a symmetric positive definite matrix in place.</p>
<div class="refsect3">
<a name="id-1.9.7.12.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>The dimension of <em class="parameter"><code>a</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>matrix</p></td>
<td class="parameter_description"><p>Lower triangular part of a symmetric matrix, stored by rows, i.e.,
matrix = [a_00 a_10 a_11 a_20 a_21 a_22 a_30 ...].</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.12.6"></a><h4>Returns</h4>
<p> Whether the matrix was really positive definite. If <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>,
the decomposition failed and <em class="parameter"><code>a</code></em>
does not contain any meaningful
values.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-choleski-solve"></a><h3>gwy_math_choleski_solve ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gwy_math_choleski_solve (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *decomp</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *rhs</code></em>);</pre>
<p>Solves a system of linear equations with predecomposed symmetric positive
definite matrix <em class="parameter"><code>a</code></em>
and right hand side <em class="parameter"><code>b</code></em>
.</p>
<div class="refsect3">
<a name="id-1.9.7.13.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>The dimension of <em class="parameter"><code>a</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>decomp</p></td>
<td class="parameter_description"><p>Lower triangular part of Choleski decomposition as computed
by <a class="link" href="libgwyddion-Math.html#gwy-math-choleski-decompose" title="gwy_math_choleski_decompose ()"><code class="function">gwy_math_choleski_decompose()</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rhs</p></td>
<td class="parameter_description"><p>Right hand side vector. Is is modified in place, on return it
contains the solution.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-curvature"></a><h3>gwy_math_curvature ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
gwy_math_curvature (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *coeffs</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *kappa1</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *kappa2</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *phi1</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *phi2</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *xc</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *yc</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *zc</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-refine-maximum"></a><h3>gwy_math_refine_maximum ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gwy_math_refine_maximum (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *z</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *x</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *y</code></em>);</pre>
<p>Performs subpixel refinement of parabolic a two-dimensional maximum.</p>
<p>The central value corresponds to coordinates (0,0), distances between values
are unity. The refinement is based by fitting a two-dimensional parabola
through the maximum. If it fails or the calculated maximum lies farther
than the surrounding values the function sets the refined maximum to the
origin and returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<div class="refsect3">
<a name="id-1.9.7.15.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>z</p></td>
<td class="parameter_description"><p>Array of length 9, containing the square 3x3 neighbourhood values in
matrix order and with the maximum in the centre.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>Location to store the refined <em class="parameter"><code>x</code></em>
-coordinate.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>Location to store the refined <em class="parameter"><code>y</code></em>
-coordinate.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.15.7"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the refinement succeeded, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if it failed. The values
of <em class="parameter"><code>x</code></em>
and <em class="parameter"><code>y</code></em>
are usable regardless of the return value.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-42.html#api-index-2.42">2.42</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-median"></a><h3>gwy_math_median ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
gwy_math_median (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> n</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *array</code></em>);</pre>
<p>Finds median of an array of values using Quick select algorithm.</p>
<div class="refsect3">
<a name="id-1.9.7.16.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>Number of items in <em class="parameter"><code>array</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>array</p></td>
<td class="parameter_description"><p>Array of doubles. It is modified by this function. All values are
kept, but their positions in the array change.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.16.6"></a><h4>Returns</h4>
<p> The median value of <em class="parameter"><code>array</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-sort"></a><h3>gwy_math_sort ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gwy_math_sort (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> n</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *array</code></em>);</pre>
<p>Sorts an array of doubles using a quicksort algorithm.</p>
<p>This is usually about twice as fast as the generic quicksort function
thanks to specialization for doubles.</p>
<div class="refsect3">
<a name="id-1.9.7.17.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>Number of items in <em class="parameter"><code>array</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>array</p></td>
<td class="parameter_description"><p>Array of doubles to sort in place.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-math-median-uncertainty"></a><h3>gwy_math_median_uncertainty ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
gwy_math_median_uncertainty (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> n</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *array</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> *uarray</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gwy-xlnx-int"></a><h3>gwy_xlnx_int ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
gwy_xlnx_int (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> x</code></em>);</pre>
<p>Calculates natural logarithm multiplied by the argument for integers.</p>
<p>The value for zero <em class="parameter"><code>x</code></em>
is taken as the limit, i.e. zero.</p>
<p>This function is useful for entropy calculations where values of <em class="parameter"><code>n</code></em>
*log(<em class="parameter"><code>n</code></em>
)
can be evaulated a lot for small <em class="parameter"><code>n</code></em>
. Therefore, values for small arguments
are tabulated. For large arguments the function is evaluated using the
standard <code class="function">log()</code> function which is of course slower.</p>
<div class="refsect3">
<a name="id-1.9.7.19.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>Value to calculate <em class="parameter"><code>x</code></em>
*log(<em class="parameter"><code>x</code></em>
) of.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.9.7.19.8"></a><h4>Returns</h4>
<p> Value of <em class="parameter"><code>x</code></em>
*log(<em class="parameter"><code>x</code></em>
).</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-44.html#api-index-2.44">2.44</a></p>
</div>
</div>
<div class="refsect1">
<a name="libgwyddion-Math.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GWY-SQRT3:CAPS"></a><h3>GWY_SQRT3</h3>
<pre class="programlisting">#define GWY_SQRT3 1.73205080756887729352744634150587236694280525381038
</pre>
<p>The square root of 3.</p>
</div>
<hr>
<div class="refsect2">
<a name="GWY-SQRT-PI:CAPS"></a><h3>GWY_SQRT_PI</h3>
<pre class="programlisting">#define GWY_SQRT_PI 1.77245385090551602729816748334114518279754945612237
</pre>
<p>The square root of pi.</p>
</div>
</div>
<div class="refsect1">
<a name="libgwyddion-Math.see-also"></a><h2>See Also</h2>
<p><a class="link" href="libgwyddion-GwyNLFitter.html#GwyNLFitter" title="struct GwyNLFitter"><span class="type">GwyNLFitter</span></a>, non-linear least square fitter;</p>
Math Fallback,
<p> fallback mathematical functions</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.19</div>
</body>
</html>
|