Flow123d  intersections_paper-476-gbe68821
field_values.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file field_values.hh
15  * @brief
16  */
17 
18 #ifndef FIELD_VALUES_HH_
19 #define FIELD_VALUES_HH_
20 
21 #include <armadillo>
22 #include <boost/format.hpp>
23 #include <system/exceptions.hh>
24 #include "input/input_type.hh"
25 #include "input/accessors.hh"
26 #include <ostream>
27 #include <cmath>
28 
29 namespace IT=Input::Type;
30 
31 /**
32  * @file
33  *
34  * This file contains various dispatch classes to simplify implementation of Fields. Essential is class template
35  * @p FieldValues_ which provides unified access and initialization to scalar, vector and matrix type object in Armadillo library
36  */
37 
38 TYPEDEF_ERR_INFO( EI_InputMsg, const string );
39 DECLARE_INPUT_EXCEPTION( ExcFV_Input, << "Wrong field value input: " << EI_InputMsg::val );
40 
41 typedef unsigned int FieldEnum;
42 
43 
44 
45 namespace internal {
46 
47 // Helper functions to get scalar type name
48 /*
49 std::string type_name_(double);
50 std::string type_name_(int);
51 std::string type_name_(FieldEnum);
52 */
53 
54 /**
55  * InputType dispatch from elementary type @p ET of FieldValues_ to elementary Input::Type, i.e. descendant of Input::Type::Scalar.
56  */
57 template <class ET>
58 struct InputType { typedef Input::Type::Double type; };
59 
60 template <>
61 struct InputType<int> { typedef Input::Type::Integer type; };
62 
63 template <>
65 
66 
67 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
68 // resolution of Value::return_type
69 
70 // general element type
71 template<int NRows, int NCols, class ET>
72 struct ReturnType { typedef typename arma::Mat<ET>::template fixed<NRows, NCols> return_type; };
73 
74 template<class ET>
75 struct ReturnType<1,1,ET> { typedef ET return_type; };
76 
77 template <class ET>
78 struct ReturnType<0,1,ET> { typedef arma::Col<ET> return_type; };
79 
80 template <int NRows, class ET>
81 struct ReturnType<NRows,1,ET> { typedef typename arma::Col<ET>::template fixed<NRows> return_type; };
82 
83 
84 // FiledEnum element type - this just returns types with ET=unsigned int, however input should be different
85 template<int NRows, int NCols>
86 struct ReturnType<NRows, NCols, FieldEnum> { typedef typename arma::Mat<unsigned int>::template fixed<NRows, NCols> return_type; };
87 
88 template<>
89 struct ReturnType<1,1, FieldEnum> { typedef unsigned int return_type; };
90 
91 template <>
92 struct ReturnType<0,1, FieldEnum> { typedef arma::Col<unsigned int> return_type; };
93 
94 template <int NRows>
95 struct ReturnType<NRows,1, FieldEnum> { typedef typename arma::Col<unsigned int>::template fixed<NRows> return_type; };
96 
97 
98 // Resolution of helper functions for raw constructor
99 template <class RT> inline RT & set_raw_scalar(RT &val, double *raw_data) { return *raw_data;}
100 template <class RT> inline RT & set_raw_scalar(RT &val, int *raw_data) { return *raw_data;}
101 template <class RT> inline RT & set_raw_scalar(RT &val, FieldEnum *raw_data) { return *raw_data;}
102 
103 template <class RT> inline RT & set_raw_vec(RT &val, double *raw_data) { arma::access::rw(val.mem) = raw_data; return val;}
104 template <class RT> inline RT & set_raw_vec(RT &val, int *raw_data) { arma::access::rw(val.mem) = raw_data; return val;}
105 template <class RT> inline RT & set_raw_vec(RT &val, FieldEnum *raw_data) { arma::access::rw(val.mem) = raw_data; return val;}
106 
107 template <class RT> inline RT & set_raw_fix(RT &val, double *raw_data) { val = RT(raw_data); return val;}
108 template <class RT> inline RT & set_raw_fix(RT &val, int *raw_data) { val = RT(raw_data); return val;}
109 template <class RT> inline RT & set_raw_fix(RT &val, FieldEnum *raw_data) { val = RT(raw_data); return val;}
110 
111 
112 
113 // Resolution of input accessor for vector values of enums,
114 template <class ET>
115 struct AccessTypeDispatch { typedef ET type;};
116 template <>
117 struct AccessTypeDispatch<unsigned int> { typedef Input::Enum type; };
118 
119 
120 
121 
122 /**
123  * Initialize an Armadillo matrix from the input.
124  * Since only limited methods are used we can use this template to initialize StringTensor as well.
125  * Used methodas are: at(row,col), zeros()
126  */
127 template<class MatrixType>
128 void init_matrix_from_input( MatrixType &value, Input::Array rec ) {
129  typedef typename MatrixType::elem_type ET;
130  unsigned int nrows = value.n_rows;
131  unsigned int ncols = value.n_cols;
132 
134  if (it->size() == 1 && nrows == ncols) {
135  // square tensor
136  // input = 3 expands to [ [ 3 ] ]; init to 3 * (identity matrix)
137  // input = [1, 2, 3] expands to [[1], [2], [3]]; init to diag. matrix
138  // input = [1, 2, 3, .. , (N+1)*N/2], .... ; init to symmetric matrix [ [1 ,2 ,3], [2, 4, 5], [ 3, 5, 6] ]
139  if (rec.size() == 1) {// scalar times identity
140  value.zeros();
141  ET scalar=*(it->begin<ET>());
142  for(unsigned int i=0; i< nrows; i++) value.at(i,i)=scalar;
143  } else if (rec.size() == nrows) { // diagonal vector
144  value.zeros();
145  for(unsigned int i=0; i< nrows; i++, ++it) value.at(i,i)=*(it->begin<ET>());
146  } else if (rec.size() == (nrows+1)*nrows/2) { // symmetric part
147  for( unsigned int row=0; row<nrows; row++)
148  for( unsigned int col=0; col<ncols; col++)
149  if (row <= col) {
150  value.at(row,col) = *(it->begin<ET>());
151  ++it;
152  } else value.at(row,col) = value.at(col,row);
153  } else {
154  THROW( ExcFV_Input()
155  << EI_InputMsg(
156  boost::str(boost::format("Initializing symmetric matrix %dx%d by vector of wrong size %d, should be 1, %d, or %d.")
157  % nrows % ncols % rec.size() % nrows % ((nrows+1)*nrows/2)))
158  << rec.ei_address()
159 
160  );
161  }
162 
163  } else {
164  // accept only full tensor
165  if (rec.size() == nrows && it->size() == ncols) {
166 
167  for (unsigned int row = 0; row < nrows; row++, ++it) {
168  if (it->size() != ncols)
169  THROW( ExcFV_Input() << EI_InputMsg("Wrong number of columns.")
170  << rec.ei_address());
171  Input::Iterator<ET> col_it = it->begin<ET>();
172  for (unsigned int col = 0; col < ncols; col++, ++col_it)
173  value.at(row, col) = *col_it;
174  }
175  } else {
176  THROW( ExcFV_Input()
177  << EI_InputMsg(
178  boost::str(boost::format("Initializing matrix %dx%d by matrix of wrong size %dx%d.")
179  % nrows % ncols % rec.size() % it->size() ))
180  << rec.ei_address()
181  );
182  }
183  }
184 }
185 
186 /**
187  * Initialize an Armadillo vector from the input.
188  * Since only limited methods are used we can use this template to initialize StringTensor as well.
189  * Used methodas are: at(row,col), zeros()
190  */
191 template<class VectorType>
192 void init_vector_from_input( VectorType &value, Input::Array rec ) {
193  typedef typename VectorType::elem_type ET;
194  unsigned int nrows = value.n_rows;
195 
196  typedef typename AccessTypeDispatch<ET>::type InnerType;
197  Input::Iterator<InnerType> it = rec.begin<InnerType>();
198 
199  if ( rec.size() == 1 ) {
200  for(unsigned int i=0; i< nrows; i++)
201  value.at(i)=ET(*it);
202  } else if ( rec.size() == nrows ) {
203  for(unsigned int i=0; i< nrows; i++, ++it) {
204  value.at(i)=ET(*it);
205  }
206  } else {
207  THROW( ExcFV_Input()
208  << EI_InputMsg(
209  boost::str(boost::format("Initializing vector of size %d by vector of size %d.")
210  % nrows % rec.size() ))
211  << rec.ei_address()
212  );
213  }
214 }
215 
216 
217 
218 } // namespace internal
219 
220 
221 
222 /**
223  * Template for class representing all possible Filed values. It is just common interface to
224  * scalar (double, int) values, vector and tensor values with fixed size and vector/tensor values with variable size.
225  *
226  * ET is type of elements, n_cols and n_rows gives fixed dimensions of the tensor value (nx1 is vector, 1x1 is scalar,
227  * 0x1 is variable size vector, 0x0 is variable size tensor (not implemented yet) )
228  *
229  *
230  */
231 template <int NRows, int NCols, class ET>
232 class FieldValue_ {
233 public:
234  typedef ET element_type;
238  const static int NRows_ = NRows;
239  const static int NCols_ = NCols;
240  const static int rank_ = 2;
241 
242  static std::string type_name() { return boost::str(boost::format("R[%d,%d]") % NRows % NCols); }
244  if (NRows == NCols) {
245  // for square tensors allow initialization by diagonal vector, etc.
246  return IT::Array( IT::Array( IT::Parameter("element_input_type"), 1), 1 );
247  }
248  else {
249  return IT::Array( IT::Array( IT::Parameter("element_input_type"), NCols, NCols), NRows, NRows );
250  }
251 
252  }
253  static constexpr bool is_scalable() {
255  }
256 
257 
258  inline FieldValue_(return_type &val) : value_(val) {}
259  inline static const return_type &from_raw(return_type &val, ET *raw_data) {return internal::set_raw_fix(val, raw_data);}
260  const ET * mem_ptr() { return value_.memptr(); }
261 
262  void init_from_input( AccessType rec ) {
264  }
265 
266  void set_n_comp(unsigned int) {};
267  inline unsigned int n_cols() const
268  { return NCols; }
269  inline unsigned int n_rows() const
270  { return NRows; }
271  inline ET &operator() ( unsigned int i, unsigned int j)
272  { return value_.at(i,j); }
273  inline ET operator() ( unsigned int i, unsigned int j) const
274  { return value_.at(i,j); }
275  inline operator return_type() const
276  { return value_;}
277 
278  // Set value to matrix of zeros.
279  void zeros() {
280  value_.zeros();
281  }
282  // Set value to identity matrix.
283  void eye() {
284  value_.eye();
285  }
286  // Set value to matrix of ones.
287  void ones() {
288  value_.ones();
289  }
290  // Elementwise equivalence.
291  bool equal_to(const return_type &other) {
292  return arma::max(arma::max(arma::abs(value_ - other))) < 4*std::numeric_limits<ET>::epsilon();
293  }
294  // Multiplied value_ by double coefficient
295  void scale(double scale_coef) {
296  if (is_scalable())
297  for( unsigned int row=0; row<n_rows(); row++)
298  for( unsigned int col=0; col<n_cols(); col++)
299  value_.at(row,col) = scale_coef * value_.at(row,col);
300  }
301 
302 private:
303  return_type &value_;
304 };
305 
306 
307 
308 
309 
310 /// **********************************************************************
311 /// Specialization for scalars
312 template <class ET>
313 class FieldValue_<1,1,ET> {
314 public:
315  typedef ET element_type;
319  const static int NRows_ = 1;
320  const static int NCols_ = 1;
321  const static int rank_ = 0;
322 
323  static std::string type_name() { return "R"; }
325  {
326  return IT::Parameter("element_input_type");
327  }
328  static constexpr bool is_scalable() {
330  }
331 
332  inline FieldValue_(return_type &val) : value_(val) {}
333 
334  /**
335  * Returns reference to the return_type (i.e. double, or arma::vec or arma::mat); with data provided by the parameter @p raw_data.
336  * A reference to a work space @p val has to be provided for efficient work with vector and matrix values.
337  */
338  inline static const return_type &from_raw(return_type &val, ET *raw_data) {return internal::set_raw_scalar(val, raw_data);}
339  const ET * mem_ptr() { return &(value_); }
340 
341  void init_from_input( AccessType val ) { value_ = return_type(val); }
342 
343  void set_n_comp(unsigned int) {};
344  inline unsigned int n_cols() const
345  { return 1; }
346  inline unsigned int n_rows() const
347  { return 1; }
348  inline ET &operator() ( unsigned int, unsigned int )
349  { return value_; }
350  inline ET operator() ( unsigned int i, unsigned int j) const
351  { return value_; }
352  inline operator return_type() const
353  { return value_;}
354 
355  // Set value to matrix of zeros.
356  void zeros() {
357  value_=0;
358  }
359  // Set value to identity matrix.
360  void eye() {
361  value_=1;
362  }
363  // Set value to matrix of ones.
364  void ones() {
365  value_=1;
366  }
367  bool equal_to(const return_type &other) {
368  return std::abs(value_ - other) < 4*std::numeric_limits<ET>::epsilon();
369  }
370  // Multiplied value_ by double coefficient
371  void scale(double scale_coef) {
372  if (is_scalable())
373  value_ = scale_coef * value_;
374  }
375 
376 private:
377  return_type &value_;
378 };
379 
380 
381 
382 
383 /// **********************************************************************
384 /// Specialization for variable size vectors
385 template <class ET>
386 class FieldValue_<0,1,ET> {
387 public:
388  typedef ET element_type;
392  const static int NRows_ = 0;
393  const static int NCols_ = 1;
394  const static int rank_ = 10;
395 
396 
397  static std::string type_name() { return "R[n]"; }
399  return IT::Array( IT::Parameter("element_input_type"), 1);
400  }
401  static constexpr bool is_scalable() {
403  }
404  inline static const return_type &from_raw(return_type &val, ET *raw_data) {return internal::set_raw_vec(val, raw_data);}
405  const ET * mem_ptr() { return value_.memptr(); }
406 
407  inline FieldValue_(return_type &val) : value_(val) {}
408 
409 
410  void init_from_input( AccessType rec ) {
412  }
413 
414  void set_n_comp(unsigned int n_comp) { value_ = return_type(n_comp,1); };
415  inline unsigned int n_cols() const
416  { return 1; }
417  inline unsigned int n_rows() const
418  { return value_.n_rows; }
419  inline ET &operator() ( unsigned int i, unsigned int )
420  { return value_.at(i); }
421  inline ET operator() ( unsigned int i, unsigned int j) const
422  { return value_.at(i); }
423 
424  inline operator return_type() const
425  { return value_;}
426 
427  // Set value to matrix of zeros.
428  void zeros() {
429  value_.zeros();
430  }
431  // Set value to identity matrix.
432  void eye() {
433  value_.ones();
434  }
435  // Set value to matrix of ones.
436  void ones() {
437  value_.ones();
438  }
439  // Elementwise equivalence.
440  bool equal_to(const return_type &other) {
441  return arma::max(arma::abs(value_ - other)) < 4*std::numeric_limits<ET>::epsilon();
442  }
443  // Multiplied value_ by double coefficient
444  void scale(double scale_coef) {
445  if (is_scalable())
446  for(unsigned int i=0; i< n_rows(); i++) {
447  value_.at(i) = scale_coef * value_.at(i);
448  }
449  }
450 
451 
452 private:
453  return_type &value_;
454 };
455 
456 /// **********************************************************************
457 /// Specialization for fixed size vectors
458 template <int NRows, class ET>
459 class FieldValue_<NRows,1,ET> {
460 public:
461  typedef ET element_type;
465  const static int NRows_ = NRows;
466  const static int NCols_ = 1;
467  const static int rank_ = 1;
468 
469 
470  static std::string type_name() { return boost::str(boost::format("R[%d]") % NRows ); }
472  return IT::Array( IT::Parameter("element_input_type"), 1, NRows);
473  }
474  static constexpr bool is_scalable() {
476  }
477 
478  inline FieldValue_(return_type &val) : value_(val) {}
479  inline static const return_type &from_raw(return_type &val, ET *raw_data) {return internal::set_raw_fix(val, raw_data);}
480  const ET * mem_ptr() { return value_.memptr(); }
481 
482  void init_from_input( AccessType rec ) {
484  }
485 
486  void set_n_comp(unsigned int) {};
487  inline unsigned int n_cols() const
488  { return 1; }
489  inline unsigned int n_rows() const
490  { return NRows; }
491  inline ET &operator() ( unsigned int i, unsigned int )
492  { return value_.at(i); }
493  inline ET operator() ( unsigned int i, unsigned int j) const
494  { return value_.at(i); }
495 
496  inline operator return_type() const
497  { return value_;}
498 
499  // Set value to matrix of zeros.
500  void zeros() {
501  value_.zeros();
502  }
503  // Set value to identity matrix.
504  void eye() {
505  value_.ones();
506  }
507  // Set value to matrix of ones.
508  void ones() {
509  value_.ones();
510  }
511  // Elementwise equivalence.
512  bool equal_to(const return_type &other) {
513  return arma::max(arma::abs(value_ - other)) < 4*std::numeric_limits<ET>::epsilon();
514  }
515  // Multiplied value_ by double coefficient
516  void scale(double scale_coef) {
517  if (is_scalable())
518  for(unsigned int i=0; i< n_rows(); i++) {
519  value_.at(i) = scale_coef * value_.at(i);
520  }
521  }
522 
523 private:
524  return_type &value_;
525 };
526 
527 
528 
529 //****************************************************************************
530 // string tensor (for FieldFormula)
531 
532 
533 /**
534  * Mimics arma::mat<std::string>. Used in FieldFormula
535  */
537 public:
538  typedef std::string elem_type;
539 
540  StringTensor( unsigned int n_rows, unsigned int n_cols )
541  : n_rows(n_rows),n_cols(n_cols), values_(n_rows*n_cols) {}
542 
543  std::string & at(unsigned int row) { return at(row,0); }
544  std::string & at(unsigned int row, unsigned int col) { return values_[col*n_rows+row]; }
545 
546  void zeros() {
547  for( auto &elem: values_) elem = "0.0";
548  }
549  unsigned int n_rows;
550  unsigned int n_cols;
551 private:
553 
554 };
555 
556 
557 template<int NRows, int NCols>
559 {
562  if (NRows == NCols) {
563  // for square tensors allow initialization by diagonal vector, etc.
564  return IT::Array( IT::Array( IT::String(), 1), 1 );
565  }
566  else {
567  return IT::Array( IT::Array( IT::String(), NCols, NCols), NRows, NRows );
568  }
569 
570  }
571 
572  static void init_from_input(StringTensor &tensor, AccessType input) {
573  internal::init_matrix_from_input(tensor, input);
574  }
575 };
576 
577 template<>
578 struct StringTensorInput<1,1> {
579  typedef std::string AccessType;
580  static IT::String get_input_type() { return IT::String(); }
581  static void init_from_input(StringTensor &tensor, AccessType input) {
582  tensor.at(0,0) = input;
583  }
584 };
585 
586 template<int Nrows>
587 struct StringTensorInput<Nrows,1> {
590  return IT::Array( IT::String(), 1);
591  }
592  static void init_from_input(StringTensor &tensor, AccessType input) {
593  internal::init_vector_from_input(tensor, input);
594  }
595 };
596 
597 
598 
599 
600 /**
601  * Class that provides common template-less interface to all templated Field structes.
602  *
603  * Maybe we can delete this since common interface will be given by "Quantity".
604  */
605 
606 template <int spacedim>
607 struct FieldValue {
608  // typedefs for possible field values
617 };
618 
619 
620 
621 
622 
623 
624 
625 
626 
627 
628 #endif /* FIELD_VALUES_HH_ */
void init_from_input(AccessType val)
internal::ReturnType< 1, 1, ET >::return_type return_type
Iterator< ValueType > begin() const
internal::InputType< ET >::type ElementInputType
Accessor to input data conforming to declared Array.
Definition: accessors.hh:561
static const return_type & from_raw(return_type &val, ET *raw_data)
static IT::Array get_input_type()
EI_Address ei_address() const
Definition: accessors.cc:314
void set_n_comp(unsigned int)
arma::Col< unsigned int > return_type
Definition: field_values.hh:92
std::vector< std::string > values_
static void init_from_input(StringTensor &tensor, AccessType input)
internal::InputType< ET >::type ElementInputType
static void init_from_input(StringTensor &tensor, AccessType input)
bool equal_to(const return_type &other)
FieldValue_< 0, 1, int > IntVector
static const return_type & from_raw(return_type &val, ET *raw_data)
void set_n_comp(unsigned int n_comp)
std::string format(CStringRef format_str, ArgList args)
Definition: format.h:3141
void set_n_comp(unsigned int)
void init_from_input(AccessType rec)
void scale(double scale_coef)
Class for representing parametric types in IST.
Definition: type_generic.hh:52
static std::string type_name()
RT & set_raw_vec(RT &val, double *raw_data)
void set_n_comp(unsigned int)
unsigned int n_cols() const
const ET * mem_ptr()
internal::ReturnType< NRows, NCols, ET >::return_type return_type
FieldValue_(return_type &val)
void init_from_input(AccessType rec)
Input::Type::Selection type
Definition: field_values.hh:64
FieldValue_< 1, 1, FieldEnum > Enum
Class for declaration of the integral input data.
Definition: type_base.hh:483
void init_matrix_from_input(MatrixType &value, Input::Array rec)
void init_from_input(AccessType rec)
Class for declaration of inputs sequences.
Definition: type_base.hh:339
static constexpr bool value
Definition: json.hpp:87
arma::Col< unsigned int >::template fixed< NRows > return_type
Definition: field_values.hh:95
StringTensor(unsigned int n_rows, unsigned int n_cols)
internal::InputType< ET >::type ElementInputType
static IT::Array get_input_type()
Class for declaration of the input data that are floating point numbers.
Definition: type_base.hh:534
static std::string type_name()
FieldValue_< 0, 1, FieldEnum > EnumVector
std::string elem_type
unsigned int FieldEnum
Definition: field_values.hh:41
static constexpr bool is_scalable()
unsigned int n_rows
internal::InputType< ET >::type ElementInputType
internal::ReturnType< NRows, 1, ET >::return_type return_type
void scale(double scale_coef)
bool equal_to(const return_type &other)
static constexpr bool is_scalable()
return_type & value_
std::string & at(unsigned int row, unsigned int col)
FieldValue_< spacedim, 1, double > VectorFixed
bool equal_to(const return_type &other)
static IT::Array get_input_type()
void init_vector_from_input(VectorType &value, Input::Array rec)
static std::string type_name()
unsigned int n_rows() const
RT & set_raw_fix(RT &val, double *raw_data)
arma::Mat< ET >::template fixed< NRows, NCols > return_type
Definition: field_values.hh:72
static void init_from_input(StringTensor &tensor, AccessType input)
internal::ReturnType< 0, 1, ET >::return_type return_type
static constexpr bool is_scalable()
TYPEDEF_ERR_INFO(EI_InputMsg, const string)
std::string & at(unsigned int row)
const double epsilon
Definition: mathfce.h:23
unsigned int n_cols() const
static IT::Array get_input_type()
unsigned int n_rows() const
Input::Type::Integer type
Definition: field_values.hh:61
arma::Mat< unsigned int >::template fixed< NRows, NCols > return_type
Definition: field_values.hh:86
unsigned int n_cols() const
void scale(double scale_coef)
Input::Type::Double type
Definition: field_values.hh:58
unsigned int n_cols
FieldValue_< 1, 1, int > Integer
FieldValue_(return_type &val)
FieldValue_< 0, 1, double > Vector
internal::AccessTypeDispatch< ET >::type AccessType
static std::string type_name()
DECLARE_INPUT_EXCEPTION(ExcFV_Input,<< "Wrong field value input: "<< EI_InputMsg::val)
static const return_type & from_raw(return_type &val, ET *raw_data)
FieldValue_(return_type &val)
static IT::Array get_input_type()
void scale(double scale_coef)
unsigned int size() const
Input::Array AccessType
static const return_type & from_raw(return_type &val, ET *raw_data)
FieldValue_< spacedim, spacedim, double > TensorFixed
unsigned int n_rows() const
Input::Array AccessType
unsigned int n_cols() const
arma::Col< ET >::template fixed< NRows > return_type
Definition: field_values.hh:81
RT & set_raw_scalar(RT &val, double *raw_data)
Definition: field_values.hh:99
Class for declaration of the input data that are in string format.
Definition: type_base.hh:582
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Definition: exceptions.hh:45
static IT::Parameter get_input_type()
Template for classes storing finite set of named values.
static IT::String get_input_type()
FieldValue_< 1, 1, double > Scalar
bool equal_to(const return_type &other)
FieldValue_(return_type &val)
unsigned int n_rows() const
static constexpr bool is_scalable()