Skip to content

Empty custom matrix #570

@jcoupey

Description

@jcoupey

We have a check in place for (custom) matrix size consistency. For example using "matrices": {"car": {"durations": [[0]]}} result in an adequate error if some location_index values are not zero. But the problem is that we somehow assume that a custom matrix is not empty. If it is, then based on its size in this check we behave as if no matrix was provided in input and try grabbing a non-existing routing wrapper.

With "matrices": {"car": {"durations": []}}:

$ vroom [...]
vroom: structures/vroom/input/input.cpp:576: vroom::Input::set_matrices(unsigned int)::<lambda(const std::vector<std::__cxx11::basic_string<char> >&)>: Assertion `rw != _routing_wrappers.end()' failed.
Aborted (core dumped)

This is really an edge case as there is no point in defining an empty custom matrix in input (probably why no-one reported this yet), but still we should handle this properly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions