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

« back to all changes in this revision

Viewing changes to Creating-row-and-column-views.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>Creating row and column views - 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="Matrices.html#Matrices" title="Matrices">
 
9
<link rel="prev" href="Matrix-views.html#Matrix-views" title="Matrix views">
 
10
<link rel="next" href="Copying-matrices.html#Copying-matrices" title="Copying matrices">
 
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="Creating-row-and-column-views"></a>
 
43
Next:&nbsp;<a rel="next" accesskey="n" href="Copying-matrices.html#Copying-matrices">Copying matrices</a>,
 
44
Previous:&nbsp;<a rel="previous" accesskey="p" href="Matrix-views.html#Matrix-views">Matrix views</a>,
 
45
Up:&nbsp;<a rel="up" accesskey="u" href="Matrices.html#Matrices">Matrices</a>
 
46
<hr>
 
47
</div>
 
48
 
 
49
<h4 class="subsection">8.4.6 Creating row and column views</h4>
 
50
 
 
51
<p>In general there are two ways to access an object, by reference or by
 
52
copying.  The functions described in this section create vector views
 
53
which allow access to a row or column of a matrix by reference. 
 
54
Modifying elements of the view is equivalent to modifying the matrix,
 
55
since both the vector view and the matrix point to the same memory
 
56
block.
 
57
 
 
58
<div class="defun">
 
59
&mdash; Function: gsl_vector_view <b>gsl_matrix_row</b> (<var>gsl_matrix * m, size_t i</var>)<var><a name="index-gsl_005fmatrix_005frow-913"></a></var><br>
 
60
&mdash; Function: gsl_vector_const_view <b>gsl_matrix_const_row</b> (<var>const gsl_matrix * m, size_t i</var>)<var><a name="index-gsl_005fmatrix_005fconst_005frow-914"></a></var><br>
 
61
<blockquote><p>These functions return a vector view of the <var>i</var>-th row of the matrix
 
62
<var>m</var>.  The <code>data</code> pointer of the new vector is set to null if
 
63
<var>i</var> is out of range.
 
64
 
 
65
        <p>The function <code>gsl_vector_const_row</code> is equivalent to
 
66
<code>gsl_matrix_row</code> but can be used for matrices which are declared
 
67
<code>const</code>. 
 
68
</p></blockquote></div>
 
69
 
 
70
<div class="defun">
 
71
&mdash; Function: gsl_vector_view <b>gsl_matrix_column</b> (<var>gsl_matrix * m, size_t j</var>)<var><a name="index-gsl_005fmatrix_005fcolumn-915"></a></var><br>
 
72
&mdash; Function: gsl_vector_const_view <b>gsl_matrix_const_column</b> (<var>const gsl_matrix * m, size_t j</var>)<var><a name="index-gsl_005fmatrix_005fconst_005fcolumn-916"></a></var><br>
 
73
<blockquote><p>These functions return a vector view of the <var>j</var>-th column of the
 
74
matrix <var>m</var>.  The <code>data</code> pointer of the new vector is set to
 
75
null if <var>j</var> is out of range.
 
76
 
 
77
        <p>The function <code>gsl_vector_const_column</code> is equivalent to
 
78
<code>gsl_matrix_column</code> but can be used for matrices which are declared
 
79
<code>const</code>. 
 
80
</p></blockquote></div>
 
81
 
 
82
   <p><a name="index-matrix-diagonal-917"></a><a name="index-diagonal_002c-of-a-matrix-918"></a>
 
83
 
 
84
<div class="defun">
 
85
&mdash; Function: gsl_vector_view <b>gsl_matrix_diagonal</b> (<var>gsl_matrix * m</var>)<var><a name="index-gsl_005fmatrix_005fdiagonal-919"></a></var><br>
 
86
&mdash; Function: gsl_vector_const_view <b>gsl_matrix_const_diagonal</b> (<var>const gsl_matrix * m</var>)<var><a name="index-gsl_005fmatrix_005fconst_005fdiagonal-920"></a></var><br>
 
