Skip to content
Snippets Groups Projects
Commit 35746c2d authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Treat R^1x1 the same way as R^1 when initializing with 0

parent a029ab08
No related branches found
No related tags found
1 merge request!145git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
...@@ -17,9 +17,10 @@ class AffectationProcessorBuilder final : public IAffectationProcessorBuilder ...@@ -17,9 +17,10 @@ class AffectationProcessorBuilder final : public IAffectationProcessorBuilder
std::unique_ptr<INodeProcessor> std::unique_ptr<INodeProcessor>
getNodeProcessor(ASTNode& lhs_node, ASTNode& rhs_node) const final getNodeProcessor(ASTNode& lhs_node, ASTNode& rhs_node) const final
{ {
if constexpr (std::is_same_v<ValueT, TinyVector<1>> and std::is_same_v<DataT, int64_t> and if constexpr ((std::is_same_v<ValueT, TinyVector<1>> or
std::is_same_v<ValueT, TinyMatrix<1>>)and std::is_same_v<DataT, int64_t> and
std::is_same_v<OperatorT, language::eq_op>) { std::is_same_v<OperatorT, language::eq_op>) {
// Special treatment for the case 0 -> R^1 // Special treatment for the case 0 -> R^1 or 0 -> R^1x1
if ((rhs_node.is_type<language::integer>()) and (std::stoi(rhs_node.string()) == 0)) { if ((rhs_node.is_type<language::integer>()) and (std::stoi(rhs_node.string()) == 0)) {
return std::make_unique<AffectationFromZeroProcessor<ValueT>>(lhs_node); return std::make_unique<AffectationFromZeroProcessor<ValueT>>(lhs_node);
} else { } else {
......
...@@ -239,7 +239,7 @@ let (x1,x2,x3,x) : R^1x1*R^2x2*R^3x3*R, ...@@ -239,7 +239,7 @@ let (x1,x2,x3,x) : R^1x1*R^2x2*R^3x3*R,
std::string_view result = R"( std::string_view result = R"(
(root:ASTNodeListProcessor) (root:ASTNodeListProcessor)
+-(language::eq_op:AffectationProcessor<language::eq_op, TinyMatrix<1ul, 1ul, double>, long>) +-(language::eq_op:AffectationFromZeroProcessor<TinyMatrix<1ul, 1ul, double> >)
| +-(language::name:a:NameProcessor) | +-(language::name:a:NameProcessor)
| `-(language::integer:0:ValueProcessor) | `-(language::integer:0:ValueProcessor)
+-(language::eq_op:AffectationToTinyMatrixFromListProcessor<language::eq_op, TinyMatrix<2ul, 2ul, double> >) +-(language::eq_op:AffectationToTinyMatrixFromListProcessor<language::eq_op, TinyMatrix<2ul, 2ul, double> >)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment