SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArrayMathInterpreter.h
Go to the documentation of this file.
1 //
2 // For more information, please see: http://software.sci.utah.edu
3 //
4 // The MIT License
5 //
6 // Copyright (c) 2009 Scientific Computing and Imaging Institute,
7 // University of Utah.
8 //
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 // DEALINGS IN THE SOFTWARE.
27 //
28 
29 #ifndef CORE_PARSER_ARRAYMATHPROGRAM_H
30 #define CORE_PARSER_ARRAYMATHPROGRAM_H 1
31 
35 
36 #include <Core/Thread/Parallel.h>
37 #include <Core/Thread/Barrier.h>
38 
40 
41 #include <Core/Parser/Parser.h>
42 
43 #include <boost/function.hpp>
44 #include <boost/variant.hpp>
45 #include <boost/noncopyable.hpp>
46 // Include files needed for Windows
47 #include <Core/Parser/share.h>
48 
49 namespace SCIRun {
50 
51 // Define class as they are not used in order
52 
53 class ArrayMathIntepreter;
54 class ArrayMathFunction;
55 
56 class ArrayMathProgram;
57 class ArrayMathProgramCode;
59 
60 // Handles for a few of the classes
61 // As Program is stored in a large array we do not need a handle for that
62 // one. These are helper classes that are located elsewhere in memory
63 
64 typedef boost::shared_ptr<ArrayMathProgramVariable> ArrayMathProgramVariableHandle;
65 typedef boost::shared_ptr<ArrayMathProgram> ArrayMathProgramHandle;
66 
67 //-----------------------------------------------------------------------------
68 // Functions for databasing the function calls that make up the program
69 
70 // This class is used to describe each function in the system
71 // It describes the name + input arguments, the return type,
72 // additional flags and a pointer the the actual function that
73 // needs to be called
74 
75 typedef boost::function<bool(ArrayMathProgramCode&)> ArrayMathFunctionPtr;
76 
78  public:
79  // Build a new function
81  ArrayMathFunctionPtr function,
82  const std::string& function_id,
83  const std::string& function_type,
84  int function_flags
85  );
86 
87  virtual ~ArrayMathFunction() {}
88 
90  { return (function_); }
91 
92  private:
93  // The function to call that needs to be called on the data
94  ArrayMathFunctionPtr function_;
95 
96 };
97 
98 
99 //-----------------------------------------------------------------------------
100 // Code segment class, all the function calls are based on this class
101 // providing the program with input and output variables all located in one
102 // piece of memory. Although this class points to auxilary memory block,
103 // an effort is made to store them all in the same array, to minimize
104 // page swapping
105 
106  class SCISHARE ArrayMathProgramCode : boost::noncopyable {
107  public:
108 
109  // Constructor
111  function_(function), index_(0), size_(1) {}
112 
114  function_(0), index_(0), size_(1) {}
115 
116  inline void set_function(ArrayMathFunctionPtr function)
117  {
118  function_ = function;
119  }
120 
122  {
123  return (function_);
124  }
125 
126  // Tell the program where the temporary space has been allocated
127  // for this part of the program
128  inline void set_variable(size_t j, double* variable)
129  {
130  if (j >= variables_.size()) variables_.resize(j+1);
131  variables_[j] = variable;
132  }
133 
134  // In case of a mesh, a pointer to the mesh can be stored in the
135  // program code as well
136  inline void set_vmesh(size_t j, VMesh* vmesh)
137  {
138  if (j >= variables_.size()) variables_.resize(j+1);
139  variables_[j] = vmesh;
140  }
141 
142  // In case of a field, a pointer to the field can be stored in the
143  // program code as well
144  inline void set_vfield(size_t j, VField* vfield)
145  {
146  if (j >= variables_.size()) variables_.resize(j+1);
147  variables_[j] = vfield;
148  }
149 
150  // In case of a field, a pointer to a dense/column matrix can be stored in the
151  // program code as well
152  inline void set_matrix(size_t j, Core::Datatypes::MatrixHandle matrix)
153  {
154  if (j >= variables_.size()) variables_.resize(j+1);
155  variables_[j] = matrix;
156  }
157 
158 #ifdef SCIRUN4_CODE_TO_BE_ENABLED_LATER
159  // In general case, set a pointer
160  inline void set_pointer(size_t j, void* pointer)
161  {
162  if (j >= variables_.size()) variables_.resize(j+1);
163  variables_[j] = pointer;
164  }
165 #endif
166 
167  inline void set_bool_array(size_t j, std::vector<bool>* array)
168  {
169  if (j >= variables_.size()) variables_.resize(j+1);
170  variables_[j] = array;
171  }
172 
173  inline void set_int_array(size_t j, std::vector<int>* array)
174  {
175  if (j >= variables_.size()) variables_.resize(j+1);
176  variables_[j] = array;
177  }
178 
179  inline void set_double_array(size_t j, std::vector<double>* array)
180  {
181  if (j >= variables_.size()) variables_.resize(j+1);
182  variables_[j] = array;
183  }
184 
185  // Set the index, we keep this in the list so the program knows which
186  // element we need to process.
187  inline void set_index(index_type index) { index_ = index; }
188 
189  // Set the size of the array that needs to be processed
190  inline void set_size(size_type size) { size_ = size; }
191  inline size_type get_size() const { return(size_); }
192 
193  // These functions are called by the actual code segments
194  // For Scalar, Vector and Tensor buffers
195  inline double* get_variable(size_t j)
196  { return boost::get<double*>(variables_[j]); }
197  // For Mesh buffers
198  inline VMesh* get_vmesh(size_t j)
199  { return boost::get<VMesh*>(variables_[j]); }
200  // For Field buffers
201  inline VField* get_vfield(size_t j)
202  { return boost::get<VField*>(variables_[j]); }
203  // For Matrix buffers
205  { return boost::get<Core::Datatypes::MatrixHandle>(variables_[j]); }
206 
207  inline std::vector<bool>* get_bool_array(size_t j)
208  { return boost::get<std::vector<bool>*>(variables_[j]); }
209  inline std::vector<int>* get_int_array(size_t j)
210  { return boost::get<std::vector<int>*>(variables_[j]); }
211  inline std::vector<double>* get_double_array(size_t j)
212  { return boost::get<std::vector<double>*>(variables_[j]); }
213 
214  // Get the current index
215  inline index_type get_index() const
216  { return (index_); }
217 
218  // Run this code segment
219  // Run time errors are reported by returning a false,
220  // After which we can look in the parser script to see
221  // which function failed
222  inline bool run()
223  { return (function_(*this)); }
224 
225  void print() const;
226 
227  private:
228  // This is the minimal information needed to run the parsed program
229  // In order improve performance, all the buffers and instructions are
230  // grouped together so they fit in a few pages of the memory manager
231 
232  // Function call to evaluate this piece of the code
233  ArrayMathFunctionPtr function_;
234 
235  // Location of where the data is stored
236  typedef boost::variant<
237  double*,
239  VField*,
240  VMesh*,
241  std::vector<bool>*,
242  std::vector<int>*,
243  std::vector<double>*
244  > variable_type;
246 
247  // Index in where we are in the selection
249 
250  // Sequence size
251  size_type size_;
252 };
253 
254  typedef boost::shared_ptr<ArrayMathProgramCode> ArrayMathProgramCodePtr;
255 
256 
257 
259 {
260  public:
261  ArrayMathProgramVariable(const std::string& name, double* data) :
262  name_(name), data_(data) {}
263  double* get_data() const { return (data_); }
264 
265  private:
266  std::string name_;
267  double* data_;
268 };
269 
270  /// @todo replace with boost::variant
272 
273  public:
275  vmesh_(0), vfield_(0), matrix_(0), bool_array_(0), int_array_(0), double_array_(0) {}
276 
277  void set_vmesh(VMesh* vmesh) { vmesh_ = vmesh; }
278  VMesh* get_vmesh() const { return (vmesh_); }
279  bool is_vmesh() const { return (vmesh_ != 0); }
280 
281  void set_vfield(VField* vfield) { vfield_ = vfield; }
282  VField* get_vfield() const { return (vfield_); }
283  bool is_vfield() const { return (vfield_ != 0); }
284 
285  void set_matrix(Core::Datatypes::MatrixHandle matrix) { matrix_ = matrix; }
286  Core::Datatypes::MatrixHandle get_matrix() const { return (matrix_); }
287  bool is_matrix() const { return (matrix_ != 0); }
288 
289  void set_bool_array(std::vector<bool>* array) { bool_array_ = array; }
290  std::vector<bool>* get_bool_array() const { return (bool_array_); }
291  bool is_bool_array() const { return (bool_array_ != 0); }
292 
293  void set_int_array(std::vector<int>* array) { int_array_ = array; }
294  std::vector<int>* get_int_array() const { return (int_array_); }
295  bool is_int_array() const { return (int_array_ != 0); }
296 
297  void set_double_array(std::vector<double>* array) { double_array_ = array; }
298  std::vector<double>* get_double_array() const { return (double_array_); }
299  bool is_double_array() const { return (double_array_ != 0); }
300 
301  private:
302  VMesh* vmesh_;
303  VField* vfield_;
305 
306  std::vector<bool>* bool_array_;
307  std::vector<int>* int_array_;
308  std::vector<double>* double_array_;
309 };
310 
311 
312  class SCISHARE ArrayMathProgram : boost::noncopyable {
313 
314  public:
315  ArrayMathProgram() : num_proc_(Core::Thread::Parallel::NumCores()), barrier_("ArrayMathProgram", num_proc_)
316  {
317  // Buffer size describes how many values of a sequential variable are
318  // grouped together for vectorized execution
319  buffer_size_ = 128;
320  array_size_ = 1;
321  }
322 
323  // Constructor that allows overloading the default optimization parameters
325  size_type buffer_size,int num_proc = -1) :
326  num_proc_(num_proc < 1 ? Core::Thread::Parallel::NumCores() : num_proc),
327  barrier_("ArrayMathProgram", num_proc_)
328  {
329  // Buffer size describes how many values of a sequential variable are
330  // grouped together for vectorized execution
331  buffer_size_ = buffer_size;
332  array_size_ = array_size;
333  }
334 
335  // Get the optimization parameters, these can only be set when creating the
336  // object as it depends on allocated buffer sizes and those are hard to change
337  // when allocated
338  // Get the number of entries that are processed at once
339  size_type get_buffer_size() const { return (buffer_size_); }
340  // Get the number of processors
341  int get_num_proc() const { return (num_proc_); }
342 
343  // Set the size of the array to process
344  size_type get_array_size() const { return (array_size_); }
345  void set_array_size(size_type array_size) { array_size_ = array_size; }
346 
347  bool add_source(const std::string& name, VField* vfield);
348  bool add_source(const std::string& name, VMesh* vmesh);
349  bool add_source(const std::string& name, Core::Datatypes::MatrixHandle matrix);
350  bool add_source(const std::string& name, std::vector<bool>* array);
351  bool add_source(const std::string& name, std::vector<int>* array);
352  bool add_source(const std::string& name, std::vector<double>* array);
353 
354  bool add_sink(const std::string& name, VField* vfield);
355  bool add_sink(const std::string& name, VMesh* vmesh);
356  bool add_sink(const std::string& name, Core::Datatypes::MatrixHandle matrix);
357  bool add_sink(const std::string& name, std::vector<bool>* array);
358  bool add_sink(const std::string& name, std::vector<int>* array);
359  bool add_sink(const std::string& name, std::vector<double>* array);
360 
361  void resize_const_variables(size_t sz)
362  { const_variables_.resize(sz); }
363  void resize_single_variables(size_t sz)
364  { single_variables_.resize(sz); }
366  {
367  sequential_variables_.resize(num_proc_);
368  for (int np=0; np < num_proc_; np++)
369  sequential_variables_[np].resize(sz);
370  }
371 
372  void resize_const_functions(size_t sz)
373  { const_functions_.resize(sz); }
374  void resize_single_functions(size_t sz)
375  { single_functions_.resize(sz); }
377  {
378  sequential_functions_.resize(num_proc_);
379  for (int np=0; np < num_proc_; np++)
380  sequential_functions_[np].resize(sz);
381  }
382 
383  // Central buffer for all parameters
384  double* create_buffer(size_t size)
385  { buffer_.resize(size); return buffer_.empty() ? 0 : (&(buffer_[0])); }
386 
387  // Set variables which we use as temporal information structures
388  /// @todo: need to remove them at some point
390  { const_variables_[j] = handle; }
392  { single_variables_[j] = handle; }
393  void set_sequential_variable(size_t j, size_t np, ArrayMathProgramVariableHandle handle)
394  { sequential_variables_[np][j] = handle; }
395 
397  { return (const_variables_[j]); }
399  { return (single_variables_[j]); }
401  { return (sequential_variables_[np][j]); }
402 
403  // Set program code
405  { const_functions_[j] = pc; }
407  { single_functions_[j] = pc; }
409  { sequential_functions_[np][j] = pc; }
410 
411  // Code to find the pointers that are given for sources and sinks
412  bool find_source(const std::string& name, ArrayMathProgramSource& ps);
413  bool find_sink(const std::string& name, ArrayMathProgramSource& ps);
414 
415  bool run_const(size_t& error_line);
416  bool run_single(size_t& error_line);
417  bool run_sequential(size_t& error_line);
418 
419  void set_parser_program(ParserProgramHandle handle) { pprogram_ = handle; }
420  ParserProgramHandle get_parser_program() { return (pprogram_); }
421 
422  private:
423 
424  // General parameters that determine how many values are computed at
425  // the same time and how many processors to use
426  size_type buffer_size_;
427  int num_proc_;
428 
429  // The size of the array we are using
430  size_type array_size_;
431 
432  // Memory buffer
433  std::vector<double> buffer_;
434 
435  // Source and Sink information
436  std::map<std::string,ArrayMathProgramSource> input_sources_;
437  std::map<std::string,ArrayMathProgramSource> output_sinks_;
438 
439  // Variable lists
440  std::vector<ArrayMathProgramVariableHandle> const_variables_;
441  std::vector<ArrayMathProgramVariableHandle> single_variables_;
442  std::vector<std::vector<ArrayMathProgramVariableHandle> > sequential_variables_;
443 
444  // Program code
445  std::vector<ArrayMathProgramCodePtr> const_functions_;
446  std::vector<ArrayMathProgramCodePtr> single_functions_;
447  std::vector<std::vector<ArrayMathProgramCodePtr> > sequential_functions_;
448 
449  ParserProgramHandle pprogram_;
450 
451  // For parallel code
452  private:
453  void run_parallel(int proc);
454 
455  // Error reporting parallel code
456  std::vector<size_type> error_line_;
457  std::vector<bool> success_;
458 
459  Core::Thread::Barrier barrier_;
460 };
461 
463 
464  public:
465  // The interpreter Creates executable code from the parsed code
466  // The first step is setting the data sources and sinks
467 
468 
469  //------------------------------------------------------------------------
470  // Step 0 : create program variable
471  bool create_program(ArrayMathProgramHandle& mprogram,std::string& error);
472 
473 
474  //------------------------------------------------------------------------
475  // Step 1: add sources and sinks
476 
477  // Field data/node/element sources
478  bool add_fielddata_source(ArrayMathProgramHandle& pprogram,
479  const std::string& name,
480  FieldHandle field,
481  std::string& error);
482  bool add_fieldmesh_source(ArrayMathProgramHandle& pprogram,
483  const std::string& name,
484  FieldHandle field,
485  std::string& error);
486 
487  // Matrix sources
488  bool add_matrix_source(ArrayMathProgramHandle& pprogram,
489  const std::string& name,
491  std::string& error);
492 
493  bool add_bool_array_source(ArrayMathProgramHandle& pprogram,
494  const std::string& name,
495  std::vector<bool>* array,
496  std::string& error);
497 
498  bool add_int_array_source(ArrayMathProgramHandle& pprogram,
499  const std::string& name,
500  std::vector<int>* array,
501  std::string& error);
502 
503  bool add_double_array_source(ArrayMathProgramHandle& pprogram,
504  const std::string& name,
505  std::vector<double>* array,
506  std::string& error);
507 
508 
509  // Field data/node/element sinks
510  bool add_fielddata_sink(ArrayMathProgramHandle& pprogram,
511  const std::string& name,
512  FieldHandle field,
513  std::string& error);
514  bool add_fieldmesh_sink(ArrayMathProgramHandle& pprogram,
515  const std::string& name,
516  FieldHandle field,
517  std::string& error);
518 
519  // Matrix sinks
520  bool add_matrix_sink(ArrayMathProgramHandle& pprogram,
521  const std::string& name,
523  std::string& error);
524 
525  bool add_bool_array_sink(ArrayMathProgramHandle& pprogram,
526  const std::string& name,
527  std::vector<bool>* array,
528  std::string& error);
529 
530  bool add_int_array_sink(ArrayMathProgramHandle& pprogram,
531  const std::string& name,
532  std::vector<int>* array,
533  std::string& error);
534 
535  bool add_double_array_sink(ArrayMathProgramHandle& pprogram,
536  const std::string& name,
537  std::vector<double>* array,
538  std::string& error);
539 
540 
541  //------------------------------------------------------------------------
542  // Step 2: translate code and generate executable code
543 
544  // Main function for transcribing the parser output into a program that
545  // can actually be executed
546  bool translate(ParserProgramHandle& pprogram,
547  ArrayMathProgramHandle& mprogram,
548  std::string& error);
549 
550 
551  //------------------------------------------------------------------------
552  // Step 3: Set the array size
553 
554  bool set_array_size(ArrayMathProgramHandle& mprogram,size_type array_size);
555 
556  //------------------------------------------------------------------------
557  // Step 4: Run the code
558 
559  bool run(ArrayMathProgramHandle& mprogram,std::string& error);
560 
561 };
562 
563 }
564 
565 #endif
ArrayMathProgramVariableHandle get_sequential_variable(size_t j, size_t np) const
Definition: ArrayMathInterpreter.h:400
void set_const_variable(size_t j, ArrayMathProgramVariableHandle handle)
Definition: ArrayMathInterpreter.h:389
void set_function(ArrayMathFunctionPtr function)
Definition: ArrayMathInterpreter.h:116
void resize_sequential_variables(size_t sz)
Definition: ArrayMathInterpreter.h:365
size_type get_size() const
Definition: ArrayMathInterpreter.h:191
boost::shared_ptr< Matrix > MatrixHandle
Definition: MatrixFwd.h:44
ArrayMathFunctionPtr get_function() const
Definition: ArrayMathInterpreter.h:121
ArrayMathProgramVariableHandle get_const_variable(size_t j) const
Definition: ArrayMathInterpreter.h:396
void set_double_array(size_t j, std::vector< double > *array)
Definition: ArrayMathInterpreter.h:179
void set_vfield(size_t j, VField *vfield)
Definition: ArrayMathInterpreter.h:144
void set_sequential_program_code(size_t j, size_t np, ArrayMathProgramCodePtr pc)
Definition: ArrayMathInterpreter.h:408
boost::function< bool(ArrayMathProgramCode &)> ArrayMathFunctionPtr
Definition: ArrayMathInterpreter.h:75
std::vector< double > * get_double_array() const
Definition: ArrayMathInterpreter.h:298
ArrayMathProgramVariableHandle get_single_variable(size_t j) const
Definition: ArrayMathInterpreter.h:398
Definition: Thread.h:67
bool is_bool_array() const
Definition: ArrayMathInterpreter.h:291
std::vector< bool > * get_bool_array(size_t j)
Definition: ArrayMathInterpreter.h:207
void set_parser_program(ParserProgramHandle handle)
Definition: ArrayMathInterpreter.h:419
void set_matrix(size_t j, Core::Datatypes::MatrixHandle matrix)
Definition: ArrayMathInterpreter.h:152
ParserProgramHandle get_parser_program()
Definition: ArrayMathInterpreter.h:420
void resize_const_variables(size_t sz)
Definition: ArrayMathInterpreter.h:361
void set_int_array(std::vector< int > *array)
Definition: ArrayMathInterpreter.h:293
void set_double_array(std::vector< double > *array)
Definition: ArrayMathInterpreter.h:297
bool index_(ArrayMathProgramCode &pc)
Definition: ArrayMathFunctionSourceSink.cc:636
void set_size(size_type size)
Definition: ArrayMathInterpreter.h:190
VField * get_vfield() const
Definition: ArrayMathInterpreter.h:282
void set_variable(size_t j, double *variable)
Definition: ArrayMathInterpreter.h:128
#define SCISHARE
Definition: share.h:39
bool is_vfield() const
Definition: ArrayMathInterpreter.h:283
ArrayMathProgram(size_type array_size, size_type buffer_size, int num_proc=-1)
Definition: ArrayMathInterpreter.h:324
bool is_matrix() const
Definition: ArrayMathInterpreter.h:287
ArrayMathFunctionPtr get_function() const
Definition: ArrayMathInterpreter.h:89
virtual ~ArrayMathFunction()
Definition: ArrayMathInterpreter.h:87
boost::shared_ptr< ArrayMathProgramCode > ArrayMathProgramCodePtr
Definition: ArrayMathInterpreter.h:254
void set_vmesh(size_t j, VMesh *vmesh)
Definition: ArrayMathInterpreter.h:136
std::vector< int > * get_int_array() const
Definition: ArrayMathInterpreter.h:294
ArrayMathProgram()
Definition: ArrayMathInterpreter.h:315
Definition: ArrayMathInterpreter.h:462
Definition: ArrayMathInterpreter.h:271
void set_vmesh(VMesh *vmesh)
Definition: ArrayMathInterpreter.h:277
bool is_int_array() const
Definition: ArrayMathInterpreter.h:295
const char * name[]
Definition: BoostGraphExampleTests.cc:87
boost::shared_ptr< ArrayMathProgram > ArrayMathProgramHandle
Definition: ArrayMathInterpreter.h:65
void set_single_variable(size_t j, ArrayMathProgramVariableHandle handle)
Definition: ArrayMathInterpreter.h:391
long long size_type
Definition: Types.h:40
std::vector< int > * get_int_array(size_t j)
Definition: ArrayMathInterpreter.h:209
void resize_single_functions(size_t sz)
Definition: ArrayMathInterpreter.h:374
ArrayMathProgramVariable(const std::string &name, double *data)
Definition: ArrayMathInterpreter.h:261
Core::Datatypes::MatrixHandle get_matrix() const
Definition: ArrayMathInterpreter.h:286
void set_array_size(size_type array_size)
Definition: ArrayMathInterpreter.h:345
dictionary data
Definition: eabLatVolData.py:11
void set_bool_array(std::vector< bool > *array)
Definition: ArrayMathInterpreter.h:289
void set_const_program_code(size_t j, ArrayMathProgramCodePtr pc)
Definition: ArrayMathInterpreter.h:404
void set_sequential_variable(size_t j, size_t np, ArrayMathProgramVariableHandle handle)
Definition: ArrayMathInterpreter.h:393
bool is_vmesh() const
Definition: ArrayMathInterpreter.h:279
bool run()
Definition: ArrayMathInterpreter.h:222
boost::shared_ptr< ParserProgram > ParserProgramHandle
Definition: Parser.h:70
void resize_single_variables(size_t sz)
Definition: ArrayMathInterpreter.h:363
double * get_variable(size_t j)
Definition: ArrayMathInterpreter.h:195
boost::shared_ptr< ArrayMathProgramVariable > ArrayMathProgramVariableHandle
Definition: ArrayMathInterpreter.h:58
Definition: Barrier.h:42
VMesh * get_vmesh(size_t j)
Definition: ArrayMathInterpreter.h:198
void set_single_program_code(size_t j, ArrayMathProgramCodePtr pc)
Definition: ArrayMathInterpreter.h:406
Definition: ArrayMathInterpreter.h:77
Definition: ArrayMathInterpreter.h:312
Definition: Parallel.h:61
void set_int_array(size_t j, std::vector< int > *array)
Definition: ArrayMathInterpreter.h:173
size_type get_buffer_size() const
Definition: ArrayMathInterpreter.h:339
ArrayMathProgramCode()
Definition: ArrayMathInterpreter.h:113
VField * get_vfield(size_t j)
Definition: ArrayMathInterpreter.h:201
int get_num_proc() const
Definition: ArrayMathInterpreter.h:341
long long index_type
Definition: Types.h:39
double * create_buffer(size_t size)
Definition: ArrayMathInterpreter.h:384
std::vector< double > * get_double_array(size_t j)
Definition: ArrayMathInterpreter.h:211
boost::shared_ptr< Field > FieldHandle
Definition: DatatypeFwd.h:65
void resize_const_functions(size_t sz)
Definition: ArrayMathInterpreter.h:372
void resize_sequential_functions(size_t sz)
Definition: ArrayMathInterpreter.h:376
Definition: VField.h:46
void set_matrix(Core::Datatypes::MatrixHandle matrix)
Definition: ArrayMathInterpreter.h:285
Core::Datatypes::MatrixHandle get_matrix(size_t j)
Definition: ArrayMathInterpreter.h:204
void set_index(index_type index)
Definition: ArrayMathInterpreter.h:187
Definition: ArrayMathInterpreter.h:258
std::vector< bool > * get_bool_array() const
Definition: ArrayMathInterpreter.h:290
ArrayMathProgramSource()
Definition: ArrayMathInterpreter.h:274
ArrayMathProgramCode(ArrayMathFunctionPtr function)
Definition: ArrayMathInterpreter.h:110
void set_bool_array(size_t j, std::vector< bool > *array)
Definition: ArrayMathInterpreter.h:167
Definition: VMesh.h:53
VMesh * get_vmesh() const
Definition: ArrayMathInterpreter.h:278
void set_vfield(VField *vfield)
Definition: ArrayMathInterpreter.h:281
bool is_double_array() const
Definition: ArrayMathInterpreter.h:299
double * get_data() const
Definition: ArrayMathInterpreter.h:263
Definition: ArrayMathInterpreter.h:106
Definition: Parser.h:419
int size
Definition: eabLatVolData.py:2
index_type get_index() const
Definition: ArrayMathInterpreter.h:215
size_type get_array_size() const
Definition: ArrayMathInterpreter.h:344