From 4f5df92bc92bc9b852f07abc38ba822bb2f64a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Fita?= Date: Tue, 12 Feb 2019 21:35:44 +0000 Subject: [PATCH 1/3] saddle-points: Add efficiency notice about vector of vectors https://github.com/exercism/rust/issues/787 --- exercises/saddle-points/.meta/hints.md | 13 +++++++++++++ exercises/saddle-points/README.md | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 exercises/saddle-points/.meta/hints.md diff --git a/exercises/saddle-points/.meta/hints.md b/exercises/saddle-points/.meta/hints.md new file mode 100644 index 000000000..82bc228a0 --- /dev/null +++ b/exercises/saddle-points/.meta/hints.md @@ -0,0 +1,13 @@ +## Efficiency Notice + +This exercise uses a _vector of vectors_ to store the content of matrices. While +this exercise is designed to help students understand basic concepts about +vectors, such as indexing, and that nested data types are legal, _vector of +vectors_ is a suboptimal choice for high-performance matrix algebra and any +similar efficient processing of larger amounts of data. + +The detailed explanation of this inefficiency is beyond the scope of this +exercise and this learning track in general. This aspect is known as +[cache locality](https://stackoverflow.com/questions/12065774/why-does-cache-locality-matter-for-array-performance) +and you can find a good introduction to it by clicking that link if you'd like +to learn more about details of a modern computer architecture. diff --git a/exercises/saddle-points/README.md b/exercises/saddle-points/README.md index 9d560d11f..6c58efa32 100644 --- a/exercises/saddle-points/README.md +++ b/exercises/saddle-points/README.md @@ -28,6 +28,21 @@ The matrix can have a different number of rows and columns (Non square). Note that you may find other definitions of matrix saddle points online, but the tests for this exercise follow the above unambiguous definition. +## Efficiency Notice + +This exercise uses a _vector of vectors_ to store the content of matrices. While +this exercise is designed to help students understand basic concepts about +vectors, such as indexing, and that nested data types are legal, _vector of +vectors_ is a suboptimal choice for high-performance matrix algebra and any +similar efficient processing of larger amounts of data. + +The detailed explanation of this inefficiency is beyond the scope of this +exercise and this learning track in general. This aspect is known as +[cache locality](https://stackoverflow.com/questions/12065774/why-does-cache-locality-matter-for-array-performance) +and you can find a good introduction to it by clicking that link if you'd like +to learn more about details of a modern computer architecture. + + ## Rust Installation Refer to the [exercism help page][help-page] for Rust installation and learning From 292ed1e350f69f9173a6f021afde35626147e7f8 Mon Sep 17 00:00:00 2001 From: John Arundel Date: Fri, 4 Jan 2019 18:09:34 +0000 Subject: [PATCH 2/3] saddle-points: use unambiguous coordinates https://github.com/exercism/problem-specifications/pull/1429 --- exercises/saddle-points/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/saddle-points/README.md b/exercises/saddle-points/README.md index 6c58efa32..82746c453 100644 --- a/exercises/saddle-points/README.md +++ b/exercises/saddle-points/README.md @@ -8,11 +8,11 @@ So say you have a matrix like so: 0 1 2 |--------- 0 | 9 8 7 -1 | 5 3 2 <--- saddle point at (1,0) +1 | 5 3 2 <--- saddle point at column 0, row 1, with value 5 2 | 6 6 7 ``` -It has a saddle point at (1, 0). +It has a saddle point at column 0, row 1. It's called a "saddle point" because it is greater than or equal to every element in its row and less than or equal to every element in From 93dc9a3133c74e692d3ec363854bcfb5fa2e7438 Mon Sep 17 00:00:00 2001 From: John Arundel Date: Sat, 5 Jan 2019 14:38:18 +0000 Subject: [PATCH 3/3] saddle-points: use 1-based coordinates https://github.com/exercism/problem-specifications/pull/1429 --- exercises/saddle-points/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/saddle-points/README.md b/exercises/saddle-points/README.md index 82746c453..7c75f9743 100644 --- a/exercises/saddle-points/README.md +++ b/exercises/saddle-points/README.md @@ -5,14 +5,14 @@ Detect saddle points in a matrix. So say you have a matrix like so: ```text - 0 1 2 + 1 2 3 |--------- -0 | 9 8 7 -1 | 5 3 2 <--- saddle point at column 0, row 1, with value 5 -2 | 6 6 7 +1 | 9 8 7 +2 | 5 3 2 <--- saddle point at column 1, row 2, with value 5 +3 | 6 6 7 ``` -It has a saddle point at column 0, row 1. +It has a saddle point at column 1, row 2. It's called a "saddle point" because it is greater than or equal to every element in its row and less than or equal to every element in