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

Fix affectation of R^d and R^dxd tuples from a single 0

parent 5eaac22a
Branches
Tags
1 merge request!144Add R^dxd and R^d expressions in pugs' language (with d=1,2 or 3)
...@@ -561,6 +561,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor( ...@@ -561,6 +561,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor(
if (rhs_type == ASTNodeDataType::vector_t) { if (rhs_type == ASTNodeDataType::vector_t) {
Assert(rhs_type.dimension() == 2); Assert(rhs_type.dimension() == 2);
list_affectation_processor->template add<std::vector<TinyVector<2>>, TinyVector<2>>(value_node); list_affectation_processor->template add<std::vector<TinyVector<2>>, TinyVector<2>>(value_node);
} else if (rhs_type == ASTNodeDataType::int_t) {
list_affectation_processor->template add<std::vector<TinyVector<2>>, int64_t>(value_node);
} else { } else {
// LCOV_EXCL_START // LCOV_EXCL_START
throw UnexpectedError("incompatible tuple types in affectation"); throw UnexpectedError("incompatible tuple types in affectation");
...@@ -572,6 +574,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor( ...@@ -572,6 +574,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor(
if (rhs_type == ASTNodeDataType::vector_t) { if (rhs_type == ASTNodeDataType::vector_t) {
Assert(rhs_type.dimension() == 3); Assert(rhs_type.dimension() == 3);
list_affectation_processor->template add<std::vector<TinyVector<3>>, TinyVector<3>>(value_node); list_affectation_processor->template add<std::vector<TinyVector<3>>, TinyVector<3>>(value_node);
} else if (rhs_type == ASTNodeDataType::int_t) {
list_affectation_processor->template add<std::vector<TinyVector<3>>, int64_t>(value_node);
} else { } else {
// LCOV_EXCL_START // LCOV_EXCL_START
throw UnexpectedError("incompatible tuple types in affectation"); throw UnexpectedError("incompatible tuple types in affectation");
...@@ -615,6 +619,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor( ...@@ -615,6 +619,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor(
Assert(rhs_type.numberOfRows() == 2); Assert(rhs_type.numberOfRows() == 2);
Assert(rhs_type.numberOfColumns() == 2); Assert(rhs_type.numberOfColumns() == 2);
list_affectation_processor->template add<std::vector<TinyMatrix<2>>, TinyMatrix<2>>(value_node); list_affectation_processor->template add<std::vector<TinyMatrix<2>>, TinyMatrix<2>>(value_node);
} else if (rhs_type == ASTNodeDataType::int_t) {
list_affectation_processor->template add<std::vector<TinyMatrix<2>>, int64_t>(value_node);
} else { } else {
// LCOV_EXCL_START // LCOV_EXCL_START
throw UnexpectedError("incompatible tuple types in affectation"); throw UnexpectedError("incompatible tuple types in affectation");
...@@ -627,6 +633,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor( ...@@ -627,6 +633,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor(
Assert(rhs_type.numberOfRows() == 3); Assert(rhs_type.numberOfRows() == 3);
Assert(rhs_type.numberOfColumns() == 3); Assert(rhs_type.numberOfColumns() == 3);
list_affectation_processor->template add<std::vector<TinyMatrix<3>>, TinyMatrix<3>>(value_node); list_affectation_processor->template add<std::vector<TinyMatrix<3>>, TinyMatrix<3>>(value_node);
} else if (rhs_type == ASTNodeDataType::int_t) {
list_affectation_processor->template add<std::vector<TinyMatrix<3>>, int64_t>(value_node);
} else { } else {
// LCOV_EXCL_START // LCOV_EXCL_START
throw UnexpectedError("incompatible tuple types in affectation"); throw UnexpectedError("incompatible tuple types in affectation");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment