-
Notifications
You must be signed in to change notification settings - Fork 5
Span Docs
A span object is used to specify how to span extents. You can specify where to start the slicing, and where to end.. This way you can define the span of range in a single dimension you want to include in you subtensor.
I took the span implementation from Cem Bassoy's previous implementation of span and changed I few things. Firstly I did away with two different types of spans and made one cohesive span for simple subtensors(sliced or strided). Initially I also created a concept of span with negative stirides similar to Amit's work. But after discussing with Cem, we decided to drop the idea.
So finally there are following ways to create span types.
-
span() => span(0,1,max)
(all) span(val) => span(val,1,val)
span(first, last) => span(first,1,last)
span(first, last, step)
-
I have combined both stridden and sliced span as the previous one used the tag to identify them.
-
Changed the evaluation criteria for spans. Spans are clipped before they are evaluated when they are used to create a subtensor.
-
Made size a function rather than a part of the span class.
-
Removed concept of
ran
function
using namespace boost::numeric::ublas;
// span with no arguments ( start: 0, last: max, step: 1 )
auto s1 = span{};
// span with one argument (start: 4, last: 4, step: 1)
auto s2 = span{4};
// span with two arguments (start: 0, last: 10, step: 1)
auto s3 = span{0,10};
// span with three arguments ( start: 0, last: 10, step: 4 )
auto s4 = span{0, 4, 10};
We both would like to thank our mentor Cem Bassoy for his constant support and help in achieving our milestones. From conducting regular meetings and providing indispensable information and suggestions, to the helpfulness in always answering our queries we always find him extremely helpful and his contribution towards our projects is massive. We are grateful for the time and efforts he devoted towards our projects. We would also like to thank Google for the Google Summer of Code Programme, without which all these wouldn't be possible. We would like to take the opportunity to thank the members of the of Boost Community for letting us be a part of this wonderful journey.