Пример #1
0
parser.add_argument("-r", '--reset', action="store_true",
        help="""\
Ignore the content of `<filename>.py` and make a fresh translation.""")

parser.add_argument("-d", '--disp', action="store_true",
        help="""\
Print out the progress of the translation process.""")

parser.add_argument("-c", '--comments', action="store_true",
        help="""\
Strip away all the comments in the output of the translation.""")

parser.add_argument("-l", '--line', type=int, dest="line",
        help="Only display code related to code line number `<line>`.")
parser.add_argument("-o", '--original', action="store_true",
        help="Include original matlab code line as comment before C++ translation")


try:
    import argcomplete
    argcomplete.autocomplete(parser)
except:
    pass

if __name__ == "__main__":

    args = parser.parse_args()
    import matlab2cpp
    matlab2cpp.main(args)

Пример #2
0
For the generated C++ code, function input parameters are "copied by value" as default. With this flag some \
input parameters in the generated code can be const references. There can be some performance advantage of using
const references instead of "copied by value". Note that Matlab "copies by value". \
The Matlab code you try to translate to C++ code could try read as well as write to this input variable. \
The code generator doesn't perform an analysis to detect this and then "copy by value" for this variable."""
                    )
parser.add_argument(
    "-l",
    '--line',
    type=int,
    dest="line",
    help="Only display code related to code line number `<line>`.")

parser.add_argument(
    "-n",
    '--nargin',
    action="store_true",
    help="Don't remove if and switch branches which use nargin variable.")

try:
    import argcomplete
    argcomplete.autocomplete(parser)
except:
    pass

if __name__ == "__main__":

    args = parser.parse_args()
    import matlab2cpp
    matlab2cpp.main(args)