@@ -105,7 +105,7 @@ <h4><a name="slice-spec-ctors"></a>Class <code>slice</code>
105105< pre > slice();< br > </ pre >
106106< dl class ="function-semantics ">
107107 < dt > < b > Effects:</ b > constructs a < code > slice</ code > with default stop, start, and
108- step values. Equivalent to the slice object created by the Python
108+ step values. Equivalent to the slice object created as part of the Python
109109expression < code > base[::].</ code > </ dt >
110110 < dt > < b > Throws:</ b > nothing.</ dt >
111111</ dl >
@@ -115,36 +115,37 @@ <h4><a name="slice-spec-ctors"></a>Class <code>slice</code>
115115</ pre >
116116< dl class ="function-semantics ">
117117 < dt > < b > Requires:</ b > < code > start</ code > , < code > stop</ code > , and < code > step</ code >
118- are of type < code > slice_nil</ code > or convertible to type < code > object</ code > .</ dt >
118+ are of type < code > < a href ="object.html#slice_nil-spec "> slice_nil</ a > </ code >
119+ or convertible to type < code > object</ code > .</ dt >
119120 < dt > < b > Effects:</ b > constructs a new slice with default step value
120121and the provided start and stop values. Equivalent to the slice
121122object
122123created by the built-in Python function < code > < a
123124 href ="http://www.python.org/doc/current/lib/built-in-funcs.html#12h-62 "> slice(start,stop)</ a > </ code > ,
124- or the Python expression < code > base[start:stop]</ code > .</ dt >
125+ or as part of the Python expression < code > base[start:stop]</ code > .</ dt >
125126 < dt > < b > Throws:</ b > < code > error_already_set</ code > and sets a Python < code > TypeError</ code >
126127exception if no conversion is possible from the arguments to type < code > object</ code > .</ dt >
127128</ dl >
128129< pre >
129130template <typename Int1, typename Int2, typename Int3>
130131slice(Int1 start, Int2 stop, Int3 step);
131132</ pre >
132- < dt > < b > Requires:</ b > < code > start</ code > , < code > stop</ code > , and < code > step</ code > are integers, < code > slice_nil</ code > , or convertible to type < code > object</ code > .</ dt >
133+ < dt > < b > Requires:</ b > < code > start</ code > , < code > stop</ code > , and < code > step</ code > are < code > slice_nil</ code > or convertible to type < code > object</ code > .</ dt >
133134 < dt > < b > Effects:</ b > constructs a new slice with start stop and step
134135values. Equivalent to the slice object created
135136by the built-in Python function < code > < a
136137 href ="http://www.python.org/doc/current/lib/built-in-functions.html#12h-62 "> slice(start,stop,step)</ a > </ code > ,
137- or the Python expression < code > base[start:stop:step]</ code > .</ dt >
138+ or as part of the Python expression < code > base[start:stop:step]</ code > .</ dt >
138139 < dt > < b > Throws:</ b > < code > error_already_set</ code > and sets a Python < code > TypeError</ code >
139140exception if no conversion is possible from the arguments to type
140141object.</ dt >
141142< h4 > < a name ="slice-spec-observers "> </ a > Class < code > slice</ code >
142143observer functions< br >
143144</ h4 >
144145< pre >
145- object slice::start();
146- object slice::stop();
147- object slice::step();
146+ object slice::start() const ;
147+ object slice::stop() const ;
148+ object slice::step() const ;
148149</ pre >
149150< dl class ="function-semantics ">
150151 < dt > < b > Effects:</ b > None.</ dt >
@@ -153,15 +154,16 @@ <h4><a name="slice-spec-observers"></a>Class <code>slice</code>
153154the slice was created with. If the parameter was omitted or
154155slice_nil was used when the slice was created, than that parameter will
155156be a reference to PyNone and compare equal to a default-constructed
156- object. In principal, any object may be used when creating a
157+ object. In principal, any object may be used when creating a
157158slice object, but in practice they are usually integers.</ dt >
158159</ dl >
159160< br >
160161< pre >
161162template <typename RandomAccessIterator>
162163slice::range<RandomAccessIterator>
163164slice::get_indicies(
164- RandomAccessIterator const& begin, RandomAccessIterator const& end);
165+ RandomAccessIterator const& begin,
166+ RandomAccessIterator const& end) const;
165167</ pre >
166168< dl class ="function-semantics ">
167169 < dt > < b > Arguments:</ b > A pair of STL-conforming Random Access
@@ -203,7 +205,7 @@ <h2><a name="examples"></a><b>Examples</b></h2>
203205 return l[slice(_,_,2)];
204206}
205207
206- // Perform a multidimensional rich slice of a Numeric.array
208+ // Perform a multidimensional extended slice of a Numeric.array
207209numeric::array even_columns(numeric::array arr)
208210{
209211 // select every other column, starting with the second, of a 2-D array.
@@ -212,7 +214,7 @@ <h2><a name="examples"></a><b>Examples</b></h2>
212214}
213215
214216// Perform a summation over a slice of a std::vector.
215- double partial_sum(std::vector<double> const& Foo, slice index)
217+ double partial_sum(std::vector<double> const& Foo, const slice index)
216218{
217219 slice::range<std::vector<double>::const_iterator> bounds;
218220 try {
@@ -222,7 +224,7 @@ <h2><a name="examples"></a><b>Examples</b></h2>
222224 return 0.0;
223225 }
224226 double sum = 0.0;
225- while (bounds.start != bounds.end ) {
227+ while (bounds.start != bounds.stop ) {
226228 sum += *bounds.start;
227229 std::advance( bounds.start, bounds.step);
228230 }
0 commit comments