~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.1.0/doc/html/qwt__math_8cpp-source.html

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-05-26 10:26:31 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526102631-bp95mfccnrb957nx
Tags: 5.1.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3
 
<title>Qwt User&apos;s Guide: qwt_math.cpp Source File</title>
4
 
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
 
<link href="tabs.css" rel="stylesheet" type="text/css">
6
 
</head><body>
7
 
<!-- Generated by Doxygen 1.5.0 -->
8
 
<div class="tabs">
9
 
  <ul>
10
 
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11
 
    <li><a href="classes.html"><span>Classes</span></a></li>
12
 
    <li id="current"><a href="files.html"><span>Files</span></a></li>
13
 
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
14
 
  </ul></div>
15
 
<div class="tabs">
16
 
  <ul>
17
 
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
18
 
    <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
19
 
  </ul></div>
20
 
<h1>qwt_math.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************</span>
21
 
<a name="l00002"></a>00002 <span class="comment"> * Qwt Widget Library</span>
22
 
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1997   Josef Wilgen</span>
23
 
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002   Uwe Rathmann</span>
24
 
<a name="l00005"></a>00005 <span class="comment"> * </span>
25
 
<a name="l00006"></a>00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
26
 
<a name="l00007"></a>00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span>
27
 
<a name="l00008"></a>00008 <span class="comment"> *****************************************************************************/</span>
28
 
<a name="l00009"></a>00009 
29
 
<a name="l00010"></a>00010 <span class="comment">// vim: expandtab</span>
30
 
<a name="l00011"></a>00011 
31
 
<a name="l00012"></a>00012 <span class="preprocessor">#include "qwt_math.h"</span>
32
 
<a name="l00013"></a>00013 
33
 
<a name="l00019"></a>00019 <span class="keywordtype">double</span> qwtGetMin(<span class="keyword">const</span> <span class="keywordtype">double</span> *array, <span class="keywordtype">int</span> size)
34
 
<a name="l00020"></a>00020 {
35
 
<a name="l00021"></a>00021     <span class="keywordflow">if</span> (size &lt;= 0)
36
 
<a name="l00022"></a>00022        <span class="keywordflow">return</span> 0.0;
37
 
<a name="l00023"></a>00023 
38
 
<a name="l00024"></a>00024     <span class="keywordtype">double</span> rv = array[0];
39
 
<a name="l00025"></a>00025     <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; size; i++)
40
 
<a name="l00026"></a>00026        rv = qwtMin(rv, array[i]);
41
 
<a name="l00027"></a>00027 
42
 
<a name="l00028"></a>00028     <span class="keywordflow">return</span> rv;
43
 
<a name="l00029"></a>00029 }
44
 
<a name="l00030"></a>00030 
45
 
<a name="l00031"></a>00031 
46
 
<a name="l00037"></a>00037 <span class="keywordtype">double</span> qwtGetMax(<span class="keyword">const</span> <span class="keywordtype">double</span> *array, <span class="keywordtype">int</span> size)
47
 
<a name="l00038"></a>00038 {
48
 
<a name="l00039"></a>00039     <span class="keywordflow">if</span> (size &lt;= 0)
49
 
<a name="l00040"></a>00040        <span class="keywordflow">return</span> 0.0;
50
 
<a name="l00041"></a>00041     
51
 
<a name="l00042"></a>00042     <span class="keywordtype">double</span> rv = array[0];
52
 
<a name="l00043"></a>00043     <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; size; i++)
53
 
<a name="l00044"></a>00044        rv = qwtMax(rv, array[i]);
54
 
<a name="l00045"></a>00045 
55
 
<a name="l00046"></a>00046     <span class="keywordflow">return</span> rv;
56
 
<a name="l00047"></a>00047 }
57
 
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 1 15:44:08 2008 for Qwt User's Guide by&nbsp;
58
 
<a href="http://www.doxygen.org/index.html">
59
 
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.0 </small></address>
60
 
</body>
61
 
</html>