|
16 | 16 | "## Initial condition\n",
|
17 | 17 | "\n",
|
18 | 18 | "For all the exercises, the vector `v` is filled with pseudo-random numbers that are seeded with a constant value and are therefore identical from one execution to another.\n",
|
19 |
| - "\n", |
20 |
| - "## Sequential implementation\n", |
21 |
| - "\n", |
22 |
| - "The \"core\" of the sequential implementation provided in [starting_point.cpp] is split into two separate functions:\n", |
23 |
| - "\n", |
24 |
| - "\n", |
25 |
| - "```c++\n", |
26 |
| - "/// Initializes the vectors `x` and `y`\n", |
27 |
| - "void initialize(std::vector<double> &x, std::vector<double> &y) {\n", |
28 |
| - " assert(x.size() == y.size());\n", |
29 |
| - " for (std::size_t i = 0; i < x.size(); ++i) {\n", |
30 |
| - " x[i] = (double)i;\n", |
31 |
| - " y[i] = 2.;\n", |
32 |
| - " }\n", |
33 |
| - "}\n", |
34 |
| - "\n", |
35 |
| - "/// DAXPY: AX + Y\n", |
36 |
| - "void daxpy(double a, std::vector<double> const &x, std::vector<double> &y) {\n", |
37 |
| - " assert(x.size() == y.size());\n", |
38 |
| - " for (std::size_t i = 0; i < y.size(); ++i) {\n", |
39 |
| - " y[i] += a * x[i];\n", |
40 |
| - " }\n", |
41 |
| - "}\n", |
42 |
| - "```\n", |
43 |
| - "\n", |
44 |
| - "We initialize the vectors to the `x[i] = i` and `y[i] = 2.` expressions covered above for testing purposes.\n", |
45 |
| - "\n", |
46 |
| - "The `daxpy` function implements a loop over all vector elements, reading from both `x` and `y` and writing the solution to `y`.\n", |
47 |
| - "\n", |
48 |
| - "[starting_point.cpp]: ./starting_point.cpp\n", |
49 |
| - "\n", |
50 |
| - "## Getting started\n", |
51 |
| - "\n", |
52 |
| - "Let's start by checking the version of some of the compilers installed in the image:\n" |
| 19 | + "\n" |
53 | 20 | ]
|
54 | 21 | },
|
55 | 22 | {
|
|
0 commit comments