Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Cpp
Commits
a7aa7101
Commit
a7aa7101
authored
Jul 19, 2018
by
Evgeny Kusmenko
Browse files
Merge branch 'richter-dev' into 'master'
Richter dev See merge request
!13
parents
a0f5d8b3
7f6cecec
Pipeline
#63847
passed with stage
in 2 minutes and 48 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
a7aa7101
...
...
@@ -8,7 +8,7 @@
<groupId>
de.monticore.lang.monticar
</groupId>
<artifactId>
embedded-montiarc-math-generator
</artifactId>
<version>
0.0.2
0
-SNAPSHOT
</version>
<version>
0.0.2
1
-SNAPSHOT
</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/converter/ExecuteMethodGeneratorHandler.java
View file @
a7aa7101
...
...
@@ -8,7 +8,6 @@ import de.monticore.lang.monticar.generator.Variable;
import
de.monticore.lang.monticar.generator.cpp.MathCommandRegisterCPP
;
import
de.monticore.lang.monticar.generator.cpp.MathFunctionFixer
;
import
de.monticore.lang.monticar.generator.cpp.OctaveHelper
;
import
de.monticore.lang.monticar.generator.cpp.StringValueListExtractorUtil
;
import
de.monticore.lang.monticar.generator.cpp.symbols.MathChainedExpression
;
import
de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression
;
import
de.monticore.lang.monticar.types2._ast.ASTElementType
;
...
...
@@ -111,7 +110,7 @@ public class ExecuteMethodGeneratorHandler {
result
=
"="
+
TypeConverter
.
getDimensionString
(
TypeConverter
.
getColvecAccessString
(
type
),
dims
,
includeStrings
);
}
}
else
if
(
dims
.
size
()
==
2
)
{
if
(
type
String
.
equals
(
TypeConverter
.
getMatAccess
String
(
type
)
))
{
if
(
type
IsCompatible
(
type
String
,
type
,
dims
))
{
result
=
"="
+
TypeConverter
.
getDimensionString
(
TypeConverter
.
getMatAccessString
(
type
),
dims
,
includeStrings
);
}
}
else
if
(
dims
.
size
()
==
3
)
{
...
...
@@ -122,6 +121,14 @@ public class ExecuteMethodGeneratorHandler {
return
result
;
}
private
static
boolean
typeIsCompatible
(
String
typeString
,
ASTElementType
type
,
List
<
MathExpressionSymbol
>
dims
)
{
boolean
result
=
typeString
.
equals
(
TypeConverter
.
getMatAccessString
(
type
));
if
(!
result
&&
(
dims
.
size
()
==
2
)
&&
(
dims
.
get
(
1
).
getTextualRepresentation
().
contentEquals
(
"1"
)))
{
result
=
typeString
.
contentEquals
(
"colvec"
)
&&
TypeConverter
.
getMatAccessString
(
type
).
contentEquals
(
"mat"
);
}
return
result
;
}
public
static
String
generateExecuteCode
(
MathValueSymbol
mathValueSymbol
,
List
<
String
>
includeStrings
)
{
String
result
=
""
;
String
type
=
generateExecuteCode
(
mathValueSymbol
.
getType
(),
includeStrings
);
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/converter/ExecuteMethodGeneratorMatrixExpressionHandler.java
View file @
a7aa7101
...
...
@@ -272,7 +272,7 @@ public class ExecuteMethodGeneratorMatrixExpressionHandler {
&&
symbol
.
isMathMatrixAccessOperatorSymbolPresent
()
&&
(!
symbol
.
getNameToAccess
().
isEmpty
())
&&
(!
MathCommandRegisterCPP
.
containsCommandExpression
(
symbol
,
symbol
.
getNameToAccess
()
+
input
))
&&
(!
MathFunctionFixer
.
fixForLoopAccess
(
symbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixNameExpressionSymbol
(),
ComponentConverter
.
currentBluePrint
))
&&
(
(!
MathFunctionFixer
.
fixForLoopAccess
(
symbol
.
getMathMatrixAccessOperatorSymbol
().
getMathMatrixNameExpressionSymbol
(),
ComponentConverter
.
currentBluePrint
))
||
(!
input
.
contains
(
"-1"
)))
&&
(!
StringValueListExtractorUtil
.
containsPortName
(
symbol
.
getNameToAccess
()));
}
}
src/test/resources/results/armadillo/testMath/l0/test_math_columnVectorMathSectionTest.h
View file @
a7aa7101
...
...
@@ -12,7 +12,7 @@ void init()
}
void
execute
()
{
colvec
a
;
colvec
a
=
mat
(
10
,
1
)
;
}
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment