Am 10.06.16 um 08:55 schrieb Arjen Markus:
> Op woensdag 8 juni 2016 16:34:17 UTC+2 schreef Christian Gollwitzer:
>
>>
> .., but for wavelet analysis you typically want to put
>> vector/2D matrix data into the algorithm. Unfortunately, standard
>> Tcl lacks a data type for that. You could either create typemaps
>> which transfer from/to lists of doubles, or interface with VecTcl,
>> which handles numerical array data for Tcl.
>
>
> Well, that does not mean that Tcl is completely incapable of dealing
> with such data structures. I am thinking about using binary strings
That is correct. You can store a blob of memory containing floats as a
binary string, but then you have a hard time manipulating the data.
binary scan/format can convert between this and a list representation,
which is inefficient but accessible to Tcl code (expr/lindex & friends).
I'm arguing that a vector storage format like the one in VecTcl would be
a good additiona to the Tcl core, where binary format, Tk canvas
coordinates and Tk images would be prime users of such a data structure.
Using SWIG it is possible to define the conversion at the Tcl/C boundary
as a snippet of C code, the same as you can do with your own wrapper.
SWIG has the advantage that it can fully parse C++ code, so wrapping a
large library can be easier to start with. To get a really good
interface requires manual work with all options.
Christian