87
<blockquote><p>These functions returns a vector view of the diagonal of the matrix
 
88
<var>m</var>. The matrix <var>m</var> is not required to be square. For a
 
89
rectangular matrix the length of the diagonal is the same as the smaller
 
90
dimension of the matrix.
 
91
 
 
92
        <p>The function <code>gsl_matrix_const_diagonal</code> is equivalent to
 
93
<code>gsl_matrix_diagonal</code> but can be used for matrices which are
 
94
declared <code>const</code>. 
 
95
</p></blockquote></div>
 
96
 
 
97
   <p><a name="index-matrix-subdiagonal-921"></a><a name="index-subdiagonal_002c-of-a-matrix-922"></a>
 
98
 
 
99
<div class="defun">
 
100
&mdash; Function: gsl_vector_view <b>gsl_matrix_subdiagonal</b> (<var>gsl_matrix * m, size_t k</var>)<var><a name="index-gsl_005fmatrix_005fsubdiagonal-923"></a></var><br>
 
101
&mdash; Function: gsl_vector_const_view <b>gsl_matrix_const_subdiagonal</b> (<var>const gsl_matrix * m, size_t k</var>)<var><a name="index-gsl_005fmatrix_005fconst_005fsubdiagonal-924"></a></var><br>
 
102
<blockquote><p>These functions return a vector view of the <var>k</var>-th subdiagonal of
 
103
the matrix <var>m</var>. The matrix <var>m</var> is not required to be square. 
 
104
The diagonal of the matrix corresponds to k = 0.
 
105
 
 
106
        <p>The function <code>gsl_matrix_const_subdiagonal</code> is equivalent to
 
107
<code>gsl_matrix_subdiagonal</code> but can be used for matrices which are
 
108
declared <code>const</code>. 
 
109
</p></blockquote></div>
 
110
 
 
111
   <p><a name="index-matrix-superdiagonal-925"></a><a name="index-superdiagonal_002c-matrix-926"></a>
 
112
 
 
113
<div class="defun">
 
114
&mdash; Function: gsl_vector_view <b>gsl_matrix_superdiagonal</b> (<var>gsl_matrix * m, size_t k</var>)<var><a name="index-gsl_005fmatrix_005fsuperdiagonal-927"></a></var><br>
 
115
&mdash; Function: gsl_vector_const_view <b>gsl_matrix_const_superdiagonal</b> (<var>const gsl_matrix * m, size_t k</var>)<var><a name="index-gsl_005fmatrix_005fconst_005fsuperdiagonal-928"></a></var><br>
 
116
<blockquote><p>These functions return a vector view of the <var>k</var>-th superdiagonal of
 
117
the matrix <var>m</var>. The matrix <var>m</var> is not required to be square. The
 
118
diagonal of the matrix corresponds to k = 0.
 
119
 
 
120
        <p>The function <code>gsl_matrix_const_superdiagonal</code> is equivalent to
 
121
<code>gsl_matrix_superdiagonal</code> but can be used for matrices which are
 
122
declared <code>const</code>. 
 
123
</p></blockquote></div>
 
124
 
 
125
<!-- @deftypefun {gsl_vector *} gsl_vector_alloc_row_from_matrix (gsl_matrix * @var{m}, size_t @var{i}) -->
 
126
<!-- This function allocates a new @code{gsl_vector} struct which points to -->
 
127
<!-- the @var{i}-th row of the matrix @var{m}. -->
 
128
<!-- @end deftypefun -->
 
129
<!-- @deftypefun {gsl_vector *} gsl_vector_alloc_col_from_matrix (gsl_matrix * @var{m}, size_t @var{j}) -->
 
130
<!-- This function allocates a new @code{gsl_vector} struct which points to -->
 
131
<!-- the @var{j}-th column of the matrix @var{m}. -->
 
132
<!-- @end deftypefun -->
 
133
</body></html>
 
134