Skip to content

Commit

Permalink
solves #126
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathf committed Oct 21, 2017
1 parent 9a07e93 commit 96a333d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/matlab2cpp/rules/mat.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,15 @@ def Set(node):

# uvec + scalar
elif dim0 > 0 and dim1 == 0:
index = node[0].str.index('(')
return "%(name)s(" + "m2cpp::span<uvec>" + node[0].str[index:] + \
", m2cpp::span<uvec>(" + arg1 + ", " + arg1 + "))"

if "(" in node[0].str:
index = node[0].str.index('(')
lhs = node[0].str[index:]
return (
"%(name)s(m2cpp::span<uvec>" + lhs +
", m2cpp::span<uvec>(" + arg1 + ", " + arg1 + "))"
)
return "%(name)s(" + arg0 + ", " + arg1 + ")"
#return "%(name)s.row(" + arg0 + ").cols(" + arg1 + ")"

# uvec + uvec
Expand Down

0 comments on commit 96a333d

Please sign in to comment.