Skip to content

check the shape of vector/matrix in operation #2

@gf712

Description

@gf712

Right now I can add two dynamic vectors/matrices of different shapes, which could lead to some unexpected results...

STD_LA::dyn_vector<double> vec1{1,2};
STD_LA::dyn_vector<double> vec2{1,2,3};
auto result = vec1 + vec2; // {2,4}
std::cout << result.size() << "\n"; // 2

I would personally expect an error (at most some broadcasting, e.g. result would have 3 elements, because under the hood vec1 would be interpreted as {1,2,0})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions