Skip to content

Commit a07aae2

Browse files
authored
Merge pull request #2280 from AntoinePrv/doc-improvement-c
Documentation improvement Part #C
2 parents e0dac3a + 2b1ae53 commit a07aae2

File tree

15 files changed

+162
-162
lines changed

15 files changed

+162
-162
lines changed

docs/source/adaptor.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ The following example shows how to bring an ``std::vector`` into the expression
2020
2121
#include <cstddef>
2222
#include <vector>
23-
#include "xtensor/xarray.hpp"
24-
#include "xtensor/xadapt.hpp"
23+
#include <xtensor/xarray.hpp>
24+
#include <xtensor/xadapt.hpp>
2525
2626
std::vector<double> v = {1., 2., 3., 4., 5., 6. };
2727
std::vector<std::size_t> shape = { 2, 3 };
@@ -50,7 +50,7 @@ ownership of the array:
5050
.. code::
5151
5252
#include <cstddef>
53-
#include "xtensor/xadapt.hpp"
53+
#include <xtensor/xadapt.hpp>
5454
5555
void compute(double* data, std::size_t size)
5656
{
@@ -82,8 +82,8 @@ the ownership of the array, meaning it will be deleted when the adaptor is destr
8282
.. code::
8383
8484
#include <cstddef>
85-
#include "xtensor/xarray.hpp"
86-
#include "xtensor/xadapt.hpp"
85+
#include <xtensor/xarray.hpp>
86+
#include <xtensor/xadapt.hpp>
8787
8888
void compute(double*& data, std::size_t size)
8989
{
@@ -119,8 +119,8 @@ adaptor before calling ``compute`` and pass it to the function:
119119
.. code::
120120
121121
#include <cstddef>
122-
#include "xtensor/xarray.hpp"
123-
#include "xtensor/xadapt.hpp"
122+
#include <xtensor/xarray.hpp>
123+
#include <xtensor/xadapt.hpp>
124124
125125
template <class A>
126126
void compute(A& a)
@@ -154,8 +154,8 @@ Adapting C arrays allocated on the stack is as simple as adapting ``std::vector`
154154
155155
#include <cstddef>
156156
#include <vector>
157-
#include "xtensor/xarray.hpp"
158-
#include "xtensor/xadapt.hpp"
157+
#include <xtensor/xarray.hpp>
158+
#include <xtensor/xadapt.hpp>
159159
160160
double v[6] = {1., 2., 3., 4., 5., 6. };
161161
std::vector<std::size_t> shape = { 2, 3 };

docs/source/container.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The following example shows how to initialize a multi-dimensional array of dynam
2929
.. code::
3030
3131
#include <vector>
32-
#include "xtensor/xarray.hpp"
32+
#include <xtensor/xarray.hpp>
3333
3434
std::vector<size_t> shape = { 3, 2, 4 };
3535
std::vector<size_t> strides = { 8, 4, 1 };
@@ -40,7 +40,7 @@ However, this requires to carefully compute the strides to avoid buffer overflow
4040
.. code::
4141
4242
#include <vector>
43-
#include "xtensor/xarray.hpp"
43+
#include <xtensor/xarray.hpp>
4444
4545
std::vector<size_t> shape = { 3, 2, 4 };
4646
xt::xarray<double, xt::layout_type::dynamic> a(shape, xt::layout_type::row_major);
@@ -50,7 +50,7 @@ If the layout of the array can be fixed at compile time, we can make it even sim
5050
.. code::
5151
5252
#include <vector>
53-
#include "xtensor/xarray.hpp"
53+
#include <xtensor/xarray.hpp>
5454
5555
std::vector<size_t> shape = { 3, 2, 4 };
5656
xt::xarray<double, xt::layout_type::row_major> a(shape);
@@ -75,7 +75,7 @@ Let's use ``xtensor`` instead of ``xarray`` in the previous example:
7575
.. code::
7676
7777
#include <array>
78-
#include "xtensor/xtensor.hpp"
78+
#include <xtensor/xtensor.hpp>
7979
8080
std::array<size_t, 3> shape = { 3, 2, 4 };
8181
xt::xtensor<double, 3> a(shape);
@@ -86,7 +86,7 @@ Or when using ``xtensor_fixed``:
8686

8787
.. code::
8888
89-
#include "xtensor/xfixed.hpp"
89+
#include <xtensor/xfixed.hpp>
9090
9191
xt::xtensor_fixed<double, xt::xshape<3, 2, 4>> a();
9292
// or xt::xtensor_fixed<double, xt::xshape<3, 2, 4>, xt::layout_type::row_major>()
@@ -107,7 +107,7 @@ compatible with the old one, that is, the number of elements in the container mu
107107

108108
.. code::
109109
110-
#include "xtensor/xarray.hpp"
110+
#include <xtensor/xarray.hpp>
111111
112112
xt::xarray<int> a = { 1, 2, 3, 4, 5, 6, 7, 8};
113113
// The following two lines ...
@@ -124,7 +124,7 @@ values in the ``shape``:
124124

125125
.. code::
126126
127-
#include "xtensor/xarray.hpp"
127+
#include <xtensor/xarray.hpp>
128128
xt::xarray<int> a = { 1, 2, 3, 4, 5, 6, 7, 8};
129129
a.reshape({2, -1});
130130
// a.shape() return {2, 4}
@@ -151,8 +151,8 @@ automatically and applies the "temporary variable rule" by default. A mechanism
151151

152152
.. code::
153153
154-
#include "xtensor/xarray.hpp"
155-
#include "xtensor/xnoalias.hpp"
154+
#include <xtensor/xarray.hpp>
155+
#include <xtensor/xnoalias.hpp>
156156
157157
// a, b, and c are xt::xarrays previously initialized
158158
xt::noalias(b) = a + c;
@@ -167,7 +167,7 @@ The aliasing phenomenon is illustrated in the following example:
167167
.. code::
168168
169169
#include <vector>
170-
#include "xtensor/xarray.hpp"
170+
#include <xtensor/xarray.hpp>
171171
172172
std::vector<size_t> a_shape = {3, 2, 4};
173173
xt::xarray<double> a(a_shape);

docs/source/developer/concepts.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class whose template parameter is ``A`` and should forward this parameter to ``x
2626

2727
.. code::
2828
29-
#include "xtensor/xexpression.hpp"
29+
#include <xtensor/xexpression.hpp>
3030
3131
template <class T>
3232
class B : public xexpression<T>
@@ -111,7 +111,7 @@ given shape:
111111
#include <algorithm>
112112
#include <iterator>
113113
#include <iostream>
114-
#include "xtensor/xarray.hpp"
114+
#include <xtensor/xarray.hpp>
115115
116116
int main(int argc, char* argv[])
117117
{
@@ -146,8 +146,8 @@ The first overload is meant for computed assignment involving a scalar; it allow
146146

147147
.. code::
148148
149-
#include "xtensor/xarray.hpp"
150-
#include "xio.hpp"
149+
#include <xtensor/xarray.hpp>
150+
#include <xtensor/xio.hpp>
151151
152152
int main(int argc, char* argv)
153153
{

docs/source/expression.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ You can access the elements of any ``xexpression`` with ``operator()``:
126126

127127
.. code::
128128
129-
#include "xtensor/xarray.hpp"
129+
#include <xtensor/xarray.hpp>
130130
131131
xt::xarray<double> a = {{1., 2., 3.}, {4., 5., 6.}};
132132
auto f = 2 * a;
@@ -143,7 +143,7 @@ of the expression:
143143

144144
.. code::
145145
146-
#include "xtensor/xarray.hpp"
146+
#include <xtensor/xarray.hpp>
147147
148148
xt::xarray<double> a = {{1., 2., 3.}, {4., 5., 6.}};
149149
@@ -167,7 +167,7 @@ Shape
167167
.. code::
168168
169169
#include <vector>
170-
#include "xtensor/xarray.hpp"
170+
#include <xtensor/xarray.hpp>
171171
172172
using array_type = xt::xarray<double>;
173173
using shape_type = array_type::shape_type;

docs/source/external-structures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ strides based on the shape and the layout, so the implementation of the ``resize
179179

180180
.. code::
181181
182-
#include "xtensor/xstrides.hpp" // for utility functions
182+
#include <xtensor/xstrides.hpp> // for utility functions
183183
184184
template <class T>
185185
void resize(const shape_type& shape)

docs/source/file_loading.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ save data in the Comma-separated value format. The reference documentation is :d
2828
#include <fstream>
2929
#include <iostream>
3030
31-
#include "xtensor/xarray.hpp"
32-
#include "xtensor/xcsv.hpp"
31+
#include <xtensor/xarray.hpp>
32+
#include <xtensor/xcsv.hpp>
3333
3434
int main()
3535
{
@@ -59,8 +59,8 @@ Reference documentation for the functions used is found here :doc:`api/xnpy`.
5959
#include <iostream>
6060
#include <fstream>
6161
62-
#include "xtensor/xarray.hpp"
63-
#include "xtensor/xnpy.hpp"
62+
#include <xtensor/xarray.hpp>
63+
#include <xtensor/xnpy.hpp>
6464
6565
int main()
6666
{
@@ -85,8 +85,8 @@ The reference documentation is found :doc:`api/xjson`.
8585

8686
.. code::
8787
88-
#include "xtensor/xjson.hpp"
89-
#include "xtensor/xarray.hpp"
88+
#include <xtensor/xjson.hpp>
89+
#include <xtensor/xarray.hpp>
9090
9191
int main()
9292
{

docs/source/getting_started.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ First example
1616
.. code::
1717
1818
#include <iostream>
19-
#include "xtensor/xarray.hpp"
20-
#include "xtensor/xio.hpp"
21-
#include "xtensor/xview.hpp"
19+
#include <xtensor/xarray.hpp>
20+
#include <xtensor/xio.hpp>
21+
#include <xtensor/xview.hpp>
2222
2323
int main(int argc, char* argv[])
2424
{
@@ -142,8 +142,8 @@ This second example initializes a 1-dimensional array and reshapes it in-place:
142142
.. code::
143143
144144
#include <iostream>
145-
#include "xtensor/xarray.hpp"
146-
#include "xtensor/xio.hpp"
145+
#include <xtensor/xarray.hpp>
146+
#include <xtensor/xio.hpp>
147147
148148
int main(int argc, char* argv[])
149149
{
@@ -177,16 +177,16 @@ When compiled and run, this produces the following output:
177177

178178
.. code-block:: cpp
179179
180-
std::cout << xt::adapt(arr.shape()); // with: #include "xtensor/xadapt.hpp"
180+
std::cout << xt::adapt(arr.shape()); // with: #include <xtensor/xadapt.hpp>
181181
182182
Third example: index access
183183
---------------------------
184184

185185
.. code::
186186
187187
#include <iostream>
188-
#include "xtensor/xarray.hpp"
189-
#include "xtensor/xio.hpp"
188+
#include <xtensor/xarray.hpp>
189+
#include <xtensor/xio.hpp>
190190
191191
int main(int argc, char* argv[])
192192
{
@@ -219,9 +219,9 @@ This last example shows how to broadcast the ``xt::pow`` universal function:
219219
.. code::
220220
221221
#include <iostream>
222-
#include "xtensor/xarray.hpp"
223-
#include "xtensor/xmath.hpp"
224-
#include "xtensor/xio.hpp"
222+
#include <xtensor/xarray.hpp>
223+
#include <xtensor/xmath.hpp>
224+
#include <xtensor/xio.hpp>
225225
226226
int main(int argc, char* argv[])
227227
{

0 commit comments

Comments
 (0)