<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.9.1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>DGtal: polynomial2-derivative.cpp File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"], jax: ["input/TeX","output/HTML-CSS"], }); </script> <script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">DGtal  <span id="projectnumber">1.4.2</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.9.1 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ var searchBox = new SearchBox("searchBox", "search",false,'Search','.html'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function(){initNavTree('polynomial2-derivative_8cpp.html',''); initResizable(); }); /* @license-end */ </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">polynomial2-derivative.cpp File Reference<div class="ingroups"><a class="el" href="group__Examples.html">DGtal Examples</a></div></div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><code>#include <iostream></code><br /> <code>#include <string></code><br /> <code>#include <sstream></code><br /> <code>#include "DGtal/math/MPolynomial.h"</code><br /> <code>#include "DGtal/io/readers/MPolynomialReader.h"</code><br /> </div><div class="textblock"><div class="dynheader"> Include dependency graph for polynomial2-derivative.cpp:</div> <div class="dyncontent"> <div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="polynomial2-derivative_8cpp__incl.svg" width="100%" height="600"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div> </div> </div> </div> <p><a href="polynomial2-derivative_8cpp_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:a20e26a0834ca2e2905ed656f963ef9f3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="polynomial2-derivative_8cpp.html#a20e26a0834ca2e2905ed656f963ef9f3">usage</a> (int, char **argv)</td></tr> <tr class="separator:a20e26a0834ca2e2905ed656f963ef9f3"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="polynomial2-derivative_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a> (int argc, char **argv)</td></tr> <tr class="separator:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><dl class="section author"><dt>Author</dt><dd>Jacques-Olivier Lachaud (<code><a href="#" onclick="location.href='mai'+'lto:'+'jac'+'qu'+'es-'+'ol'+'ivi'+'er'+'.la'+'ch'+'aud'+'@u'+'niv'+'-s'+'avo'+'ie'+'.fr'; return false;">jacqu<span style="display: none;">.nosp@m.</span>es-o<span style="display: none;">.nosp@m.</span>livie<span style="display: none;">.nosp@m.</span>r.la<span style="display: none;">.nosp@m.</span>chaud<span style="display: none;">.nosp@m.</span>@uni<span style="display: none;">.nosp@m.</span>v-sav<span style="display: none;">.nosp@m.</span>oie.<span style="display: none;">.nosp@m.</span>fr</a></code> ) Laboratory of Mathematics (CNRS, UMR 5127), University of Savoie, France</dd></dl> <dl class="section date"><dt>Date</dt><dd>2012/02/06</dd></dl> <p>An example file named polynomial2-derivative.</p> <p>This file is part of the <a class="el" href="namespaceDGtal.html" title="DGtal is the top-level namespace which contains all DGtal functions and types.">DGtal</a> library. </p> <p class="definition">Definition in file <a class="el" href="polynomial2-derivative_8cpp_source.html">polynomial2-derivative.cpp</a>.</p> </div><h2 class="groupheader">Function Documentation</h2> <a id="a3c04138a5bfe5d72780bb7e82a18e627"></a> <h2 class="memtitle"><span class="permalink"><a href="#a3c04138a5bfe5d72780bb7e82a18e627">◆ </a></span>main()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int main </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>argc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char ** </td> <td class="paramname"><em>argv</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Main. </p> <p>[polynomial2-derivative-types]</p> <p>[polynomial2-derivative-types]</p> <p>[polynomial2-derivative-process]</p> <p>[polynomial2-derivative-process]</p> <p class="definition">Definition at line <a class="el" href="polynomial2-derivative_8cpp_source.html#l00057">57</a> of file <a class="el" href="polynomial2-derivative_8cpp_source.html">polynomial2-derivative.cpp</a>.</p> <div class="fragment"><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> {</div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">if</span> ( argc < 2 )</div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  {</div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="polynomial2-derivative_8cpp.html#a20e26a0834ca2e2905ed656f963ef9f3">usage</a>( argc, argv );</div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordflow">return</span> 1;</div> <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  }</div> <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  </div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keyword">typedef</span> <span class="keywordtype">double</span> Ring;</div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keyword">typedef</span> <a class="code" href="classDGtal_1_1MPolynomial.html">MPolynomial<2, Ring></a> MyPolynomial;</div> <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  </div> <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  std::string polynomialString( argv[ 1 ] );</div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  std::istringstream polynomialIStream( polynomialString );</div> <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  MyPolynomial P;</div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  polynomialIStream >> P;</div> <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  MyPolynomial P1_0 = derivative<0>( P );</div> <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  MyPolynomial P2_0 = derivative<0>( P1_0 );</div> <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  MyPolynomial P0_1 = derivative<1>( P );</div> <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  MyPolynomial P0_2 = derivative<1>( P0_1 );</div> <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  MyPolynomial P1_1 = derivative<1>( P1_0 );</div> <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  MyPolynomial P1_1b= derivative<0>( P0_1 );</div> <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  std::cout << <span class="stringliteral">"P(X_0,X_1) = "</span> << P << std::endl;</div> <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  std::cout << <span class="stringliteral">"dP/dX_0(X_0,X_1) = "</span> << P1_0 << std::endl;</div> <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  std::cout << <span class="stringliteral">"dP/dX_1(X_0,X_1) = "</span> << P0_1 << std::endl;</div> <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  std::cout << <span class="stringliteral">"d/dX_1 dP/dX_0(X_0,X_1) = "</span> << P1_1 << std::endl;</div> <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  std::cout << <span class="stringliteral">"d/dX_0 dP/dX_1(X_0,X_1) = "</span> << P1_1b << std::endl;</div> <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  std::cout << <span class="stringliteral">"d/dX_0 dP/dX_0(X_0,X_1) = "</span> << P2_0 << std::endl;</div> <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  std::cout << <span class="stringliteral">"d/dX_1 dP/dX_1(X_0,X_1) = "</span> << P0_2 << std::endl;</div> <div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">return</span> 0;</div> <div class="line"><a name="l00090"></a><span class="lineno"> 90</span> }</div> <div class="ttc" id="aclassDGtal_1_1MPolynomial_html"><div class="ttname"><a href="classDGtal_1_1MPolynomial.html">DGtal::MPolynomial</a></div><div class="ttdoc">Aim: Represents a multivariate polynomial, i.e. an element of , where K is some ring or field.</div><div class="ttdef"><b>Definition:</b> <a href="MPolynomial_8h_source.html#l00964">MPolynomial.h:965</a></div></div> <div class="ttc" id="apolynomial2-derivative_8cpp_html_a20e26a0834ca2e2905ed656f963ef9f3"><div class="ttname"><a href="polynomial2-derivative_8cpp.html#a20e26a0834ca2e2905ed656f963ef9f3">usage</a></div><div class="ttdeci">void usage(int, char **argv)</div><div class="ttdef"><b>Definition:</b> <a href="polynomial2-derivative_8cpp_source.html#l00048">polynomial2-derivative.cpp:48</a></div></div> </div><!-- fragment --> <p class="reference">References <a class="el" href="polynomial2-derivative_8cpp_source.html#l00048">usage()</a>.</p> </div> </div> <a id="a20e26a0834ca2e2905ed656f963ef9f3"></a> <h2 class="memtitle"><span class="permalink"><a href="#a20e26a0834ca2e2905ed656f963ef9f3">◆ </a></span>usage()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void usage </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname">, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char ** </td> <td class="paramname"><em>argv</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="polynomial2-derivative_8cpp_source.html#l00048">48</a> of file <a class="el" href="polynomial2-derivative_8cpp_source.html">polynomial2-derivative.cpp</a>.</p> <div class="fragment"><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> {</div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  std::cerr << <span class="stringliteral">"Usage: "</span> << argv[ 0 ] << <span class="stringliteral">" <P(x,y)>"</span> << std::endl;</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  std::cerr << <span class="stringliteral">"\t - computes the first and second derivatives of the given polynomial P (in two variables)."</span> << std::endl;</div> <div class="line"><a name="l00052"></a><span class="lineno"> 52</span> }</div> </div><!-- fragment --> <p class="reference">Referenced by <a class="el" href="polynomial2-derivative_8cpp_source.html#l00057">main()</a>.</p> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="dir_d28a4824dc47e487b107a5db32ef43c4.html">examples</a></li><li class="navelem"><a class="el" href="dir_5c8200752a18666074accc56090f0321.html">math</a></li><li class="navelem"><a class="el" href="polynomial2-derivative_8cpp.html">polynomial2-derivative.cpp</a></li> <li class="footer">Generated on Mon Dec 23 2024 13:18:54 for DGtal by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li> </ul> </div> </body> </html>