https://mizugadro.mydns.jp/t/index.php?title=GSL&feed=atom&action=historyGSL - Revision history2024-03-29T00:13:19ZRevision history for this page on the wikiMediaWiki 1.31.16https://mizugadro.mydns.jp/t/index.php?title=GSL&diff=28381&oldid=prevT: Text replacement - "\$([^\$]+)\$" to "\\(\1\\)"2019-07-30T09:47:15Z<p>Text replacement - "\$([^\$]+)\$" to "\\(\1\\)"</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 09:47, 30 July 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 67:</td>
<td colspan="2" class="diff-lineno">Line 67:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>gsl_complex gsl_complex_inverse(gsl_complex z) <br> This function returns the inverse, or reciprocal, of the complex number z, </div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>gsl_complex gsl_complex_inverse(gsl_complex z) <br> This function returns the inverse, or reciprocal, of the complex number z, </div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">$</del>1/z=(x−iy)/(x^2+y^2)<del class="diffchange diffchange-inline">$</del>.</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">\(</ins>1/z=(x−iy)/(x^2+y^2)<ins class="diffchange diffchange-inline">\)</ins>.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>gsl_complex gsl_complex_negative(gsl_complex z) <br>This function returns the negative of the complex number z, −z = (−x) + i(−y).</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>gsl_complex gsl_complex_negative(gsl_complex z) <br>This function returns the negative of the complex number z, −z = (−x) + i(−y).</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 73:</td>
<td colspan="2" class="diff-lineno">Line 73:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>and so on. The commonly accepted notations +,-,*,/</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>and so on. The commonly accepted notations +,-,*,/</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>for the variables inthe internal GSL complex format are not supported at all.</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>for the variables inthe internal GSL complex format are not supported at all.</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>For example, for two [[gsl_complex]] variables <del class="diffchange diffchange-inline">$</del>a<del class="diffchange diffchange-inline">$</del> and <del class="diffchange diffchange-inline">$</del>b<del class="diffchange diffchange-inline">$</del>,</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>For example, for two [[gsl_complex]] variables <ins class="diffchange diffchange-inline">\(</ins>a<ins class="diffchange diffchange-inline">\)</ins> and <ins class="diffchange diffchange-inline">\(</ins>b<ins class="diffchange diffchange-inline">\)</ins>,</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>instead of a+b, in the gsl representation one should write gsl_complex_add(a,b)</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>instead of a+b, in the gsl representation one should write gsl_complex_add(a,b)</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>that implies 7 times more characters per operation. In comparison to case of use of [[complex double]] variables, for the comfortable work with GLS libraries in the GSL notations, the size of the monitor should be, roughly, twice larger, and the amount of misprints in the program raises, roughly, 7 times, and the time for the catching raises, roughly, 49 times, as the time to catch each single misprint also raises 7 times. The implementation, that can be programmed in the conventional notations within 1 year, in the GSL notations may require a half-century and, probably, becomes out of date before the debugging is finished.</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>that implies 7 times more characters per operation. In comparison to case of use of [[complex double]] variables, for the comfortable work with GLS libraries in the GSL notations, the size of the monitor should be, roughly, twice larger, and the amount of misprints in the program raises, roughly, 7 times, and the time for the catching raises, roughly, 49 times, as the time to catch each single misprint also raises 7 times. The implementation, that can be programmed in the conventional notations within 1 year, in the GSL notations may require a half-century and, probably, becomes out of date before the debugging is finished.</div></td>
</tr>
</table>Thttps://mizugadro.mydns.jp/t/index.php?title=GSL&diff=14530&oldid=prevMaintenance script at 22:00, 30 November 20182018-11-30T22:00:47Z<p></p>
<p><b>New page</b></p><div>[[GSL]] may refer to the GNU Scientific Library.<br />
<br />
<br />
==Obtaining==<br />
<br />
The GSL software can be loaded using the [[Port software]]. It seems to load the GSL from<br />
http://www.gnu.org/software/gsl/manual/gsl-ref.html<br />
<br />
By default, the "port" loads the files, required for GLS, to some directories according to its own idea abut prudence and convenience. It requires certain time and skills to find the GSL support among the system directories and to guess the correct way to compile codes with the GSL routines.<br />
The following commands to compile a code with the GSL library are suggested in the manual <ref><br />
http://home.uchicago.edu/~skrainka/pdfs/GSLBasics.pdf<br />
Benjamin S. Skrainka. Introduction to GNU Scientific Library.<br />
March 4, 2011.<br />
</ref>:<br />
<br />
gcc -Wall -pedantic -c -I/usr/local/include gslApp.c<br />
<br />
gcc gslApp.o -o gslApp -L/usr/local/lib -lgsl -lgslcblas.a -lm<br />
<br />
Certain skills are required to guess, which words in the commands above should be modified in order to make executable module from the code with the GSL routines.<br />
<br />
==Representation of the complex numbers in GSL==<br />
<br />
Each GSL routine, that deals with complex numbers, require<br />
either the complete rewriting, or, at least, the arranging of some specific shell for calling, because the internal GSL representation of the complex number is very complex. Instead of to write the arighmetic expression "as is", in the in the form, accepted for integer, folod, double, etc, the internal GSL format impllies writing of the call of the specific routine. Instead of infix oprations +,-,*,/, the name of the corresponding procedre should be specified.<br />
<br />
Complex arithmetic operators are implemented in the following way <br />
<ref><br />
http://www.physics.helsinki.fi/courses/s/tl3/progs/gsl/gsl-ref-1.5.pdf<br />
Mark Galassi,<br />
Jim Davies,<br />
James Theiler,<br />
Brian Gough,<br />
Gerard Jungman,<br />
Michael Booth,<br />
Fabrice Rossi.<br />
GNU Scientific Library. Reference Manual Edition 1.5, for GSL Version 1.5 24 June 2004.<br />
</ref>:<br />
<br />
gsl_complex gsl_complex_add(gsl_complex a, gsl_complex b) <br />
<br>This function returns the sum of the complex numbers a and b, z=a+b.<br />
<br />
gsl_complex gsl_complex_sub(gsl_complex a, gsl_complex b) <br> This function returns the difference of the complex numbers a and b, z=a−b.<br />
<br />
gsl_complex gsl_complex_gsl_complex_mul(gsl_complex a, gsl_complex b) <br> This function returns the product of the complex numbers a and b, z = ab.<br />
<br />
gsl_complex gsl_complex_div(gsl_complex a, gsl_complex b) <br>This function returns the quotient of the complex numbers a and b, z=a/b.<br />
<br />
gsl_complex gsl_complex_add_real(gsl_complex a, double x) <br> This function returns the sum of the complex number a and the real number x, z=a+x.<br />
<br />
gsl_complex gsl_complex_sub_real(gsl_complex a, double x) <br> This function returns the difference of the complex number a and the real number x, z=a-x.<br />
<br />
gsl_complex gsl_complex gsl complex_mul_real (gsl_complex a, double x) <br> This function returns the product of the complex number a and the real number x, z=ax.<br />
<br />
<br />
gsl_complex gsl_complex_div_real(gsl_complex a, double x) <br> This function returns the quotient of the complex number a and the real number x, z = a/x.<br />
<br />
gsl_complex gsl_complex_add_imag(gsl_complex a, double y) <br> This function returns the sum of the complex number a and the imaginary number iy, z = a + iy.<br />
<br />
gsl_complex gsl_complex_sub_imag(gsl_complex a, double y) <br> This function returns the difference of the complex number a and the imaginary number iy, z = a − iy.<br />
<br />
gsl_complex gsl_complex_mul_imag(gsl_complex a, double y) <br> This function returns the product of the complex number a and the imaginary number iy, z = a ∗ (iy).<br />
<br />
gsl_complex gsl_complex_gsl_complex_div_imag (gsl_complex a, double y)<br> This function returns the quotient of the complex number a and the imaginary number iy, z=a/(iy).<br />
<br />
gsl_complex gsl_complex_conjugate(gsl_complex z) <br> This function returns the complex conjugate of the complex number z, z∗=x−iy.<br />
<br />
gsl_complex gsl_complex_inverse(gsl_complex z) <br> This function returns the inverse, or reciprocal, of the complex number z, <br />
$1/z=(x−iy)/(x^2+y^2)$.<br />
<br />
gsl_complex gsl_complex_negative(gsl_complex z) <br>This function returns the negative of the complex number z, −z = (−x) + i(−y).<br />
<br />
and so on. The commonly accepted notations +,-,*,/<br />
for the variables inthe internal GSL complex format are not supported at all.<br />
For example, for two [[gsl_complex]] variables $a$ and $b$,<br />
instead of a+b, in the gsl representation one should write gsl_complex_add(a,b)<br />
that implies 7 times more characters per operation. In comparison to case of use of [[complex double]] variables, for the comfortable work with GLS libraries in the GSL notations, the size of the monitor should be, roughly, twice larger, and the amount of misprints in the program raises, roughly, 7 times, and the time for the catching raises, roughly, 49 times, as the time to catch each single misprint also raises 7 times. The implementation, that can be programmed in the conventional notations within 1 year, in the GSL notations may require a half-century and, probably, becomes out of date before the debugging is finished.<br />
<br />
For the reason above, the use of the GSL routines "as is" is not recommended at all.<br />
If the numeric implementation of some function id required, and it is not yet loaded to [[TORI]], <br />
then, in principle, the GLS orutine can be useful, but it should be either rewritten to the common notations (to allow +,-,*,/ for addition, subtraction, multiplication and division), or wrapped with a function that uses the conventional notations (+,-,*,/).<br />
<br />
==References==<br />
<references/><br />
http://www.gnu.org/software/gsl/manual/gsl-ref.html<br />
<br />
<br />
==Keywords==<br />
[[C++]],<br />
[[Category:GNU]]<br />
[[programing]]<br />
<br />
<br />
[[Category:GSL]]<br />
[[Category:GNU]]<br />
[[Category:C++]]<br />
[[Category:Local]]</div>Maintenance script