shsajjadi / OctaveCoder

Octave Coder __ A code generator and build system that converts Octave to C++
Other
27 stars 3 forks source link

Predefining Data Types - Is It Possible? #29

Open AgileEngineeringLLC opened 10 months ago

AgileEngineeringLLC commented 10 months ago

Hi, I'd like to use OctaveCoder to help convert some Octave software-defined-radio (SDR) code to run as real-time C/C++ code. Is there a way to pre-define Octave data types within a function, similar to how Matlab Coder does? I'm thinking this type of feature may be a huge boost in speeding up the OctaveCoder output, if it's something that can be done. Thanks for all the work on OctaveCoder! Don

shsajjadi commented 10 months ago

Thanks for your interest! Currently the code generation is automatic and there is no way to declare data types for variables. Declaring types for variables is the first step. The body of most of the .m functions contains call to builtin functions like "zeros" "ones" "eye" "rand". Those nearly 800 builtin functions should be manually rewritten/refactored to make them compatible with coder and their source should be included in the package. It is also needed to refactor/rewrite the functions subsref and subsasgn for nearly 20-30 builtin types. It needs much of work.

AgileEngineeringLLC commented 10 months ago

Thanks for the response. I'll be happy to help do beta testing on future versions, altho my expertise is more in matlab and C code. Really like the possibilities of what could be done with OctaveCoder, and i'm continuing to use it for my current project. Thanks!