Commit d51d025e authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

Clean-up object programming TPs.

parent 855988fc
......@@ -29,7 +29,7 @@
"metadata": {},
"source": [
"\n",
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [TP 4](/notebooks/2-ObjectProgramming/1b-TP.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [TP 4](./1b-TP.ipynb)"
]
},
{
......@@ -23,7 +23,7 @@
"source": [
"### Introduction\n",
"\n",
"[This notebook](/notebooks/TP/HowTo.ipynb) explains very briefly your options to run the TP.\n",
"[This notebook](../TP/HowTo.ipynb) explains very briefly your options to run the TP.\n",
"\n",
"`initial_file.cpp` is the solution to the exercice 10 (we drop the writing into an external file and the function pointers).\n",
"\n",
......@@ -32,7 +32,7 @@
"\n",
"We will tackle the same problem with a dedicated `struct` called `PowerOfTwoApprox` which will be used to represent a real by two integers: the numerator and the exponent to the power of 2 used in the denominator.\n",
"\n",
"Create this structure and use it throughout the program (`compute_power_of_2_approx()` signature should for instance be modified accordingly).\n",
"Create this structure and use it throughout the program (`compute_power_of_2_approx()` signature should be modified accordingly).\n",
"\n",
"The expected output is unchanged from the initial file:\n",
"\n",
......@@ -62,7 +62,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -72,14 +72,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
......
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [TP 5](/notebooks/2-ObjectProgramming/2b-TP.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [TP 5](./2b-TP.ipynb)"
]
},
{
......@@ -34,7 +34,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -44,14 +44,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
......
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [TP 6](/notebooks/2-ObjectProgramming/3b-TP.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [TP 6](./3b-TP.ipynb)"
]
},
{
......@@ -23,7 +23,7 @@
"source": [
"### EXERCICE 15: change interface of `PowerOfTwoApprox` struct\n",
"\n",
"* Transform `Compute()` into a constructor. This constructor can't any longer retuen a double value; introduce a method `AsDouble()` which returns the approximation.\n",
"* Transform `Compute()` into a constructor. This constructor can't any longer return a double value; introduce a method `AsDouble()` which returns the approximation.\n",
"* Assign a default value of `0` to data attributes (if not already done previously!)\n",
"\n",
"Expected output is the same as previously."
......@@ -33,7 +33,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -43,14 +43,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
......
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [TP 7](/notebooks/2-ObjectProgramming/4b-TP.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [TP 7](./4b-TP.ipynb)"
]
},
{
......@@ -164,18 +164,18 @@
"\n",
"We will therefore introduce a `print_line()` function which will be in charge of printing the line for a given number of bits.\n",
"\n",
"At the moment, we will renege the sound principle of separating the functionalities (humour me for the moment...) and this function will:\n",
"At the moment, we will renege the sound principle of separating the functionalities (humor me for the moment...) and this function will:\n",
"\n",
"* Take as arguments the number of bits, the exact actual number (obtained through usual floating-point arithmetic) and the approximation of this number through our representation.\n",
"* Compute the error with a resolution also given as argument ((i.e. the maximum index against which error is expressed - 100 and 1000 respectively up to now).\n",
"\n",
"However there are subtleties in the way the lines are displayed: the parts in red is supplementary text that\n",
"However there are subtleties in the way the lines are displayed: the parts in red is supplementary text that vary depending on the call site:\n",
"\n",
"[With 2 bits]: 0.65 ~ 0.75 <font color=\"red\">(3/2^2)</font> [error = 15/100]\n",
"\n",
"[With 1 bits]: <font color=\"red\">0.65 * 3515 + 0.35 * 4832 = </font> 3976 ~ 2965 [error = 254/1000]\n",
"\n",
"So to do that you will need two strings arguments to provide the possibility to customize the line at the two locations pointed out in red (to achieve this you may need a reminder of [how to convert a number into a string](/notebooks/1-ProceduralProgramming/6-Streams.ipynb#Conversion)). \n",
"So to do that you will need two strings arguments to provide the possibility to customize the line at the two locations pointed out in red (to achieve this you may need a reminder of [how to convert a number into a string](../1-ProceduralProgramming/6-Streams.ipynb#Conversion)). \n",
"\n",
"Last subtlety: for the `DisplayMultiply` case we round the exact value to an integer, but that would break the output for the `TestDisplayPowerOfTwoApprox` cases... So we introduce an enum class which will act as a boolean:\n",
"\n",
......@@ -196,7 +196,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -206,14 +206,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
......
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [TP 8](/notebooks/2-ObjectProgramming/6b-TP.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [TP 8](./6b-TP.ipynb)"
]
},
{
......@@ -301,7 +301,7 @@
"metadata": {},
"source": [
"\n",
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -311,14 +311,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment