Commit 54b8677e authored by Bram Kohlen's avatar Bram Kohlen
Browse files

Hadamard product

parent ea678ce3
Pipeline #59779 passed with stages
in 1 minute and 9 seconds
...@@ -4,9 +4,7 @@ import de.monticore.commonexpressions._ast.*; ...@@ -4,9 +4,7 @@ import de.monticore.commonexpressions._ast.*;
import de.monticore.lang.math._ast.*; import de.monticore.lang.math._ast.*;
import de.monticore.lang.matrix._ast.ASTMathMatrixAccessExpression; import de.monticore.lang.matrix._ast.ASTMathMatrixAccessExpression;
import de.monticore.lang.matrix._ast.ASTMathMatrixValueExplicitExpression; import de.monticore.lang.matrix._ast.ASTMathMatrixValueExplicitExpression;
import de.monticore.lang.matrixexpressions._ast.ASTMathArithmeticMatrixComplexTransposeExpression; import de.monticore.lang.matrixexpressions._ast.*;
import de.monticore.lang.matrixexpressions._ast.ASTMathArithmeticMatrixEEPowExpression;
import de.monticore.lang.matrixexpressions._ast.ASTMathArithmeticMatrixSolutionExpression;
import de.monticore.numberunit._ast.ASTTimeDiv; import de.monticore.numberunit._ast.ASTTimeDiv;
public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathStructuredVisitor { public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathStructuredVisitor {
...@@ -222,4 +220,23 @@ public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathSt ...@@ -222,4 +220,23 @@ public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathSt
public void endVisit(ASTMathArithmeticMatrixComplexTransposeExpression node) { public void endVisit(ASTMathArithmeticMatrixComplexTransposeExpression node) {
this.printer.print("^T"); this.printer.print("^T");
} }
@Override
public void revisit(ASTMathArithmeticMatrixEEMultExpression node) {
this.printSpace();
this.printer.print("\\circ");
this.printSpace();
}
@Override
public void revisit(ASTMathArithmeticMatrixEERightDivideExpression node) {
this.printSpace();
this.printer.print("\\circ");
this.printSpace();
}
@Override
public void endVisit(ASTMathArithmeticMatrixEERightDivideExpression node) {
this.printer.print("^{\\circ(-1)}");
}
} }
...@@ -8,7 +8,6 @@ import java.nio.file.Paths; ...@@ -8,7 +8,6 @@ import java.nio.file.Paths;
public class ApplicationTest { public class ApplicationTest {
@Test @Test
@Ignore
public void testStart() { public void testStart() {
String modelPath = Paths.get("src/test/resources/models/montimath/vanilla").toAbsolutePath().toString(); String modelPath = Paths.get("src/test/resources/models/montimath/vanilla").toAbsolutePath().toString();
String outputPath = Paths.get("target/generated-sources/application").toAbsolutePath().toString(); String outputPath = Paths.get("target/generated-sources/application").toAbsolutePath().toString();
......
package montimath.vanilla;
script Hadamard
Q^{2,2} A = [1+1,1*2;1-matC,1/matB];
Q^{2,2} B = [1+1,1*2;1-matC,1/matB];
A = A .* B;
A = A ./ B;
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment