SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DenseVector2dField2d.hpp
Go to the documentation of this file.
1 /*
2  * Copyright(c):
3  * Signal Image and Communications (SIC) Department
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * - University of Poitiers, France http://www.univ-poitiers.fr
6  * - XLIM Institute UMR CNRS 7252 http://www.xlim.fr/
7  *
8  * and
9  *
10  * D2 Fluid, Thermic and Combustion
11  * - University of Poitiers, France http://www.univ-poitiers.fr
12  * - PPRIME Institute - UPR CNRS 3346 http://www.pprime.fr
13  * - ISAE-ENSMA http://www.ensma.fr
14  *
15  * Contributor(s):
16  * The SLIP team,
17  * Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>,
18  * Laurent David <laurent.david_AT_lea.univ-poitiers.fr>,
19  * Ludovic Chatellier <ludovic.chatellier_AT_univ-poitiers.fr>,
20  * Lionel Thomas <lionel.thomas_AT_univ-poitiers.fr>,
21  * Denis Arrivault <arrivault_AT_sic.univ-poitiers.fr>,
22  * Julien Dombre <julien.dombre_AT_univ-poitiers.fr>.
23  *
24  * Description:
25  * The Simple Library of Image Processing (SLIP) is a new image processing
26  * library. It is written in the C++ language following as much as possible
27  * the ISO/ANSI C++ standard. It is consequently compatible with any system
28  * satisfying the ANSI C++ complience. It works on different Unix , Linux ,
29  * Mircrosoft Windows and Mac OS X plateforms. SLIP is a research library that
30  * was created by the Signal, Image and Communications (SIC) departement of
31  * the XLIM, UMR 7252 CNRS Institute in collaboration with the Fluids, Thermic
32  * and Combustion departement of the P', UPR 3346 CNRS Institute of the
33  * University of Poitiers.
34  *
35  * The SLIP Library source code has been registered to the APP (French Agency
36  * for the Protection of Programs) by the University of Poitiers and CNRS,
37  * under registration number IDDN.FR.001.300034.000.S.P.2010.000.21000.
38 
39  * http://www.sic.sp2mi.univ-poitiers.fr/slip/
40  *
41  * This software is governed by the CeCILL-C license under French law and
42  * abiding by the rules of distribution of free software. You can use,
43  * modify and/ or redistribute the software under the terms of the CeCILL-C
44  * license as circulated by CEA, CNRS and INRIA at the following URL
45  * http://www.cecill.info.
46  * As a counterpart to the access to the source code and rights to copy,
47  * modify and redistribute granted by the license, users are provided only
48  * with a limited warranty and the software's author, the holder of the
49  * economic rights, and the successive licensors have only limited
50  * liability.
51  *
52  * In this respect, the user's attention is drawn to the risks associated
53  * with loading, using, modifying and/or developing or reproducing the
54  * software by the user in light of its specific status of free software,
55  * that may mean that it is complicated to manipulate, and that also
56  * therefore means that it is reserved for developers and experienced
57  * professionals having in-depth computer knowledge. Users are therefore
58  * encouraged to load and test the software's suitability as regards their
59  * requirements in conditions enabling the security of their systems and/or
60  * data to be ensured and, more generally, to use and operate it in the
61  * same conditions as regards security.
62  *
63  * The fact that you are presently reading this means that you have had
64  * knowledge of the CeCILL-C license and that you accept its terms.
65  */
66 
67 
74 #ifndef SLIP_DENSEVECTOR2DFIELD2D_HPP
75 #define SLIP_DENSEVECTOR2DFIELD2D_HPP
76 
77 #include <iostream>
78 #include <fstream>
79 #include <iterator>
80 #include <cassert>
81 #include <numeric>
82 #include <algorithm>
83 #include <cmath>
84 #include <string>
85 #include <cstddef>
86 #include "Matrix.hpp"
87 #include "stride_iterator.hpp"
88 #include "kstride_iterator.hpp"
89 #include "iterator2d_box.hpp"
90 #include "iterator2d_range.hpp"
91 #include "apply.hpp"
92 #include "Vector2d.hpp"
94 #include "derivatives.hpp"
95 #include "arithmetic_op.hpp"
96 #include "io_tools.hpp"
98 
99 #include <boost/serialization/access.hpp>
100 #include <boost/serialization/split_member.hpp>
101 #include <boost/serialization/version.hpp>
102 #include <boost/serialization/base_object.hpp>
103 
104 namespace slip
105 {
106 
107 template<typename T>
108 class stride_iterator;
109 
110 template<typename T>
111 class iterator2d_box;
112 
113 template<typename T>
114 class iterator2d_range;
115 
116 template<typename T>
117 class const_iterator2d_box;
118 
119 template<typename T>
120 class const_iterator2d_range;
121 
122 
123 template <typename T>
124 class DPoint2d;
125 
126 template <typename T>
127 class Point2d;
128 
129 template <typename T>
130 class Box2d;
131 
132 template <typename T>
134 
135 
156 template <typename T>
157 class DenseVector2dField2d:public slip::GenericMultiComponent2d<slip::Vector2d<T> >
158 {
159 public :
160 
165 
166 
167  typedef value_type* pointer;
168  typedef const value_type* const_pointer;
170  typedef const value_type& const_reference;
171 
172  typedef ptrdiff_t difference_type;
173  typedef std::size_t size_type;
174 
175  typedef pointer iterator;
177 
178  typedef std::reverse_iterator<iterator> reverse_iterator;
179  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
180 
181 
186 
187  typedef std::reverse_iterator<iterator> reverse_row_iterator;
188  typedef std::reverse_iterator<const_iterator> const_reverse_row_iterator;
189  typedef std::reverse_iterator<col_iterator> reverse_col_iterator;
190  typedef std::reverse_iterator<const_col_iterator> const_reverse_col_iterator;
191 
194 
202 
204 
205  static const std::size_t DIM = 2;
206 public:
212 
217  base()
218  {}
219 
228  const size_type width):
229  base(height,width)
230  {}
231 
239  const size_type width,
240  const slip::Vector2d<T>& val):
241  base(height,width,val)
242  {}
243 
251  const size_type width,
252  const T* val):
253  base(height,width,val)
254  {}
255 
263  const size_type width,
264  const slip::Vector2d<T>* val):
265  base(height,width,val)
266  {}
267 
268 
279  template<typename InputIterator>
281  const size_type width,
282  InputIterator first,
283  InputIterator last):
284  base(height,width,first,last)
285  {}
286 
287 
288 
289 
303  template<typename InputIterator>
305  const size_type width,
306  InputIterator first1,
307  InputIterator last1,
308  InputIterator first2):
309  base(height,width)
310  {
311 
312  std::vector<InputIterator> first_iterators_list(2);
313  first_iterators_list[0] = first1;
314  first_iterators_list[1] = first2;
315  this->fill(first_iterators_list,last1);
316 
317  }
318 
319 
323  DenseVector2dField2d(const self& rhs):
324  base(rhs)
325  {}
326 
331  {}
332 
333 
342  std::string name() const;
343 
344 
349 
357  void write_gnuplot(const std::string& file_path_name);
358 
359 
376  void write_tecplot(const std::string& file_path_name,
377  const std::string& title,
378  const std::string& zone);
379 
380 
388  void read_gnuplot(const std::string& file_path_name);
389 
390 
405  void read_tecplot(const std::string& file_path_name);
406 
407 
408 
415 
416 
417 
423  self& operator=(const slip::Vector2d<T>& val);
424 
425 
431  self& operator=(const T& val);
432 
433 
434 
435 
436 
456  T& Vx1(const size_type i,
457  const size_type j);
458 
459 
460 
473  const T& Vx1(const size_type i,
474  const size_type j) const;
475 
476 
490  T& Vx2(const size_type i,
491  const size_type j);
492 
505  const T& Vx2(const size_type i,
506  const size_type j) const;
507 
521  T& u(const size_type i,
522  const size_type j);
523 
524 
525 
538  const T& u(const size_type i,
539  const size_type j) const;
540 
541 
555  T& v(const size_type i,
556  const size_type j);
557 
570  const T& v(const size_type i,
571  const size_type j) const;
572 
573 
586  norm_type norm(const size_type i,
587  const size_type j) const;
588 
602  norm_type angle(const size_type i,
603  const size_type j) const;
604 
611 
612 
625  self& operator+=(const T& val);
626  self& operator-=(const T& val);
627  self& operator*=(const T& val);
628  self& operator/=(const T& val);
629 
630 // self& operator%=(const T& val);
631 // self& operator^=(const T& val);
632 // self& operator&=(const T& val);
633 // self& operator|=(const T& val);
634 // self& operator<<=(const T& val);
635 // self& operator>>=(const T& val);
636 
637 
638  self operator-() const;
639 // self operator!() const;
640 
646  self& operator+=(const slip::Vector2d<T>& val);
647  self& operator-=(const slip::Vector2d<T>& val);
648  self& operator*=(const slip::Vector2d<T>& val);
649  self& operator/=(const slip::Vector2d<T>& val);
650 
651 
652 
653  self& operator+=(const self& rhs);
654  self& operator-=(const self& rhs);
655  self& operator*=(const self& rhs);
656  self& operator/=(const self& rhs);
657 
658 
665 
666 
667 
676  template<typename Container2D>
677  void norm(Container2D& result)
678  {
679  //typedef slip::Vector2d<double> vector;
680  std::transform(this->begin(),this->end(),result.begin(),std::mem_fun_ref(&value_type::Euclidean_norm));
681 
682  }
683 
692  template<typename Container2D>
693  void angle(Container2D& result)
694  {
695 
696  std::transform(this->begin(),this->end(),result.begin(),std::mem_fun_ref(&slip::Vector2d<T>::angle));
697 
698  }
699 
702 private :
704  template<class Archive>
705  void save(Archive & ar, const unsigned int version) const
706  {
707  ar & boost::serialization::base_object<slip::GenericMultiComponent2d<slip::Vector2d<T> > >(*this);
708  }
709  template<class Archive>
710  void load(Archive & ar, const unsigned int version)
711  {
712  ar & boost::serialization::base_object<slip::GenericMultiComponent2d<slip::Vector2d<T> > >(*this);
713  }
714  BOOST_SERIALIZATION_SPLIT_MEMBER()
715  };
716 
737 
738 }//slip::
739 
740 namespace slip{
741 
742 
749 template<typename T>
750 DenseVector2dField2d<T> operator+(const DenseVector2dField2d<T>& M1,
751  const T& val);
752 
759  template<typename T>
760  DenseVector2dField2d<T> operator+(const T& val,
761  const DenseVector2dField2d<T>& M1);
762 
763 
770 template<typename T>
771 DenseVector2dField2d<T> operator-(const DenseVector2dField2d<T>& M1,
772  const T& val);
773 
780  template<typename T>
781  DenseVector2dField2d<T> operator-(const T& val,
782  const DenseVector2dField2d<T>& M1);
783 
784 
785 
792  template<typename T>
793  DenseVector2dField2d<T> operator*(const DenseVector2dField2d<T>& M1,
794  const T& val);
795 
802  template<typename T>
803  DenseVector2dField2d<T> operator*(const T& val,
804  const DenseVector2dField2d<T>& M1);
805 
806 
807 
814  template<typename T>
815  DenseVector2dField2d<T> operator/(const DenseVector2dField2d<T>& M1,
816  const T& val);
817 
818 
827 template<typename T>
828 DenseVector2dField2d<T> operator+(const DenseVector2dField2d<T>& M1,
829  const DenseVector2dField2d<T>& M2);
830 
837 template<typename T>
838 DenseVector2dField2d<T> operator+(const DenseVector2dField2d<T>& M1,
839  const slip::Vector2d<T>& val);
840 
847  template<typename T>
848  DenseVector2dField2d<T> operator+(const slip::Vector2d<T>& val,
849  const DenseVector2dField2d<T>& M1);
850 
851 
852 
861 template<typename T>
862 DenseVector2dField2d<T> operator-(const DenseVector2dField2d<T>& M1,
863  const DenseVector2dField2d<T>& M2);
864 
865 
872 template<typename T>
873 DenseVector2dField2d<T> operator-(const DenseVector2dField2d<T>& M1,
874  const slip::Vector2d<T>& val);
875 
882  template<typename T>
883  DenseVector2dField2d<T> operator-(const slip::Vector2d<T>& val,
884  const DenseVector2dField2d<T>& M1);
885 
886 
887 
896  template<typename T>
897  DenseVector2dField2d<T> operator*(const DenseVector2dField2d<T>& M1,
898  const DenseVector2dField2d<T>& M2);
899 
900 
907 template<typename T>
908 DenseVector2dField2d<T> operator*(const DenseVector2dField2d<T>& M1,
909  const slip::Vector2d<T>& val);
910 
917  template<typename T>
918  DenseVector2dField2d<T> operator*(const slip::Vector2d<T>& val,
919  const DenseVector2dField2d<T>& M1);
920 
921 
922 
931  template<typename T>
932  DenseVector2dField2d<T> operator/(const DenseVector2dField2d<T>& M1,
933  const DenseVector2dField2d<T>& M2);
934 
941 template<typename T>
942 DenseVector2dField2d<T> operator/(const DenseVector2dField2d<T>& M1,
943  const slip::Vector2d<T>& val);
944 
945 
946 
947 
948 }//slip::
949 
950 namespace slip
951 {
952 
953 
954 // template<typename T>
955 // inline
956 // DenseVector2dField2d<T>& DenseVector2dField2d<T>::operator=(const DenseVector2dField2d<T> & rhs)
957 // {
958 // if(this != &rhs)
959 // {
960 // *matrix_ = *(rhs.matrix_);
961 // }
962 // return *this;
963 // }
964 
965  template<typename T>
966  inline
968  {
969  std::fill_n(this->begin(),this->size(),val);
970  return *this;
971  }
972 
973 
974  template<typename T>
975  inline
977  {
978  std::fill_n(this->begin(),this->size(),val);
979  return *this;
980  }
981 
982 
983  template<typename T>
984  inline
986  const typename DenseVector2dField2d::size_type j)
987  {
988  return (*this)[i][j][0];
989  }
990 
991  template<typename T>
992  inline
994  const typename DenseVector2dField2d::size_type j) const
995  {
996  return (*this)[i][j][0];
997  }
998 
999  template<typename T>
1000  inline
1002  const typename DenseVector2dField2d::size_type j)
1003  {
1004  return this->Vx1(i,j);
1005  }
1006 
1007  template<typename T>
1008  inline
1010  const typename DenseVector2dField2d::size_type j) const
1011  {
1012  return this->Vx1(i,j);
1013  }
1014 
1015 
1016  template<typename T>
1017  inline
1019  const typename DenseVector2dField2d::size_type j)
1020  {
1021  return (*this)[i][j][1];
1022  }
1023 
1024  template<typename T>
1025  inline
1027  const typename DenseVector2dField2d::size_type j) const
1028  {
1029  return (*this)[i][j][1];
1030  }
1031 
1032 
1033  template<typename T>
1034  inline
1036  const typename DenseVector2dField2d::size_type j)
1037  {
1038  return this->Vx2(i,j);
1039  }
1040 
1041  template<typename T>
1042  inline
1044  const typename DenseVector2dField2d::size_type j) const
1045  {
1046  return this->Vx2(i,j);
1047  }
1048 
1049  template<typename T>
1050  inline
1052  {
1053  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::plus<slip::Vector2d<T> >(),val));
1054  return *this;
1055  }
1056 
1057  template<typename T>
1058  inline
1061  const typename DenseVector2dField2d::size_type j) const
1062  {
1063  return (*this)[i][j].Euclidean_norm();
1064  }
1065 
1066  template<typename T>
1067  inline
1070  const typename DenseVector2dField2d::size_type j) const
1071  {
1072  return (*this)[i][j].angle();
1073  }
1074 
1075  template<typename T>
1076  inline
1078  {
1079  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::minus<slip::Vector2d<T> >(),val));
1080  return *this;
1081  }
1082 
1083  template<typename T>
1084  inline
1086  {
1087  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::multiplies<slip::Vector2d<T> >(),val));
1088  return *this;
1089  }
1090 
1091  template<typename T>
1092  inline
1094  {
1095  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::divides<slip::Vector2d<T> >(),val));
1096  return *this;
1097  }
1098 
1099 
1100 
1101  template<typename T>
1102  inline
1104  {
1105  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::plus<slip::Vector2d<T> >(),val));
1106  return *this;
1107  }
1108 
1109  template<typename T>
1110  inline
1112  {
1113  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::minus<slip::Vector2d<T> >(),val));
1114  return *this;
1115  }
1116 
1117  template<typename T>
1118  inline
1120  {
1121  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::multiplies<slip::Vector2d<T> >(),val));
1122  return *this;
1123  }
1124 
1125  template<typename T>
1126  inline
1128  {
1129  std::transform(this->begin(),this->end(),this->begin(),std::bind2nd(std::divides<slip::Vector2d<T> >(),val));
1130  return *this;
1131  }
1132 
1133 
1134 
1135  template<typename T>
1136  inline
1138  {
1139  DenseVector2dField2d<T> tmp(*this);
1140  std::transform(this->begin(),this->end(),tmp.begin(),std::negate<slip::Vector2d<T> >());
1141  return tmp;
1142  }
1143 
1144  template<typename T>
1145  inline
1147  {
1148  assert(this->dim1() == rhs.dim1());
1149  assert(this->dim2() == rhs.dim2());
1150  std::transform(this->begin(),this->end(),rhs.begin(),this->begin(),std::plus<typename DenseVector2dField2d::value_type>());
1151  return *this;
1152  }
1153 
1154  template<typename T>
1155  inline
1157  {
1158  assert(this->dim1() == rhs.dim1());
1159  assert(this->dim2() == rhs.dim2());
1160  std::transform(this->begin(),this->end(),rhs.begin(),this->begin(),std::minus<typename DenseVector2dField2d::value_type>());
1161  return *this;
1162  }
1163 
1164  template<typename T>
1165  inline
1167  {
1168  assert(this->dim1() == rhs.dim1());
1169  assert(this->dim2() == rhs.dim2());
1170  std::transform(this->begin(),this->end(),rhs.begin(),this->begin(),std::multiplies<typename DenseVector2dField2d::value_type>());
1171  return *this;
1172  }
1173 
1174  template<typename T>
1175  inline
1177  {
1178  assert(this->dim1() == rhs.dim1());
1179  assert(this->dim2() == rhs.dim2());
1180  std::transform(this->begin(),this->end(),rhs.begin(),this->begin(),std::divides<typename DenseVector2dField2d::value_type>());
1181  return *this;
1182  }
1183 
1184 
1185  template<typename T>
1186  inline
1187  std::string
1188  DenseVector2dField2d<T>::name() const {return "DenseVector2dField2d";}
1189 
1190 
1191  template<typename T>
1192  inline
1193  void DenseVector2dField2d<T>::write_gnuplot(const std::string& file_path_name)
1194  {
1195  slip::write_gnuplot_vect2d<slip::DenseVector2dField2d<T> >(*this,file_path_name);
1196  }
1197 
1198  template<typename T>
1199  inline
1200  void DenseVector2dField2d<T>::write_tecplot(const std::string& file_path_name,
1201  const std::string& title,
1202  const std::string& zone)
1203  {
1204  slip::write_tecplot_vect2d<slip::DenseVector2dField2d<T> >(*this,
1205  file_path_name,
1206  title,
1207  zone);
1208  }
1209  template<typename T>
1210  inline
1211  void DenseVector2dField2d<T>::read_gnuplot(const std::string& file_path_name)
1212  {
1213  slip::read_gnuplot_vect2d<slip::DenseVector2dField2d<T> >(file_path_name,*this);
1214  }
1215 
1216  template<typename T>
1217  inline
1218  void DenseVector2dField2d<T>::read_tecplot(const std::string& file_path_name)
1219 
1220  {
1221  slip::read_tecplot_vect2d<slip::DenseVector2dField2d<T> >(file_path_name,*this);
1222  }
1223 
1225  /* @{ */
1226  template<typename T>
1227  inline
1229  const T& val)
1230  {
1231  DenseVector2dField2d<T> tmp = M1;
1232  tmp += val;
1233  return tmp;
1234  }
1235 
1236  template<typename T>
1237  inline
1239  const DenseVector2dField2d<T>& M1)
1240  {
1241  return M1 + val;
1242  }
1243 
1244  template<typename T>
1245  inline
1247  const T& val)
1248  {
1249  DenseVector2dField2d<T> tmp = M1;
1250  tmp -= val;
1251  return tmp;
1252  }
1253 
1254  template<typename T>
1255  inline
1257  const DenseVector2dField2d<T>& M1)
1258  {
1259  return -(M1 - val);
1260  }
1261 
1262 
1263  template<typename T>
1264  inline
1266  const T& val)
1267  {
1268  DenseVector2dField2d<T> tmp = M1;
1269  tmp *= val;
1270  return tmp;
1271  }
1272 
1273  template<typename T>
1274  inline
1276  const DenseVector2dField2d<T>& M1)
1277  {
1278  return M1 * val;
1279  }
1280 
1281 
1282  template<typename T>
1283  inline
1285  const T& val)
1286  {
1287  DenseVector2dField2d<T> tmp = M1;
1288  tmp /= val;
1289  return tmp;
1290  }
1291 
1292  template<typename T>
1293  inline
1295  const DenseVector2dField2d<T>& M2)
1296  {
1297  assert(M1.dim1() == M2.dim1());
1298  assert(M1.dim2() == M2.dim2());
1299  DenseVector2dField2d<T> tmp(M1.dim1(),M1.dim2());
1300  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::plus<slip::Vector2d<T> >());
1301  return tmp;
1302  }
1303 
1304 
1305  template<typename T>
1306  inline
1308  const slip::Vector2d<T>&val)
1309  {
1310  DenseVector2dField2d<T> tmp = M1;
1311  tmp += val;
1312  return tmp;
1313  }
1314 
1315  template<typename T>
1316  inline
1318  const DenseVector2dField2d<T>& M1)
1319  {
1320  return M1 + val;
1321  }
1322 
1323 
1324 
1325  template<typename T>
1326  inline
1328  const DenseVector2dField2d<T>& M2)
1329  {
1330  assert(M1.dim1() == M2.dim1());
1331  assert(M1.dim2() == M2.dim2());
1332  DenseVector2dField2d<T> tmp(M1.dim1(),M1.dim2());
1333  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::minus<slip::Vector2d<T> >());
1334  return tmp;
1335  }
1336 
1337 
1338  template<typename T>
1339  inline
1341  const slip::Vector2d<T>&val)
1342  {
1343  DenseVector2dField2d<T> tmp = M1;
1344  tmp -= val;
1345  return tmp;
1346  }
1347 
1348  template<typename T>
1349  inline
1351  const DenseVector2dField2d<T>& M1)
1352  {
1353  return -(M1 - val);
1354  }
1355 
1356 
1357  template<typename T>
1358  inline
1360  const DenseVector2dField2d<T>& M2)
1361  {
1362  assert(M1.dim1() == M2.dim1());
1363  assert(M1.dim2() == M2.dim2());
1364  DenseVector2dField2d<T> tmp(M1.dim1(),M1.dim2());
1365  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::multiplies<slip::Vector2d<T> >());
1366  return tmp;
1367  }
1368 
1369 
1370  template<typename T>
1371  inline
1373  const slip::Vector2d<T>&val)
1374  {
1375  DenseVector2dField2d<T> tmp = M1;
1376  tmp *= val;
1377  return tmp;
1378  }
1379 
1380  template<typename T>
1381  inline
1383  const DenseVector2dField2d<T>& M1)
1384  {
1385  return M1 * val;
1386  }
1387 
1388 
1389  template<typename T>
1390  inline
1392  const DenseVector2dField2d<T>& M2)
1393  {
1394  assert(M1.dim1() == M2.dim1());
1395  assert(M1.dim2() == M2.dim2());
1396  DenseVector2dField2d<T> tmp(M1.dim1(),M1.dim2());
1397  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::divides<slip::Vector2d<T> >());
1398  return tmp;
1399  }
1400 
1401 
1402  template<typename T>
1403  inline
1405  const slip::Vector2d<T>&val)
1406  {
1407  DenseVector2dField2d<T> tmp = M1;
1408  tmp /= val;
1409  return tmp;
1410  }
1411 
1412 /* @} */
1413 
1414 }//slip::
1415 
1416 #endif //SLIP_DENSEVECTOR2DFIELD2D_HPP
DenseVector2dField2d(const size_type height, const size_type width, const T *val)
Constructs a DenseVector2dField2d initialized by an array val.
void minus(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the difference of two ranges.
void write_gnuplot(const std::string &file_path_name)
Writes a DenseVector2dField2d to a gnuplot file path name.
void read_tecplot(const std::string &file_path_name)
Reads a DenseVector2dField2d from a tecplot file path name.
GenericMultiComponent2d< slip::Vector2d< T > > base
iterator begin()
Returns a read/write iterator that points to the first element in the GenericMultiComponent2d. Iteration is done in ordinary element order.
DenseVector2dField2d(const self &rhs)
Constructs a copy of the DenseVector2dField2d rhs.
const vector2d_value_type * const_vector2d_pointer
DenseVector2dField2d(const size_type height, const size_type width)
Constructs a DenseVector2dField2d.
This is a GenericMultiComponent2d class. This container statisfies the BidirectionnalContainer concep...
slip::GenericMultiComponent2d< slip::Vector2d< T > >::iterator2d iterator2d
This is a Dense Vector2d Field. This container statisfies the BidirectionnalContainer concepts of the...
slip::DenseVector2dField2d< float > DenseVector2dField2d_f
float alias
norm_type angle(const size_type i, const size_type j) const
Subscript access to a local angle contained in the DenseVector2dField2d. The result is a radian betwe...
norm_type Euclidean_norm() const
Returns the Euclidean norm of the elements of the kvector.
Definition: KVector.hpp:832
Provides a class to manipulate multicomponent 2d containers.
Color< T > operator+(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:602
Provides a class to manipulate iterator2d within a slip::Box2d. It is used to iterate throw 2d contai...
slip::DenseVector2dField2d< short > DenseVector2dField2d_s
short alias
void divides(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the pointwise division of two ranges.
size_type dim2() const
Returns the number of columns (second dimension size) in the GenericMultiComponent2d.
slip::kstride_iterator< vector2d_pointer, 2 > vector2d_iterator
slip::GenericMultiComponent2d< slip::Vector2d< T > >::const_iterator2d const_iterator2d
slip::DenseVector2dField2d< unsigned short > DenseVector2dField2d_us
unsigned long alias
Provides some derivative algorithms and derivative functors.
T & Vx1(const size_type i, const size_type j)
Subscript access to first element of the data contained in the DenseVector2dField2d.
~DenseVector2dField2d()
Destructor of the DenseVector2dField2d.
self & operator=(const slip::Vector2d< T > &val)
Affects all the element of the DenseVector2dField2d by val.
Provides a class to iterate a 1d range according to a constant step.
slip::DenseVector2dField2d< unsigned long > DenseVector2dField2d_ul
unsigned long alias
Provides a class to manipulate 2d Vector.
slip::stride_iterator< const_pointer > const_col_iterator
slip::DenseVector2dField2d< unsigned int > DenseVector2dField2d_ui
unsigned int alias
T & u(const size_type i, const size_type j)
Subscript access to first element of the data contained in the DenseVector2dField2d.
size_type height() const
Returns the height (first dimension size) in the GenericMultiComponent2d.
slip::DenseVector2dField2d< char > DenseVector2dField2d_c
char alias
std::reverse_iterator< col_iterator > reverse_col_iterator
size_type dim1() const
Returns the number of rows (first dimension size) in the GenericMultiComponent2d. ...
This is some iterator to iterate a 2d container into a Box area defined by the indices of the 2d cont...
Definition: Array2d.hpp:122
const DenseVector2dField2d< T > const_self
iterator begin()
Returns a read/write iterator that points to the first element in the kvector. Iteration is done in o...
Definition: KVector.hpp:196
std::reverse_iterator< const_iterator > const_reverse_row_iterator
std::reverse_iterator< const_col_iterator > const_reverse_col_iterator
T & Vx2(const size_type i, const size_type j)
Subscript access to second element of the data contained in the DenseVector2dField2d.
vector2d_value_type & vector2d_reference
void write_tecplot(const std::string &file_path_name, const std::string &title, const std::string &zone)
Writes a DenseVector2dField2d to a tecplot file path name.
std::string name() const
Returns the name of the class.
void plus(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the addition of two ranges.
void multiplies(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the pointwise product of two ranges.
static const std::size_t DIM
friend class boost::serialization::access
slip::DenseVector2dField2d< unsigned char > DenseVector2dField2d_uc
unsigned char alias
slip::stride_iterator< pointer > col_iterator
void norm(Container2D &result)
Computes Eucliean norm of each element in the field and write it to a Container2D.
std::reverse_iterator< iterator > reverse_row_iterator
void angle(Container2D &result)
Computes angle (radian) of each element with the cartesian axis and write it to a Container2D...
void read_gnuplot(const std::string &file_path_name)
Reads a DenseVector2dField2d from a gnuplot file path name.
DenseVector2dField2d(const size_type height, const size_type width, InputIterator first, InputIterator last)
Contructs a DenseVector2dField2d from a range.
T & v(const size_type i, const size_type j)
Subscript access to second element of the data contained in the DenseVector2dField2d.
slip::DenseVector2dField2d< double > DenseVector2dField2d_d
double alias
slip::lin_alg_traits< value_type >::value_type norm_type
This is some iterator to iterate a 2d container into a slip::Box2d area defined by the indices of the...
Definition: Array2d.hpp:116
const vector2d_value_type const_vector2d_reference
slip::kstride_iterator< const_vector2d_pointer, 2 > const_vector2d_iterator
Provides some input/ouput algorithms.
void fill(const slip::Vector2d< T > &value)
Fills the container range [begin(),begin()+size()) with copies of value.
DenseVector2dField2d(const size_type height, const size_type width, const slip::Vector2d< T > *val)
Constructs a DenseVector2dField2d initialized by an array val.
Provides some algorithms to computes arithmetical operations on ranges.
self & operator+=(const T &val)
Add val to each element of the DenseVector2dField2d.
iterator end()
Returns a read/write iterator that points one past the last element in the GenericMultiComponent2d. Iteration is done in ordinary element order.
This is a Vector2d struct. It is a specialization of kvector. It implements some peculiar 2d operatio...
Definition: Vector2d.hpp:99
norm_type norm(const size_type i, const size_type j) const
Subscript access to a local norm contained in the DenseVector2dField2d.
DenseVector2dField2d()
Constructs a DenseVector2dField2d.
DenseVector2dField2d(const size_type height, const size_type width, InputIterator first1, InputIterator last1, InputIterator first2)
Contructs a DenseVector2dField2d from a 2 ranges.
std::reverse_iterator< const_iterator > const_reverse_iterator
size_type width() const
Returns the number of columns (second dimension size) in the GenericMultiComponent2d.
vector2d_value_type * vector2d_pointer
Provides a class to manipulate Numerical Matrix.
Provides some algorithms to apply C like functions to ranges.
Provides a class to iterate a 1d range according to a step.
slip::DenseVector2dField2d< long > DenseVector2dField2d_l
long alias
std::reverse_iterator< iterator > reverse_iterator
Color< T > operator*(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:658
Provides a class to manipulate iterator2d within a slip::Range. It is used to iterate throw 2d contai...
Color< T > operator/(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:686
Color< T > operator-(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:630
slip::DenseVector2dField2d< int > DenseVector2dField2d_i
int alias
DenseVector2dField2d(const size_type height, const size_type width, const slip::Vector2d< T > &val)
Constructs a DenseVector2dField2d initialized by the scalar value val.