Rheolef  7.2
an efficient C++ finite element environment
diag.h
Go to the documentation of this file.
1 # ifndef _SKIT_DIAG_H
2 # define _SKIT_DIAG_H
3 //
4 // This file is part of Rheolef.
5 //
6 // Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
7 //
8 // Rheolef is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // Rheolef is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with Rheolef; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 //
22 // =========================================================================
23 # include "rheolef/dia.h"
24 
25 namespace rheolef {
26 
27 /*Class:diag
28 NAME: @code{diag} - get diagonal part of a matrix
29 @clindex dia
30 @clindex vec
31 @clindex csr
32 @cindex diagonal matrix
33 DESCRIPTION:
34  This function get the diagonal part of a matrix.
35  @example
36  csr<Float> a;
37  dia<Float> d = diag(a);
38  @end example
39 TODO:
40  Build a csr matrix from a diagonal one or from a vector:
41  @example
42  dia<Float> d;
43  csr<Float> a = diag(d);
44  vec<Float> u;
45  csr<Float> b = diag(u);
46  @end example
47 End:
48 */
49 //<diag:
50 template<class T, class M>
52 //>diag:
53 {
54  return dia<T,M>(a);
55 }
56 
57 }// namespace rheolef
58 # endif /* _SKIT_DIAG_H */
This file is part of Rheolef.
csr< T, M > diag(const vec< T, M > &d)
Definition: csr.cc:56