sample.cpp
Go to the documentation of this file.
1 // $Id$
2 // Copyright (C) 2003 Klaas Gadeyne <first dot last at gmail dot com>
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published by
6 // the Free Software Foundation; either version 2.1 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 //
18 
19 // This file only contains template specialisation code
20 #include "sample.h"
21 #include <cassert>
22 
23 namespace BFL
24 {
25  using namespace MatrixWrapper;
26 
27 
28  // Template Specialisation for T =ColumnVector
29  template <> inline
30  Sample<ColumnVector>::Sample (unsigned int dimension)
31  : Value(dimension)
32  {};
33 
34 
35  template <> inline unsigned int
37  {
38  return Value.rows();
39  };
40 
41  template <> inline void
43  {
44  return Value.resize(dim);
45  };
46 
47  // Template Specialisation for T = double
48  template <> inline unsigned int
50  {
51  return 1;
52  };
53 
54  template <> inline void
55  Sample<double>::DimensionSet(unsigned int dim)
56  {
57  assert(dim == 1);
58  };
59 
60  // Template Specialisation for T = int
61  template <> inline unsigned int
63  {
64  return 1;
65  };
66 
67  template <> inline void
68  Sample<int>::DimensionSet(unsigned int dim)
69  {
70  assert(dim == 1);
71  };
72 }
73 
74 
75 
76 
77 
Sample(unsigned int dimension=0)
Constructor.


bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Mon Feb 28 2022 21:56:33