Changes between Version 6 and Version 7 of C++ API
- Timestamp:
- 09/10/12 18:44:08 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
C++ API
v6 v7 101 101 === Complex data === 102 102 103 In addition to the datatypes that are available in the C API, the C++ API can also receive a {{{MUSCLE_COMPLEX}}} type. This will receive a {{{muscle::ComplexData}}} object, defined in the {{{muscle2/complex_data.hpp}}} header file. This ComplexData is used when the sender of a message sends different data than an array. A Java sender might send a 2-D array of doubles, for instance. In the enum {{{muscle_complex_t}}} all possible types are listed. For the moment only arrays and matrices are supported. Working with ComplexDatagoes as follows, for example with a two-dimensional double array103 In addition to the datatypes that are available in the C API, the C++ API can also receive a {{{MUSCLE_COMPLEX}}} type. This will receive a {{{muscle::ComplexData}}} object, defined in the {{{muscle2/complex_data.hpp}}} header file. This {{{ComplexData}}} is used when the sender of a message sends different data than an array. A Java sender might send a 2-D array of doubles, for instance. In the enum {{{muscle_complex_t}}} all possible types are listed. For the moment only arrays and matrices are supported. Working with {{{ComplexData}}} goes as follows, for example with a two-dimensional double array 104 104 {{{ 105 105 #include <vector> … … 135 135 } 136 136 }}} 137 The indices of the 2-D array are retrieved using the {{{index}}} or {{{fidx}}} function, where the latter is faster but does not do range or dimensionality checking. To send a ComplexData object it must first be constructed. The easiest way is to let ComplexData do the memory allocation and destruction, and getting the allocated memory from ComplexDatato perform actual actions with.137 The indices of the 2-D array are retrieved using the {{{index}}} or {{{fidx}}} function, where the latter is faster but does not do range or dimensionality checking. To send a {{{ComplexData}}} object it must first be constructed. The easiest way is to let {{{ComplexData}}} do the memory allocation and destruction, and getting the allocated memory from {{{ComplexData}}} to perform actual actions with. 138 138 {{{ 139 139 vector<int> dims(2);