-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Consider the following snippet:
for(size_t i = 0; i < n ; ++i ){
rc = rc ? rc : grb::setElement( y, i, i );
}
rc = rc ? rc : grb::setElement( mask, 1, 2 );
rc = rc ? rc : grb::setElement( mask, 1, 3 );
rc = rc ? rc : grb::setElement( mask, 1, 5 );
rc = rc ? rc : grb::setElement( mask, 1, 7 );
rc = rc ? rc : grb::setElement( x, 1, 4 );
rc = rc ? rc : grb::setElement( x, 2, 1 );
std::cerr << "x before:\t";
for(const auto& a : x){
std::cerr << a.first << ", " << a.second << " | ";
} std::cerr << std::endl;
rc = rc ? rc : grb::set( x, mask, y );
std::cerr << "x after:\t";
for(const auto& a : x){
std::cerr << a.first << ", " << a.second << " | ";
} std::cerr << std::endl;
assert( rc == grb::SUCCESS );The output is:
x before: 4, 1 | 1, 2 |
x after: 2, 2 | 3, 3 | 5, 5 | 7, 7 |
But I would expect the values in x not covered by the mask to be kept as before, so the expected output would be something like:
x before: 4, 1 | 1, 2 |
x after: 4, 1 | 1, 2 | 2, 2 | 3, 3 | 5, 5 | 7, 7 |
The documentation is unclear about this, as it does not specify what happens to the elements in x where the mask is false
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested