init_vector.hh
Go to the documentation of this file.
1 //=====================================================
2 // File : init_vector.hh
3 // Author : L. Plagne <laurent.plagne@edf.fr)>
4 // Copyright (C) EDF R&D, lun sep 30 14:23:18 CEST 2002
5 //=====================================================
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 //
20 #ifndef INIT_VECTOR_HH
21 #define INIT_VECTOR_HH
22 
23 // The Vector class must satisfy the following part of STL vector concept :
24 // resize() method
25 // [] operator for setting element
26 // value_type defined
27 template<double init_function(int), class Vector>
28 void init_vector(Vector & X, int size){
29 
30  X.resize(size);
31 
32  for (unsigned int i=0;i<X.size();i++){
33  X[i]=typename Vector::value_type(init_function(i));
34  }
35 }
36 
37 #endif
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
void init_vector(Vector &X, int size)
Definition: init_vector.hh:28
#define X
Definition: icosphere.cpp:20
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:14