~ubuntu-branches/ubuntu/trusty/gsl-ref-html/trusty

« back to all changes in this revision

Viewing changes to 2D-Histogram-allocation.html

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2006-04-12 19:46:32 UTC
  • mfrom: (1.3.1 upstream) (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20060412194632-c9lodpl075pv9si3
Tags: 1.8-1
* New upstream release 1.8
* As with previous releases, the sources were obtained from the FSF web 
  pages by means of a wget call (c.f. the debian/rules target 'upstream')

* debian/control: Standards-Version increased to 3.6.2
* debian/copyright: Updated FSF address
* debian/rules: Set DH_COMPAT=4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html lang="en">
 
2
<head>
 
3
<title>2D Histogram allocation - GNU Scientific Library -- Reference Manual</title>
 
4
<meta http-equiv="Content-Type" content="text/html">
 
5
<meta name="description" content="GNU Scientific Library -- Reference Manual">
 
6
<meta name="generator" content="makeinfo 4.8">
 
7
<link title="Top" rel="start" href="index.html#Top">
 
8
<link rel="up" href="Histograms.html#Histograms" title="Histograms">
 
9
<link rel="prev" href="The-2D-histogram-struct.html#The-2D-histogram-struct" title="The 2D histogram struct">
 
10
<link rel="next" href="Copying-2D-Histograms.html#Copying-2D-Histograms" title="Copying 2D Histograms">
 
11
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
 
12
<!--
 
13
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 The GSL Team.
 
14
 
 
15
Permission is granted to copy, distribute and/or modify this document
 
16
under the terms of the GNU Free Documentation License, Version 1.2 or
 
17
any later version published by the Free Software Foundation; with the
 
18
Invariant Sections being ``GNU General Public License'' and ``Free Software
 
19
Needs Free Documentation'', the Front-Cover text being ``A GNU Manual'',
 
20
and with the Back-Cover Text being (a) (see below).  A copy of the
 
21
license is included in the section entitled ``GNU Free Documentation
 
22
License''.
 
23
 
 
24
(a) The Back-Cover Text is: ``You have freedom to copy and modify this
 
25
GNU Manual, like GNU software.''-->
 
26
<meta http-equiv="Content-Style-Type" content="text/css">
 
27
<style type="text/css"><!--
 
28
  pre.display { font-family:inherit }
 
29
  pre.format  { font-family:inherit }
 
30
  pre.smalldisplay { font-family:inherit; font-size:smaller }
 
31
  pre.smallformat  { font-family:inherit; font-size:smaller }
 
32
  pre.smallexample { font-size:smaller }
 
33
  pre.smalllisp    { font-size:smaller }
 
34
  span.sc    { font-variant:small-caps }
 
35
  span.roman { font-family:serif; font-weight:normal; } 
 
36
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
 
37
--></style>
 
38
</head>
 
39
<body>
 
40
<div class="node">
 
41
<p>
 
42
<a name="g_t2D-Histogram-allocation"></a>
 
43
Next:&nbsp;<a rel="next" accesskey="n" href="Copying-2D-Histograms.html#Copying-2D-Histograms">Copying 2D Histograms</a>,
 
44
Previous:&nbsp;<a rel="previous" accesskey="p" href="The-2D-histogram-struct.html#The-2D-histogram-struct">The 2D histogram struct</a>,
 
45
Up:&nbsp;<a rel="up" accesskey="u" href="Histograms.html#Histograms">Histograms</a>
 
46
<hr>
 
47
</div>
 
48
 
 
49
<h3 class="section">21.14 2D Histogram allocation</h3>
 
50
 
 
51
<p>The functions for allocating memory to a 2D histogram follow the style
 
52
of <code>malloc</code> and <code>free</code>.  In addition they also perform their
 
53
own error checking.  If there is insufficient memory available to
 
54
allocate a histogram then the functions call the error handler (with
 
55
an error number of <code>GSL_ENOMEM</code>) in addition to returning a null
 
56
pointer.  Thus if you use the library error handler to abort your program
 
57
then it isn't necessary to check every 2D histogram <code>alloc</code>.
 
58
 
 
59
<div class="defun">
 
60
&mdash; Function: gsl_histogram2d * <b>gsl_histogram2d_alloc</b> (<var>size_t nx, size_t ny</var>)<var><a name="index-gsl_005fhistogram2d_005falloc-1809"></a></var><br>
 
61
<blockquote><p>This function allocates memory for a two-dimensional histogram with
 
62
<var>nx</var> bins in the x direction and <var>ny</var> bins in the y direction. 
 
63
The function returns a pointer to a newly created <code>gsl_histogram2d</code>
 
64
struct. If insufficient memory is available a null pointer is returned
 
65
and the error handler is invoked with an error code of
 
66
<code>GSL_ENOMEM</code>. The bins and ranges must be initialized with one of
 
67
the functions below before the histogram is ready for use. 
 
68
</p></blockquote></div>
 
69
 
 
70
<!-- @deftypefun {gsl_histogram2d *} gsl_histogram2d_calloc (size_t @var{nx}, size_t @var{ny}) -->
 
71
<!-- This function allocates memory for a two-dimensional histogram with -->
 
72
<!-- @var{nx} bins in the x direction and @var{ny} bins in the y -->
 
73
<!-- direction.  The function returns a pointer to a newly initialized -->
 
74
<!-- @code{gsl_histogram2d} struct.  The bins are uniformly spaced with a -->
 
75
<!-- total range of -->
 
76
<!-- @c{$0 \le  x < nx$} -->
 
77
<!-- @math{0 <= x < nx} in the x-direction and -->
 
78
<!-- @c{$0 \le  y < ny$} -->
 
79
<!-- @math{0 <=  y < ny} in the y-direction, as shown in the table below. -->
 
80
<!-- The bins are initialized to zero so the histogram is ready for use. -->
 
81
<!-- If insufficient memory is available a null pointer is returned and the -->
 
82
<!-- error handler is invoked with an error code of @code{GSL_ENOMEM}. -->
 
83
<!-- @end deftypefun -->
 
84
<!-- @deftypefun {gsl_histogram2d *} gsl_histogram2d_calloc_uniform (size_t @var{nx}, size_t @var{ny}, double @var{xmin}, double @var{xmax}, double @var{ymin}, double @var{ymax}) -->
 
85
<!-- This function allocates a histogram of size @var{nx}-by-@var{ny} which -->
 
86
<!-- uniformly covers the ranges @var{xmin} to @var{xmax} and @var{ymin} to -->
 
87
<!-- @var{ymax} in the @math{x} and @math{y} directions respectively. -->
 
88
<!-- @end deftypefun -->
 
89
<!-- @deftypefun {gsl_histogram2d *} gsl_histogram2d_calloc_range (size_t @var{nx}, size_t @var{ny}, double * @var{xrange}, double * @var{yrange}) -->
 
90
<!-- This function allocates a histogram of size @var{nx}-by-@var{ny} using -->
 
91
<!-- the @math{nx+1} and @math{ny+1} bin ranges specified by the arrays -->
 
92
<!-- @var{xrange} and @var{xyrange}. -->
 
93
<!-- @end deftypefun -->
 
94
<div class="defun">
 
95
&mdash; Function: int <b>gsl_histogram2d_set_ranges</b> (<var>gsl_histogram2d * h, const double xrange</var>[]<var>, size_t xsize, const double yrange</var>[]<var>, size_t ysize</var>)<var><a name="index-gsl_005fhistogram2d_005fset_005franges-1810"></a></var><br>
 
96
<blockquote><p>This function sets the ranges of the existing histogram <var>h</var> using
 
97
the arrays <var>xrange</var> and <var>yrange</var> of size <var>xsize</var> and
 
98
<var>ysize</var> respectively.  The values of the histogram bins are reset to
 
99
zero. 
 
100
</p></blockquote></div>
 
101
 
 
102
<div class="defun">
 
103
&mdash; Function: int <b>gsl_histogram2d_set_ranges_uniform</b> (<var>gsl_histogram2d * h, double xmin, double xmax, double ymin, double ymax</var>)<var><a name="index-gsl_005fhistogram2d_005fset_005franges_005funiform-1811"></a></var><br>
 
104
<blockquote><p>This function sets the ranges of the existing histogram <var>h</var> to cover
 
105
the ranges <var>xmin</var> to <var>xmax</var> and <var>ymin</var> to <var>ymax</var>
 
106
uniformly.  The values of the histogram bins are reset to zero. 
 
107
</p></blockquote></div>
 
108
 
 
109
<div class="defun">
 
110
&mdash; Function: void <b>gsl_histogram2d_free</b> (<var>gsl_histogram2d * h</var>)<var><a name="index-gsl_005fhistogram2d_005ffree-1812"></a></var><br>
 
111
<blockquote><p>This function frees the 2D histogram <var>h</var> and all of the memory
 
112
associated with it. 
 
113
</p></blockquote></div>
 
114
 
 
115
   </body></html>
 
116