<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.programmingexamples.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FBoost%2FMath%2FTools%2Fbrent_find_minima</id>
		<title>CPP/Boost/Math/Tools/brent find minima - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FBoost%2FMath%2FTools%2Fbrent_find_minima"/>
		<link rel="alternate" type="text/html" href="http://www.programmingexamples.net/w/index.php?title=CPP/Boost/Math/Tools/brent_find_minima&amp;action=history"/>
		<updated>2026-05-25T13:03:21Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>http://www.programmingexamples.net/w/index.php?title=CPP/Boost/Math/Tools/brent_find_minima&amp;diff=4716&amp;oldid=prev</id>
		<title>Awallin: simple brent_find_minima example</title>
		<link rel="alternate" type="text/html" href="http://www.programmingexamples.net/w/index.php?title=CPP/Boost/Math/Tools/brent_find_minima&amp;diff=4716&amp;oldid=prev"/>
				<updated>2011-08-14T12:10:51Z</updated>
		
		<summary type="html">&lt;p&gt;simple brent_find_minima example&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;boost/math/tools/minima.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
double f(double x) { return x * cos(x); }&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char** argv)&lt;br /&gt;
{&lt;br /&gt;
    typedef std::pair&amp;lt;double, double&amp;gt; Result;&lt;br /&gt;
    // find a root of the function f in the interval x=[3.0, 4.0] with 20-bit precision&lt;br /&gt;
    Result r2 = boost::math::tools::brent_find_minima(f, 3.0, 4.0, 20);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;x=&amp;quot; &amp;lt;&amp;lt; r2.first &amp;lt;&amp;lt; &amp;quot; f=&amp;quot; &amp;lt;&amp;lt; r2.second &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// output:&lt;br /&gt;
// x=3.42562 f=-3.28837&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* CMakeLists.txt&lt;br /&gt;
cmake_minimum_required(VERSION 2.6)&lt;br /&gt;
 &lt;br /&gt;
Project(brent_test)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
FIND_PACKAGE(Boost)&lt;br /&gt;
 &lt;br /&gt;
INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${Boost_INCLUDE_DIRS})&lt;br /&gt;
LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS})&lt;br /&gt;
 &lt;br /&gt;
ADD_EXECUTABLE(brent_test main.cpp)&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Awallin</name></author>	</entry>

	</feed>