diff --git a/exercises/exercise-2.md b/exercises/exercise-2.md new file mode 100644 index 0000000000000000000000000000000000000000..a1400a23f1e23401a2c61a816b48a6f4bc6fbfeb --- /dev/null +++ b/exercises/exercise-2.md @@ -0,0 +1,121 @@ +# Exercise 2 + +Use the following commands to make a fresh clone of your repository: + +``` +git clone -b exercise-2 git@gitlab.epfl.ch:lamp/student-repositories-s22/cs206-GASPAR.git exercise-2 +``` + +Update the README.md file with your solutions. Don't forget to list the group members's SCIPER numbers. + +# Problem 1: Aggregate + +In this week's lecture, you have been introduced to the aggregate method of `ParSeq[A]` (and other parallel data structures...). It has the following signature: + +```scala +def aggregate[B](z: B)(f: (B, A) => B, g: (B, B) => B): B +``` + +Discuss, as a group, what aggregate does and what its arguments represent. + +## Question 1 + +Consider the parallel sequence `xs` containing the three elements `x1`, `x2` and `x3`. Also consider the following call to aggregate: + +```scala +xs.aggregate(z)(f, g) +``` + +The above call might potentially result in the following computation: + +```scala +f(f(f(z, x1), x2), x3) +``` + +But it might also result in other computations. Come up with at least 2 other computations that may result from the above call to `aggregate`. + +## Question 2 + +Below are other examples of calls to aggregate. In each case, check if the call can lead to different results depending on the strategy used by `aggregate` to aggregate all values contained in `data` down to a single value. You should assume that `data` is a parallel sequence of values of type `BigInt`. + +Variant 1 + +```scala +data.aggregate(1)(_ + _, _ + _) +``` + +Variant 2 + +```scala +data.aggregate(0)((acc, x) => x - acc, _ + _) +``` + +Variant 3 + +```scala +data.aggregate(0)((acc, x) => acc - x, _ + _) +``` + +Variant 4 + +```scala +data.aggregate(1)((acc, x) => x * x * acc, _ * _) +``` + +## Question 3 + +Under which condition(s) on `z`, `f`, and `g` does aggregate always lead to the same result? +Come up with a formula on `z`, `f`, and `g` that implies the correctness of aggregate. + +*Hint*: You may find it useful to use calls to `foldLeft(z)(f)` in your formula(s). + +## Question 4 + +Implement `aggregate` using the methods `map` and/or `reduce` of the collection you are defining aggregate for. + +## Question 5 + +Implement `aggregate` using the `task` and/or `parallel` constructs seen in the first week and the `Splitter[A]` interface seen in this week's lecture. The `Splitter` interface is defined as: + +```scala +trait Splitter[A] extends Iterator[A] { + def split: Seq[Splitter[A]] + def remaining: Int +} +``` + +You can assume that the data structure you are defining aggregate for already implements a `splitter` method which returns an object of type `Splitter[A]`. + +Your implementation of `aggregate` should work in parallel when the number of remaining elements is above the constant THRESHOLD and sequentially below it. + +*Hint*: `Iterator`, and thus `Splitter`, implements the `foldLeft` method. + +## Question 6 + +Discuss the implementations from questions 4 and 5. Which one do you think would be more efficient? + +# Problem 2: Depth + +Review the notion of depth seen in the lecture. What does it represent? + +Below is a formula for the depth of a *divide and conquer* algorithm working on an array segment of *size L*, as a function of *L*. The values *c*, *d* and *T* are constants. We assume that *L>0* and *T>0*. + + + +Below the threshold *T*, the algorithm proceeds sequentially and takes time *c* to process each single element. Above the threshold, the algorithm is applied recursively over the two halves of the array. The results are then merged using an operation that takes *d* units of time. + +## Question 1 + +Is it the case that for all *1 ≤ L1 ≤ L2* we have *D(L1) ≤ D(L2)*? + +If it is the case, prove the property by induction on *L*. If it is not the case, give a counterexample showing values of *L1*, *L2*, *T*, *c*, and *d* for which the property does not hold. + +## Question 2 + +Prove a logarithmic upper bound on *D(L)*. That is, prove that *D(L)* is in *O(log(L))* by finding specific constants *a*, *b* such that *D(L) ≤ a * log2(L) + b*. + +*Hint:* The proof is more complex that it might seem. One way to make it more manageable is to define and use a function *D'(L)* that has the property described in question 1, and is greater or equal to *D(L)*. We suggest you use: + + + +Also remark that computing *D'(L)* when *L* is a power of 2 is easy. Also remember that there always exists a power of 2 between any positive integer and its double. diff --git a/exercises/exercise-3.md b/exercises/exercise-3.md new file mode 100644 index 0000000000000000000000000000000000000000..2376fce137147f0da1f336bcd46c3034b126f499 --- /dev/null +++ b/exercises/exercise-3.md @@ -0,0 +1,137 @@ +# Exercise 3 + +Use the following commands to make a fresh clone of your repository: + +``` +git clone -b exercise-3 git@gitlab.epfl.ch:lamp/student-repositories-s22/cs206-GASPAR.git exercise-3 +``` + +Update the README.md file with your solutions. Don't forget to list the group members's SCIPER numbers. + +# Problem 1: Parallel Encoding + +In this exercise, your group will devise a parallel algorithm to encode sequences using the run-length encoding scheme. The encoding is very simple. It transforms sequences of letters such that all subsequences of the same letter are replaced by the letter and the sequence length. For instance: + +``` +"AAAAATTTGGGGTCCCAAC" ⇒ "A5T3G4T1C3A2C1" +``` + +Your goal in this exercise is to come up with a parallel implementation of this algorithm. The function should have the following shape: + +```scala +def rle(data: ParSeq[Char]): Buffer[(Char, Int)] = + data.aggregate(???)(???, ???) +``` + +The Buffer class is already given to you. A buffer of type `Buffer[A]` represents sequences of elements of type `A`. It supports the following methods, all of which are efficient: + +```scala +def isEmpty: Boolean // Checks if the buffer is empty. +def head: A // Returns the first element of the buffer. +def tail: Buffer[A] // Returns the buffer minus its first element. +def last: A // Returns the last element of the buffer. +def init: Buffer[A] // Returns the buffer minus its last element. +def ++(that: Buffer[A]): Buffer[A] // Concatenate two buffers. +def append(elem: A): Buffer[A] // Appends a single element to the right. + +Buffer.empty[A]: Buffer[A] // Returns an empty buffer. +Buffer.singleton[A](element: A): Buffer[A] // Single element buffer. +``` + +# Problem 2: Parallel Two Phase Construction + +In this exercise, you will implement an array Combiner using internally a double linked list (DLL). Below is a minimal implementation of the `DLLCombiner` class and the related `Node` class. Your goal for this exercise is to complete the implementation of the (simplified) Combiner interface of the `DLLCombiner` class. + +```scala +class DLLCombiner[A] extends Combiner[A, Array[A]] { + var head: Node[A] = null // null for empty lists. + var last: Node[A] = null // null for empty lists. + var size: Int = 0 + + // Implement these three methods... + override def +=(elem: A): Unit = ??? + override def combine(that: DLLCombiner[A]): DLLCombiner[A] = ??? + override def result(): Array[A] = ??? +} + +class Node[A](val value: A) { + var next: Node[A] // null for last node. + var previous: Node[A] // null for first node. +} +``` + +**Question 1:** What computational complexity do your methods have? Are the actual complexities of your methods acceptable according to the `Combiner` requirements? + +**Question 2:** One of the three methods you have implemented, `result`, should work in parallel according to the `Combiner` contract. Can you think of a way to implement this method efficiently using 2 parallel tasks? + +**Question 3:** Can you, given the current internal representation of your combiner, implement `result` so that it executes efficiently using 4 parallel tasks? If not, can you think of a way to make it possible? + +*Hint:* This is an open-ended question, there might be multiple solutions. In your solution, you may want to add extra information to the class Node and/or the class DLLCombiner. + +# Problem 3: Pipelines + +In this exercise, we look at pipelines of functions. A pipeline is simply a function which applies its argument successively to each function of a sequence. To illustrate this, consider the following pipeline of 4 functions: + +```scala +val p: Int => Int = toPipeline(ParSeq(_ + 1, _ * 2, _ + 3, _ / 4)) +``` + +The pipeline `p` is itself a function. Given a value `x`, the pipeline `p` will perform the following computations to process it. In the above example, + +```scala +p(x) = (((x + 1) Application of first function + * 2) Application of second function + + 3) Application of third function + / 4 Application of fourth function +``` + +In this exercise, we will investigate the possibility to process such pipelines in parallel. + +**Question 1:** Implement the following `toPipeline` function, which turns a parallel sequence of functions into a pipeline. You may use any of the parallel combinators available on `ParSeq`, such as the parallel `fold` or the parallel `reduce` methods. + +```scala +def toPipeline(fs: ParSeq[A => A]): A => A = ??? +``` + +*Hint:* Functions have a method called andThen, which implements function composition: it takes as argument another function and also returns a function. The returned function first applies the first function, and then applies the function passed as argument to that result. You may find it useful in your implementation of pipeline. + +**Question 2:** Given that your `toPipeline` function works in parallel, would the pipelines it returns also work in parallel? Would you expect pipelines returned by a sequential implementation of toPipeline to execute any slower? If so, why? + +Discuss those questions with your group and try to get a good understanding of what is happening. + +**Question 3:** Instead of arbitrary functions, we will now consider functions that are constant everywhere except on a finite domain. We represent such functions in the following way: + +```scala +class FiniteFun[A](mappings: immutable.Map[A, A], default: A) { + def apply(x: A): A = + mappings.get(x) match { + case Some(y) => y + case None => default + } + + def andThen(that: FiniteFun[A]): FiniteFun[A] = ??? +} +``` + +Implement the andThen method. Can pipelines of such finite functions be efficiently constructed in parallel using the appropriately modified `toPipeline` method? Can the resulting pipelines be efficiently executed? + +**Question 4:** Compare the *work* and *depth* of the following two functions, assuming infinite parallelism. For which kind of input would the parallel version be asymptotically faster? + +```scala +def applyAllSeq[A](x: A, fs: Seq[FiniteFun[A]]): A = { + // Applying each function sequentially. + var y = x + for (f <- fs) + y = f(y) + y +} + +def applyAllPar[A](x: A, fs: ParSeq[FiniteFun[A]]): A = + if (fs.isEmpty) x + else { + // Computing the composition in parallel. + val p = fs.reduce(_ andThen _) + // Applying the pipeline. + p(x) + } +``` diff --git a/labs/lab2-reductions-and-prefix-sums/README.md b/labs/lab2-reductions-and-prefix-sums/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c3099ea6be82b692fec6fac436445b5ab7fe4588 --- /dev/null +++ b/labs/lab2-reductions-and-prefix-sums/README.md @@ -0,0 +1,355 @@ +# Reductions and Prefix Sums + +Use the following commands to make a fresh clone of your repository: + +``` +git clone -b reductions git@gitlab.epfl.ch:lamp/student-repositories-s22/cs206-GASPAR.git cs206-reductions +``` + +## Useful links + + * [A guide to the Scala parallel collections](https://docs.scala-lang.org/overviews/parallel-collections/overview.html) + * [The API documentation of the Scala parallel collections](https://www.javadoc.io/doc/org.scala-lang.modules/scala-parallel-collections_2.13/latest/scala/collection/index.html) + * [The API documentation of the Scala standard library](https://www.scala-lang.org/files/archive/api/2.13.4) + * [The API documentation of the Java standard library](https://docs.oracle.com/en/java/javase/15/docs/api/index.html) + +**If you have issues with the IDE, try [reimporting the +build](https://gitlab.epfl.ch/lamp/cs206/-/blob/master/labs/example-lab.md#ide-features-like-type-on-hover-or-go-to-definition-do-not-work), +if you still have problems, use `compile` in sbt instead.** + +## Introduction + +In this assignment, you will implement several variants of reduction and prefix +sum algorithms. Each of the three parts of the assignment will exercise a +different aspect of parallel programming: + +- choosing the right parallelization threshold +- identifying the correct reduction operator +- identifying the correct prefix sum operator + +We will use the `parallel` construct, defined in the file `package.scala`, as in the lecture to start parallel +computations. Every `parallel` construct invocation takes two tasks as input and +outputs the corresponding results as a tuple of two elements. You are not allowed +to use the `task` construct in this assignment. + +## Parallel Counting Change + +If you took the course Functional Programming in Scala, you surely recall the +assignment in which you had to count the number of ways in which you can make +the change for a given amount of money. +The text of that assignment was as follows: + +> Write a recursive function that counts how many different ways you can +> make change for an amount, given a list of coin denominations. For +> example, there are 3 ways to give change for 4 if you have coins with +> denomination 1 and 2: 1+1+1+1, 1+1+2, 2+2. + +In this assignment, you will repeat the same task, but this time, your +implementation will be parallel. +Start with the sequential version of this problem once more -- the `countChange` +function takes the amount of money and the list of different coin denominations. +It returns the total number of different ways you can give change: + +```scala +def countChange(money: Int, coins: List[Int]): Int +``` + +Note that the solution to this problem is recursive. +In every recursive call, we either decide to continue subtracting the next coin +in the `coins` list from the `money` amount, or we decide to drop the coin from the list of coins. +For example, if we have 4 CHF, and coin denominations of 1 and 2, the call +graph, in which every node depicts one invocation of the `countChange` method, +is as follows: + + 4,[1, 2] + 3,[1, 2] + 4,[2] + 2,[1, 2] + 3,[2] 2,[2] + 4,[] + 1,[1, 2] + 2,[2] 1,[2] + 3,[] 0,[2] + 2,[] 0 + 0,[1, 2] + 1,[2] 1 0 0 1 0 + 1 0 + +We can take advantage of this recursive structure by evaluating different +subtrees in parallel. +This is the next part of the assignment -- implement the method `parCountChange` +that counts the amount of change in parallel: + +```scala +def parCountChange(money: Int, coins: List[Int], threshold: Threshold): Int +``` + +As we learned in the lectures, the `parCountChange` should not spawn parallel +computations after reaching the leaf in the call graph -- the synchronization +costs of doing this are way too high. +Instead, we need to *agglomerate* parts of the computation. +We do this by calling the sequential `countChange` method when we decide that +the amount of work is lower than a certain value, called the *threshold*. +To separate the concern of deciding on the threshold value from the +implementation of our parallel algorithm, we implement the threshold +functionality in a separate function, described by the `Threshold` type alias: + +```scala +type Threshold = (Int, List[Int]) => Boolean +``` + +When a `threshold` function returns `true` for a given amount of money and the +given list of coins, the sequential `countChange` implementation must be called. + +Implement `parCountChange`! + +Now that we have the `parCountChange` method, we ask ourselves what is the right +implementation of the `threshold` function? +Recall the examples from the lectures, such as summing the array values and +computing the norm, where this was easy -- we exactly knew the amount of work +required to traverse a subrange of the array, so `threshold` could return `true` +when the length of the subrange was smaller than a certain value. + +Sadly, the total amount of work for a given `parCountChange` invocation is hard +to evaluate from the remaining amount of money and a list of coins. +In fact, the amount of work directly corresponds to the count that +`parCountChange` returns, which is the value that we are trying to compute. +Counting change is a canonical example of a task-parallel problem in which the +partitioning the workload across processors is *solution-driven* -- to know how +to optimally partition the work, we would first need to solve the problem +itself. + +For this reason, many parallel algorithms in practice rely on heuristics to +assess the amount of work in a subtask. +We will implement several such heuristics in this exercise, and assess the +effect on performance. +First, implement the `moneyThreshold` method, which creates a threshold function +that returns `true` when the amount of money is less than or equal to `2 / 3` of +the starting amount: + +```scala +def moneyThreshold(startingMoney: Int): Threshold +``` + +Remember that `a / b` will return the integer division of `a` and `b` when both +operands are `Int`s. To avoid this problem, be sure to always do the multiplication of +`startingMoney` by `2` before doing the division by `3`. + +Now run the `ParallelCountChange` application in sbt and observe the speedup: + +``` +> runMain reductions.ParallelCountChangeRunner +``` + +The previous heuristic did not take into account how many coins were left on the +coins list, so try two other heuristics. +Implement the method `totalCoinsThreshold`, which returns a threshold function +that returns `true` when the number of coins is less than or equal to the `2 / 3` of the +initial number of coins: + +```scala +def totalCoinsThreshold(totalCoins: Int): Threshold +``` + +Again, be careful about the order of operations. + +Then, implement the method `combinedThreshold`, which returns a threshold +function that returns `true` when the amount of money multiplied with the number +of remaining coins is less than or equal to the starting money multiplied with +the initial number of coins divided by `2`: + +```scala +def combinedThreshold(startingMoney: Int, allCoins: List[Int]): Threshold +``` + +Which of the three threshold heuristics gives the best speedup? +Can you think of a heuristic that improves performance even more? + + +## Parallel Parentheses Balancing + +In this part of the assignment, we recall the Parenthesis Balancing assignment +that might be familiar to you from the Functional Programming in Scala course. +Here, the task is to, given an array of characters, decide if the parentheses in +the array are balanced. + +Let us recall a few examples of strings in which parentheses are correctly +balanced: + +``` +(if (zero? x) max (/ 1 x)) +I told him (that it's not (yet) done). (But he wasn't listening) +``` + +Similarly, the parentheses in the following strings are not balanced: + +``` +(o_() +:-) +())( +``` + +Implement a sequential function `balance`, which returns `true` iff the +parentheses in the array are balanced: + +```scala +def balance(chars: Array[Char]): Boolean +``` + +Next, you will implement a parallel version of this method. +By now, you're already an expert at implementing the structure of a reduction +algorithm, so you should have no problem there. +The tricky part in parallel parentheses balancing is choosing the reduction +operator -- you probably implemented `balance` by keeping an integer +accumulator, incrementing it for left parentheses and decrementing it for the +right ones, taking care that this accumulator does not drop below zero. +Parallel parentheses balancing will require a bit more ingenuity on your part, +so we will give you a hint -- you will need two integer values for the +accumulator. + +Implement the `parBalance` method, which checks if the parentheses in the input +array are balanced using two helper methods `reduce` and `traverse`. +These methods implement the parallel reduction and the sequential traversal +part, respectively: + +```scala +def parBalance(chars: Array[Char], threshold: Int): Boolean = { + def traverse(idx: Int, until: Int, _???_: Int, _???_: Int): ??? + + def reduce(from: Int, until: Int): ??? = ??? + + reduce(0, chars.length) == ??? +} +``` + +In this case, we again use the fixed threshold parameter, as we did in the +lectures. Sections with size smaller or equal to the threshold should be processed sequentially. +For maximum performance, use a `while` loop in the `traverse` method, or make +`traverse` tail-recursive -- do not use a `Range`. + +Now, run the `ParallelParenthesesBalancing` application from sbt: + +``` +> runMain reductions.ParallelParenthesesBalancingRunner +``` + +How large was your speedup? + +If you are looking for additional challenges, prove that your reduction operator +is associative! + + +## Line of Sight + +In the last part of the exercise, you will be implementing an entirely new +parallel algorithm -- you will apply the prefix sum algorithm to computing the +line-of-sight in two-dimensional terrain. + +Imagine that you are standing at the zero of a coordinate system. +The curve to your right describes the terrain that you are facing. +This is shown in the following figure: + + + +The task of the line-of-sight algorithm is to compute the visibility of each +point of the terrain, as shown in the following figure, where the visible area +is above of the full line, and the obscured terrain is shown with a dotted +line. + + + +What is the necessary and sufficient condition for a point on the terrain to be +visibile from the zero of the coordinate system, where you are standing? +Imagine that the terrain heights are represented with an array of numbers. +We can compute (the tangent of) the viewing angle of each point on the terrain by dividing the +height of the terrain `xs(i)` with the distance from the viewing point `i`, +as shown in the following figure: + + + +It turns out that if the viewing angle of some point B is **lower** than the +viewing angle of an earlier point A, then the point B is not visible, as shown +in the following figure: + + + +This simple realization allows us to easily compute the line-of-sight on the +terrain -- if you were a sequential programmer, you would traverse the array of +height values from the beginning to the end, and write the maximum angle seen so +far into the output array. + +Implement the sequential `lineOfSight` method, which, for each height entry in +the `input` array (except for input(0) which is the location of the observer and +is always zero), writes the maximum angle until that point into the `output` +array (output(0) should be 0): + +```scala +def lineOfSight(input: Array[Float], output: Array[Float]): Unit +``` + +We keep things simple -- instead of outputting an array of booleans denoting the +visibilities, we only output the angles. + +Note that what we call an angle in this assignment is actually the tangent +of the angle. Indeed, `xs(i)` is the opposing side of the angle and `i` the adjacent side. +The ratio `xs(i) / i` that you compute is in fact the tangent of the angle! +Since the tangent of an angle is strictly increasing between +0° and 90°, it is a perfectly good replacement for the actual angle in our use case. +Keep this in mind and make sure that you do not apply any trigonometic functions on the tangent! + +When we see a sequential algorithm that produces a sequence of values by +traversing the input from left to right, this is an indication that the +algorithm might have a parallel prefix sum variant. +So let's try to implement one! + +Recall what you learned in the lectures -- the first phase of the parallel +prefix sum algorithm is the *upsweep* phase. +Here, the algorithm constructs the reduction tree by traversing parts of the +input array in parallel. +Implement the method `upsweepSequential`, which returns the maximum angle in a +given part of the array, and the method `upsweep`, which returns the reduction +tree over parts of the input array. If the length of the given part of the input +array is less than or equal to `threshold`, then `upsweep` calls `upsweepSequential`. +Note that the part of the input array that needs to traversed is represented +using indices 'from' (inclusive) and 'until' (or 'end') (exclusive). + +```scala +def upsweepSequential(input: Array[Float], from: Int, until: Int): Float +``` + +```scala +def upsweep(input: Array[Float], from: Int, end: Int, threshold: Int): Tree +``` + +The `Tree` data type is either a `Leaf` or an inner `Node`, and it contains the +maximum angle in the corresponding part of the array. +Note that when the number of elements in a part of the input array, +which is `(end - from)`, is smaller or equal to the threshold, the sequential `upsweepSequential` +has to be invoked, and you should return a `Leaf`. +Otherwise, you should process the part of the input array in parallel, and return +a `Node`. Make sure that the work is evenly distributed between the parallel computations. + +The second phase is called *downsweep* -- here, the algorithm uses the tree to +push the maximum angle in the corresponding *prefix* of the array to the leaves +of the tree, and outputs the values. +Implement the methods `downsweep` which processes parts of the tree in parallel, +and the method `downsweepSequential`, which traverses the parts of the array +corresponding to leaves of the tree and writes the final angles into the +`output` array: + +```scala +def downsweep(input: Array[Float], output: Array[Float], + startingAngle: Float, tree: Tree): Unit + +def downsweepSequential(input: Array[Float], output: Array[Float], + startingAngle: Float, from: Int, until: Int): Unit +``` + +Finally, implement `parLineOfSight` using the `upsweep` and `downsweep` methods: + +```scala +def parLineOfSight(input: Array[Float], output: Array[Float], + threshold: Int): Unit +``` + +Now, run the `LineOfSight` application in sbt and observe the relative speedups: + +``` +> runMain reductions.LineOfSightRunner +``` + +How large is the speedup compared to the number of cores in your processor? +Can you explain your results? diff --git a/labs/lab2-reductions-and-prefix-sums/angle-example-2.svg b/labs/lab2-reductions-and-prefix-sums/angle-example-2.svg new file mode 100644 index 0000000000000000000000000000000000000000..bd478938260a921b527b14d622e57d7f951c8da3 --- /dev/null +++ b/labs/lab2-reductions-and-prefix-sums/angle-example-2.svg @@ -0,0 +1,209 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="angle-example-2.svg" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\progfun\instructions\angle2.png" + inkscape:export-xdpi="32.263699" + inkscape:export-ydpi="32.263699"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Lstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4146" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) translate(12.5,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4149" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.9899495" + inkscape:cx="488.53326" + inkscape:cy="701.51987" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" + inkscape:snap-text-baseline="false" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow1Lstart)" + d="m 142.85714,101.50506 0,298.57143" + id="path3336" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.8496573;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 142.85714,399.21935 668.06991,0" + id="path3340" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:3,3;stroke-dashoffset:0" + d="m 143.44166,399.80366 c 88.89343,-20.20305 105.05587,-39.39595 105.05587,-39.39595" + id="path4640" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,3;stroke-opacity:1;stroke-dashoffset:0" + d="m 248.24499,360.5773 c 0,0 34.72027,-23.20876 57.95379,-32.30013 39.28467,-15.37226 57.45614,8.89703 57.45614,8.89703 19.69797,32.32488 43.43656,27.27412 55.55839,8.08122 l 12.12183,-19.1929 0,0 c 40.4061,-86.87311 77.78174,-113.13708 77.78174,-113.13708 0,0 18.22571,-16.58543 45.38508,0.61276 28.26715,17.89967 41.48804,62.0167 41.48804,62.0167" + id="path4642" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cscscccsc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,3;stroke-opacity:1;stroke-dashoffset:0" + d="m 595.70683,274.55743 c 0,0 12.08157,73.3608 31.09283,77.76906 28.85051,6.68975 48.99239,-25.75889 48.99239,-25.75889 0,0 17.42513,-17.42513 27.27412,-14.89975 9.84899,2.52538 30.50526,33.55149 30.50526,33.55149" + id="path4752" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cscsc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="M 142.85714,398.79078 500,221.64792" + id="path4832" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:6,3;stroke-dashoffset:0" + d="m 501.03566,222.01682 0,176.77669" + id="path5388" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path5390" + d="m 142.43151,219.99652 358.60415,-1e-5" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="310.11682" + y="200.8036" + id="text5392" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5394" + x="310.11682" + y="200.8036">i</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5396" + y="293.73761" + x="504.0661" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="293.73761" + x="504.0661" + id="tspan5398" + sodipodi:role="line">xs(i)</tspan></text> + <path + inkscape:connector-curvature="0" + id="path3357" + d="m 632.35549,355.35695 0,41.41625" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:6,3;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.48477578;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:6.96955149, 3.48477574;stroke-dashoffset:0;stroke-opacity:1" + d="m 148.49243,353.35696 483.86306,-1e-5" + id="path3359" + inkscape:connector-curvature="0" /> + <text + sodipodi:linespacing="125%" + id="text3361" + y="347.29602" + x="458.60925" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="347.29602" + x="458.60925" + id="tspan3363" + sodipodi:role="line">i'</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="637.40619" + y="385.66147" + id="text3365" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3367" + x="637.40619" + y="385.66147">xs(i')</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="486.89352" + y="201.81377" + id="text4181" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4183" + x="486.89352" + y="201.81377">A</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="625.28442" + y="344.24527" + id="text4185" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4187" + x="625.28442" + y="344.24527">B</tspan></text> + </g> +</svg> diff --git a/labs/lab2-reductions-and-prefix-sums/angle-example.svg b/labs/lab2-reductions-and-prefix-sums/angle-example.svg new file mode 100644 index 0000000000000000000000000000000000000000..fd674128904de49c6b165b094b478f33c029f64b --- /dev/null +++ b/labs/lab2-reductions-and-prefix-sums/angle-example.svg @@ -0,0 +1,154 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="angle-example.svg" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\progfun\instructions\angle.png" + inkscape:export-xdpi="32.263699" + inkscape:export-ydpi="32.263699"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Lstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4146" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) translate(12.5,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4149" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.9899495" + inkscape:cx="488.53326" + inkscape:cy="701.51987" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" + inkscape:snap-text-baseline="false" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow1Lstart)" + d="m 142.85714,101.50506 0,298.57143" + id="path3336" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.8496573;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 142.85714,399.21935 668.06991,0" + id="path3340" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:3,3;stroke-dashoffset:0" + d="m 143.44166,399.80366 c 88.89343,-20.20305 105.05587,-39.39595 105.05587,-39.39595" + id="path4640" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,3;stroke-opacity:1;stroke-dashoffset:0" + d="m 248.24499,360.5773 c 0,0 34.72027,-23.20876 57.95379,-32.30013 39.28467,-15.37226 57.45614,8.89703 57.45614,8.89703 19.69797,32.32488 43.43656,27.27412 55.55839,8.08122 l 12.12183,-19.1929 0,0 c 40.4061,-86.87311 77.78174,-113.13708 77.78174,-113.13708 0,0 18.22571,-16.58543 45.38508,0.61276 28.26715,17.89967 41.48804,62.0167 41.48804,62.0167" + id="path4642" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cscscccsc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,3;stroke-opacity:1;stroke-dashoffset:0" + d="m 595.70683,274.55743 c 0,0 12.08157,73.3608 31.09283,77.76906 28.85051,6.68975 48.99239,-25.75889 48.99239,-25.75889 0,0 17.42513,-17.42513 27.27412,-14.89975 9.84899,2.52538 30.50526,33.55149 30.50526,33.55149" + id="path4752" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cscsc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="M 142.85714,398.79078 500,221.64792" + id="path4832" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:6,3;stroke-dashoffset:0" + d="m 501.03566,222.01682 0,176.77669" + id="path5388" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path5390" + d="m 142.43151,219.99652 358.60415,-1e-5" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="310.11682" + y="200.8036" + id="text5392" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5394" + x="310.11682" + y="200.8036">i</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5396" + y="326.0625" + x="506.0864" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="326.0625" + x="506.0864" + id="tspan5398" + sodipodi:role="line">xs(i)</tspan></text> + </g> +</svg> diff --git a/labs/lab2-reductions-and-prefix-sums/angle.png b/labs/lab2-reductions-and-prefix-sums/angle.png new file mode 100644 index 0000000000000000000000000000000000000000..50a8cc00497fa82cbb7442ac40ddd56b88dc9885 Binary files /dev/null and b/labs/lab2-reductions-and-prefix-sums/angle.png differ diff --git a/labs/lab2-reductions-and-prefix-sums/angle2.png b/labs/lab2-reductions-and-prefix-sums/angle2.png new file mode 100644 index 0000000000000000000000000000000000000000..d5b4fccface66a660bcee7539458198423fb674e Binary files /dev/null and b/labs/lab2-reductions-and-prefix-sums/angle2.png differ diff --git a/labs/lab2-reductions-and-prefix-sums/terrain.png b/labs/lab2-reductions-and-prefix-sums/terrain.png new file mode 100644 index 0000000000000000000000000000000000000000..11ba1b6f55b18bdd7d93e73c3e751739eaf1be32 Binary files /dev/null and b/labs/lab2-reductions-and-prefix-sums/terrain.png differ diff --git a/labs/lab2-reductions-and-prefix-sums/terrain.svg b/labs/lab2-reductions-and-prefix-sums/terrain.svg new file mode 100644 index 0000000000000000000000000000000000000000..d9073e066c7e53114119200db0a88d9084909c11 --- /dev/null +++ b/labs/lab2-reductions-and-prefix-sums/terrain.svg @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="terain.svg"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Lstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4146" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) translate(12.5,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4149" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.49497475" + inkscape:cx="363.63782" + inkscape:cy="644.8613" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow1Lstart)" + d="m 142.85714,101.50506 0,298.57143" + id="path3336" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.8496573;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 142.85714,399.21935 668.06991,0" + id="path3340" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="m 143.44166,399.80366 c 88.89343,-20.20305 105.05587,-39.39595 105.05587,-39.39595" + id="path4640" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 248.24499,360.5773 c 0,0 34.72027,-23.20876 57.95379,-32.30013 39.28467,-15.37226 57.45614,8.89703 57.45614,8.89703 19.69797,32.32488 43.43656,27.27412 55.55839,8.08122 l 12.12183,-19.1929 0,0 c 40.4061,-86.87311 77.78174,-113.13708 77.78174,-113.13708 0,0 18.22571,-16.58543 45.38508,0.61276 28.26715,17.89967 41.48804,62.0167 41.48804,62.0167" + id="path4642" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cscscccsc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 595.70683,274.55743 c 0,0 12.08157,73.3608 31.09283,77.76906 28.85051,6.68975 48.99239,-25.75889 48.99239,-25.75889 0,0 17.42513,-17.42513 27.27412,-14.89975 9.84899,2.52538 30.50526,33.55149 30.50526,33.55149" + id="path4752" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cscsc" /> + </g> +</svg> diff --git a/labs/lab2-reductions-and-prefix-sums/visibility.png b/labs/lab2-reductions-and-prefix-sums/visibility.png new file mode 100644 index 0000000000000000000000000000000000000000..9a26107e64f77f3a6d217f5ea80e0cffdb8127d8 Binary files /dev/null and b/labs/lab2-reductions-and-prefix-sums/visibility.png differ diff --git a/labs/lab2-reductions-and-prefix-sums/visibility.svg b/labs/lab2-reductions-and-prefix-sums/visibility.svg new file mode 100644 index 0000000000000000000000000000000000000000..e4f1882336cea5d065a7d1f96c00e5de991a77ae --- /dev/null +++ b/labs/lab2-reductions-and-prefix-sums/visibility.svg @@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="visibility.svg"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Lstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4146" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) translate(12.5,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4149" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="450.29691" + inkscape:cy="792.75432" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow1Lstart)" + d="m 142.85714,101.50506 0,298.57143" + id="path3336" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.8496573;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 142.85714,399.21935 668.06991,0" + id="path3340" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 143.44166,399.80366 C 229.1208,389.60061 247.60467,362.19342 247.60467,362.19342" + id="path4640" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 247.12126,362.59389 c 0,0 35.844,-25.22535 59.07752,-34.31672 50.7702,-20.12943 91.36602,-35.89748 158.70779,-62.92894 2.54896,-14.01596 48.13888,-55.27993 48.13888,-55.27993" + id="path4642" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3, 3;stroke-dashoffset:0;stroke-opacity:1" + d="m 594.1916,275.56758 c 0,0 12.08157,73.3608 31.09283,77.76906 28.85051,6.68975 48.99239,-25.75889 48.99239,-25.75889 0,0 17.42513,-17.42513 27.27412,-14.89975 9.84899,2.52538 30.50526,33.55149 30.50526,33.55149" + id="path4752" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cscsc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 312.07723,326.23693 465.71429,265.21935" + id="path4754" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 511.25,211.11221 742.85714,79.505061" + id="path4756" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cscscccsc" + inkscape:connector-curvature="0" + id="path4758" + d="m 245.5023,364.2185 c 0,0 35.844,-25.22535 59.07752,-34.31672 39.28467,-15.37226 57.45614,8.89703 57.45614,8.89703 19.69797,32.32488 43.43656,27.27412 55.55839,8.08122 l 12.12183,-19.1929 0,0 c 40.4061,-86.87311 77.78174,-113.13708 77.78174,-113.13708 0,0 18.22571,-16.58543 45.38508,0.61276 28.26715,17.89967 41.48804,62.0167 41.48804,62.0167" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3, 3;stroke-dashoffset:0;stroke-opacity:1" /> + </g> +</svg> diff --git a/labs/lab3-k-means/README.md b/labs/lab3-k-means/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8ea1885845997922c2a8dd14bd1b154a87080ce4 --- /dev/null +++ b/labs/lab3-k-means/README.md @@ -0,0 +1,265 @@ +# K-Means + +Use the following commands to make a fresh clone of your repository: + +``` +git clone -b kmeans git@gitlab.epfl.ch:lamp/student-repositories-s22/cs206-GASPAR.git cs206-kmeans +``` + +## Useful links + + * [A guide to the Scala parallel collections](https://docs.scala-lang.org/overviews/parallel-collections/overview.html) + * [The API documentation of the Scala parallel collections](https://www.javadoc.io/doc/org.scala-lang.modules/scala-parallel-collections_2.13/latest/scala/collection/index.html) + * [The API documentation of the Scala standard library](https://www.scala-lang.org/files/archive/api/2.13.4) + * [The API documentation of the Java standard library](https://docs.oracle.com/en/java/javase/15/docs/api/index.html) + +**If you have issues with the IDE, try [reimporting the +build](https://gitlab.epfl.ch/lamp/cs206/-/blob/master/labs/example-lab.md#ide-features-like-type-on-hover-or-go-to-definition-do-not-work), +if you still have problems, use `compile` in sbt instead.** + +## Introduction + +In this assignment, you will implement the K-means algorithm for cluster +detection, which is used to partition *n* vectors into *k* clusters. +Here, vectors are separated into clusters based on their mutual similarity -- +vectors that are closer to each other in space are more likely to end up in the +same cluster, and the distant vectors are likely to be in different clusters. +K-means has many applications: it is used in data mining, image filtering and +signal processing. + +Here is a simple example -- let's say that we have a set of vectors in 2D space, +as shown in the following figure: + + + +As a human, you can visually distinguish the three clusters of points in the +image: + + + +When the number of clusters, dimensions and vectors grows, it becomes difficult +and even impossible to manually determine the clusters. +K-means is a simple algorithm that takes a set of vectors (called *points*) and +outputs as set of clusters as follows: + +1. Pick `k` points called *means*. This is called *initialization*. +2. Associate each input point with the *mean* that is closest to it. + We obtain `k` *clusters* of points, and we refer to this process as + *classifying* the points. +3. Update each mean to have the average value of the corresponding cluster. +4. If the `k` means have significantly changed, go back to step 2. + If they did not, we say that the algorithm *converged*. +5. The `k` means represent different clusters -- every point is in the cluster + corresponding to the closest mean. + +Above, two steps need additional discussion. +First, how do we pick the initial `k` means? +The initialization step can be done in many different ways -- we will just +randomly pick some of the input vectors. +Second, how do we know that the algorithm converged? +We will check that, for each mean, the square distance between the old value of +the mean and the new value of the mean is less than or equal to some value +`eta`. + +For a better illustration, here are a few steps of the K-means algorithm. +Initially, we pick a random set of means, shown with "X" in the figure: + + + +Then, we classify the points according to the closest mean ("X"). +The means divide the space into regions, where each point is closer to the +corresponding mean than any other mean -- in the figure, the dotted line depicts +the borders of different regions: + + + +All the points in the same region form one cluster. After having classified the +points, we can update the mean values to the average of all the points in the +cluster: + + + +Each of the means was significantly updated. +This is a good indication that the algorithm did not yet converge, +so we repeat the steps again -- we first classify all the points: + + + +And then we update the means again: + + + +One of the means did not change at all in the last step. +Still, other means have changed so we continue this process until the change +in the position of each point drops below the `eta` value. + +At each iteration of K-means, we can associate multiple points to clusters, +and compute the average of the `k` clusters, in parallel. +Note that the association of a point to its cluster is independent of the +other points in the input, and similarly, the computation of the average of a cluster +is independent of the other clusters. +Once all parallel tasks of the current iteration complete, +the algorithm can proceed to the next iteration. + +K-means is an example of a *bulk synchronous parallel* algorithm (BSP). +BSP algorithms are composed from a sequence of supersteps, each of which +contains: + +- *parallel computation*, in which processes independently perform local + computations and produce some values +- *communication*, in which processes exchange data +- *barrier synchronisation*, during which processes wait until every process + finishes + +Data-parallel programming models are typically a good fit for BSP algorithms, +as each bulk synchronous phase can correspond to some number of data-parallel +operations. + + +## Classifying the points + +In the first part of this assignment, you will classify the input points +according to the square distance to the means. +Input points are described with the following `Point` data-type: + + class Point(val x: Double, val y: Double, val z: Double) + +You will start by implementing the `classify` method: + + def classify(points: ParSeq[Point], means: ParSeq[Point]): ParMap[Point, ParSeq[Point]] + +This method take a sequence of points and a sequence of means, and return +a map collection, which maps each mean to the sequence of points in the corresponding +cluster. + +Hint: Use `groupBy` and the `findClosest` method, which is already defined for +you. After that, make sure that all the means are in the resulting map, even if their +sequences are empty. + + +## Updating the means + +In the second part of this assignment, you will update the means corresponding +to different clusters. + +Implement the method `update`, which takes the map of classified points produced +in the previous step, and the sequence of previous means. +The method returns the new sequence of means: + + def update(classified: ParMap[Point, ParSeq[Point]], oldMeans: ParSeq[Point]): ParSeq[Point] + +Take care to preserve order in the resulting sequence -- the mean `i` in +the resulting sequence must correspond to the mean `i` from `oldMeans`. + +Hint: Make sure you use the `findAverage` method that is predefined for you. + + +## Detecting convergence + +Finally, you will implement convergence detection. +The convergence detection method takes a sequence of old +means and the sequence of updated means, and returns a boolean indicating if the +algorithm converged or not. +Given an `eta` parameter, `oldMeans` and `newMeans`, it returns `true` if the +algorithm converged, and `false` otherwise: + + def converged(eta: Double, oldMeans: ParSeq[Point], newMeans: ParSeq[Point]) + +The algorithm converged iff the square distance between the old and the new mean is less +than or equal to `eta`, for all means. + +Note: the means in the two lists are ordered -- the mean at `i` in `oldMeans` +is the previous value of the mean at `i` in `newMeans`. + +Implement `converged`! + + +## Running the algorithm + +We now have everything we need to run the K-means algorithm. +We only need to combine the previously defined methods in the right way. + +The tail-recursive `kMeans` method takes a sequence of +points `points`, previously computed sequence of means `means`, and the `eta` +value: + + @tailrec final def kMeans(points: ParSeq[Point], + means: ParSeq[Point], eta: Double): ParSeq[Point] + +The `kMeans` method should return the sequence of means, +each corresponding to a specific cluster. + +Hint: `kMeans` implements the steps 2-4 from the K-means pseudocode. + +You can use the following command from within `sbt` to benchmark your code, the +parallel time shoul be significantly faster than the sequential time if your +computer has more than one core: + + > runMain kmeans.KMeansRunner + + +## Use cases + +And now for the fun part -- the K-means algorithm has a lot of use-cases! + +In image processing applications, it can be used to reduce the size of the +color palette, thus compressing the image. This is done by turning a +[true color image](http://en.wikipedia.org/wiki/Color_depth), where each pixel +is encoded into 32 bits, into [indexed color](http://en.wikipedia.org/wiki/Indexed_color), +where each pixel can be encoded with just a few bits. This is done by using k-means to +"cluster" the important colors in the image, thus reducing its palette from +24-bit (`2^24` colors) to just 32 indexed colors, chosen from the 24-bit palette. +Here, pixels from the image are the input vectors, +and their coordinates are the different color channels. + +This is the original true color (24-bit) image: + + + +And this is the indexed color (32 colors) version of it: + + + +So, thanks to your k-means implementation, ScalaShop can now compress images! +You can start ScalaShop by invoking from `sbt`: + + > runMain kmeans.fun.ScalaShop + +The k-means algorithm is very sensitive to the initial choice of means. There +are three choice strategies implemented in ScalaShop: + +* `Uniform Choice` is the simplest strategy. It chooses `n` colors uniformly in +the entire color space, regardless of the colors used in the image. If the image +has a dominant color, the means created by this strategy will likely be very far +away from the clusters formed by this dominant color. You can try setting the +`Uniform Choice` strategy with 1, 10 and 30 steps. You will notice the initial +choice is quite bad, but the quality improves as the k-means algorithm is applied +in more steps. +* `Random Sampling` is another simple strategy, but with better results. For the +initial means, it randomly samples `n` colors from the image. This yields good +results if the image has few dominant colors, but it cannot handle subtle nuances +in the image. Again, if you try this strategy with 1, 10 and 30 k-means iteration +steps, you will notice improvements as the k-means algorithm is ran more. +* `Uniform Random` is the most complex strategy to pick means, but it also produces +the best results. It works by uniformly splitting the color space in sub-spaces. +It then counts the number of pixels that have colors belonging to that sub-space. +Based on this number, it chooses a proportional number of means in the sub-space, +by randomly sampling from the pixels in that sub-space. Therefore, if your image +has dominant colors, this strategy will drop a proportional number of means for +each dominant color, thus allowing the k-means algorithm to capture fine nuances. + +In the EPFL image now available in ScalaShop, the mountains are a good way to see +how well each initial choice of means fares. You also have different strategies +for deciding convergence: + +* `Steps` allows to run a fixed number of steps. After this, the k-means algorithm +is stopped. +* `Eta` corresponds to the means stability, as we showed earlier: if the +means did not move much since the last iteration, the result is considered stable. +* `Sound-to-noise` ratio is a more refined convergence strategy, which does not settle +for stability but tries to minimize the difference between the true color image +and the index color one. This strategy goes beyond `Eta`, but high Sound-to-noise +ratios will prevent the k-means algorithm from finishing! + +With this in mind, enjoy ScalaShop, the ultimate image manipulation tool and +the nice, warm, sunny photo of EPFL! diff --git a/labs/lab3-k-means/clusters.png b/labs/lab3-k-means/clusters.png new file mode 100644 index 0000000000000000000000000000000000000000..1f3bdf3729d54356d8040e2d1e561da35c980ece Binary files /dev/null and b/labs/lab3-k-means/clusters.png differ diff --git a/labs/lab3-k-means/clusters.svg b/labs/lab3-k-means/clusters.svg new file mode 100644 index 0000000000000000000000000000000000000000..c615e29752918ff7d747daa4706fb5f9a7e5ec8b --- /dev/null +++ b/labs/lab3-k-means/clusters.svg @@ -0,0 +1,290 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\clusters.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="clusters.svg"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient7516"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7518" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop7520" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7522" + cx="208.57138" + cy="248.07649" + fx="208.57138" + fy="248.07649" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(19.192898,14.142136)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7524" + cx="204.28568" + cy="378.07651" + fx="204.28568" + fy="378.07651" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-16.162441,-5.0507627)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7526" + cx="171.42856" + cy="326.64792" + fx="171.42856" + fy="326.64792" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(67.680221,14.142136)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7528" + cx="128.57144" + cy="382.36221" + fx="128.57144" + fy="382.36221" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(173.74624,-79.802054)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7530" + cx="98.571434" + cy="316.64792" + fx="98.571434" + fy="316.64792" + r="11.25" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="407.41238" + inkscape:cy="632.82609" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:url(#radialGradient7530);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:url(#radialGradient7528);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:url(#radialGradient7526);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:url(#radialGradient7524);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:url(#radialGradient7522);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <ellipse + style="fill:none;fill-opacity:0.29677417;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:7.5,2.5;stroke-dashoffset:0;stroke-opacity:1" + id="path7554" + cx="210.61681" + cy="311.41531" + rx="177.28177" + ry="122.73354" /> + <ellipse + ry="122.91036" + rx="130.4865" + cy="191.20717" + cx="534.37073" + id="ellipse7556" + style="fill:none;fill-opacity:0.29677417;stroke:#000000;stroke-width:2.14636397;stroke-miterlimit:4;stroke-dasharray:6.43909181, 2.14636394;stroke-dashoffset:0;stroke-opacity:1" /> + <ellipse + style="fill:none;fill-opacity:0.29677417;stroke:#000000;stroke-width:1.89697337;stroke-miterlimit:4;stroke-dasharray:5.69092025, 1.89697342;stroke-dashoffset:0;stroke-opacity:1" + id="ellipse7558" + cx="520.73364" + cy="473.03973" + rx="101.82184" + ry="123.03506" /> + </g> +</svg> diff --git a/labs/lab3-k-means/points.png b/labs/lab3-k-means/points.png new file mode 100644 index 0000000000000000000000000000000000000000..5584dba6d2bae31eb6e5627089acaed405fbf130 Binary files /dev/null and b/labs/lab3-k-means/points.png differ diff --git a/labs/lab3-k-means/points.svg b/labs/lab3-k-means/points.svg new file mode 100644 index 0000000000000000000000000000000000000000..f9ae8e6c80581c5c5055979e9e0af77531036843 --- /dev/null +++ b/labs/lab3-k-means/points.svg @@ -0,0 +1,270 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\points.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="points.svg"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient7516"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7518" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop7520" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7522" + cx="208.57138" + cy="248.07649" + fx="208.57138" + fy="248.07649" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(19.192898,14.142136)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7524" + cx="204.28568" + cy="378.07651" + fx="204.28568" + fy="378.07651" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-16.162441,-5.0507627)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7526" + cx="171.42856" + cy="326.64792" + fx="171.42856" + fy="326.64792" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(67.680221,14.142136)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7528" + cx="128.57144" + cy="382.36221" + fx="128.57144" + fy="382.36221" + r="11.25" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(173.74624,-79.802054)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient7516" + id="radialGradient7530" + cx="98.571434" + cy="316.64792" + fx="98.571434" + fy="316.64792" + r="11.25" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="407.41238" + inkscape:cy="632.82609" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:url(#radialGradient7530);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:url(#radialGradient7528);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:url(#radialGradient7526);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:url(#radialGradient7524);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:url(#radialGradient7522);fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + </g> +</svg> diff --git a/labs/lab3-k-means/start.png b/labs/lab3-k-means/start.png new file mode 100644 index 0000000000000000000000000000000000000000..2201ffd533d0848deb569862a90a871d9e9f6d8c Binary files /dev/null and b/labs/lab3-k-means/start.png differ diff --git a/labs/lab3-k-means/step0.png b/labs/lab3-k-means/step0.png new file mode 100644 index 0000000000000000000000000000000000000000..97668674d5d95b560abcd018225499e141747edc Binary files /dev/null and b/labs/lab3-k-means/step0.png differ diff --git a/labs/lab3-k-means/step0.svg b/labs/lab3-k-means/step0.svg new file mode 100644 index 0000000000000000000000000000000000000000..c73a7130473f6498f7405a223fcce1edd3995891 --- /dev/null +++ b/labs/lab3-k-means/step0.svg @@ -0,0 +1,239 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\clusters.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step0.svg"> + <defs + id="defs4"> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="407.41238" + inkscape:cy="632.82609" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875067px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="196.82574" + y="608.31287" + id="text7568" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7570" + x="196.82574" + y="608.31287">X</tspan></text> + <text + transform="scale(1.1239557,0.8897148)" + sodipodi:linespacing="125%" + id="text7572" + y="424.38351" + x="521.27362" + style="font-style:normal;font-weight:bold;font-size:35.58875047px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + xml:space="preserve"><tspan + y="424.38351" + x="521.27362" + id="tspan7574" + sodipodi:role="line">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875084px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="321.75165" + y="257.48459" + id="text7576" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7578" + x="321.75165" + y="257.48459">X</tspan></text> + </g> +</svg> diff --git a/labs/lab3-k-means/step1.png b/labs/lab3-k-means/step1.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce72d8c0c36d2aa84a222e570cdd9582f4dfc8a Binary files /dev/null and b/labs/lab3-k-means/step1.png differ diff --git a/labs/lab3-k-means/step1.svg b/labs/lab3-k-means/step1.svg new file mode 100644 index 0000000000000000000000000000000000000000..e210b991b67e1f4a226ff3769bd30339de18b0b7 --- /dev/null +++ b/labs/lab3-k-means/step1.svg @@ -0,0 +1,257 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\clusters.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step1.svg"> + <defs + id="defs4"> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="407.41238" + inkscape:cy="632.82609" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875067px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="196.82574" + y="608.31287" + id="text7568" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7570" + x="196.82574" + y="608.31287">X</tspan></text> + <text + transform="scale(1.1239557,0.8897148)" + sodipodi:linespacing="125%" + id="text7572" + y="424.38351" + x="521.27362" + style="font-style:normal;font-weight:bold;font-size:35.58875047px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + xml:space="preserve"><tspan + y="424.38351" + x="521.27362" + id="tspan7574" + sodipodi:role="line">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875084px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="321.75165" + y="257.48459" + id="text7576" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7578" + x="321.75165" + y="257.48459">X</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 29.294424,236.15895 387.89857,389.70213" + id="path7612" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 386.88842,387.68183 535.38085,689.71744" + id="path7614" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 386.88843,389.70213 622.25396,144.23507" + id="path7616" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + </g> +</svg> diff --git a/labs/lab3-k-means/step2.png b/labs/lab3-k-means/step2.png new file mode 100644 index 0000000000000000000000000000000000000000..6cdc2c8e9732a38680b5642ac817b8539815b06f Binary files /dev/null and b/labs/lab3-k-means/step2.png differ diff --git a/labs/lab3-k-means/step2.svg b/labs/lab3-k-means/step2.svg new file mode 100644 index 0000000000000000000000000000000000000000..db6e99dac1722683bc4c5f76439fbbdbe8088027 --- /dev/null +++ b/labs/lab3-k-means/step2.svg @@ -0,0 +1,408 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\clusters.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step2.svg"> + <defs + id="defs4"> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker10709" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path10711" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker9251" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path9253" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4153" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow2Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow2Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4165" + style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " + transform="scale(1.1) rotate(180) translate(1,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker8251" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path8253" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + id="linearGradient8215"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop8217" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop8219" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend" + inkscape:collect="always"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient8215" + id="linearGradient8221" + x1="119.05175" + y1="385.33261" + x2="145.39577" + y2="385.33261" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.67277217" + inkscape:cx="372.04724" + inkscape:cy="526.1811" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875067px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="196.82574" + y="608.31287" + id="text7568" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7570" + x="196.82574" + y="608.31287">X</tspan></text> + <text + transform="scale(1.1239557,0.8897148)" + sodipodi:linespacing="125%" + id="text7572" + y="424.38351" + x="521.27362" + style="font-style:normal;font-weight:bold;font-size:35.58875047px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + xml:space="preserve"><tspan + y="424.38351" + x="521.27362" + id="tspan7574" + sodipodi:role="line">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:bold;font-size:35.58875084px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'sans-serif, Bold';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;" + x="321.75165" + y="257.48459" + id="text7576" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + sodipodi:role="line" + id="tspan7578" + x="321.75165" + y="257.48459">X</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 29.294424,236.15895 387.89857,389.70213" + id="path7612" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 386.88842,387.68183 535.38085,689.71744" + id="path7614" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:7.5,7.5;stroke-dashoffset:0" + d="M 386.88843,389.70213 622.25396,144.23507" + id="path7616" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8211" + y="385.78098" + x="145.59712" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="385.78098" + x="145.59712" + id="tspan8213" + sodipodi:role="line" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="363.9928" + y="221.1528" + id="text8235" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1" + sodipodi:role="line" + id="tspan8237" + x="363.9928" + y="221.1528">X</tspan></text> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8239" + y="556.086" + x="465.5513" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="556.086" + x="465.5513" + id="tspan8241" + sodipodi:role="line" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1">X</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:12, 6;stroke-opacity:1;marker-end:url(#Arrow1Mend);stroke-dashoffset:0" + d="M 188.36461,528.28085 C 127.91334,484.20672 112.42805,448.37274 158.00235,365.76166" + id="path8243" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path9249" + d="M 377.1358,198.30287 C 333.03479,124.501 411.1919,113.9356 415.14736,162.1266" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:12, 6;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker9251)" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path10707" + d="m 617.93054,393.01961 c 22.78642,45.10911 13.24668,80.62172 -58.60362,88.68026" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:12, 6;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker10709)" /> + </g> +</svg> diff --git a/labs/lab3-k-means/step3.png b/labs/lab3-k-means/step3.png new file mode 100644 index 0000000000000000000000000000000000000000..a0f1e2f4e887a1b4aa6b7d785bdfa7334171de4e Binary files /dev/null and b/labs/lab3-k-means/step3.png differ diff --git a/labs/lab3-k-means/step3.svg b/labs/lab3-k-means/step3.svg new file mode 100644 index 0000000000000000000000000000000000000000..b4a9fec9e230fa8cf73bc23b12e26d9b9541465b --- /dev/null +++ b/labs/lab3-k-means/step3.svg @@ -0,0 +1,353 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\step3.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step3.svg"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4153" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker10709" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path10711" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker9251" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path9253" /> + </marker> + <marker + inkscape:stockid="Arrow2Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow2Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4165" + style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " + transform="scale(1.1) rotate(180) translate(1,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker8251" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path8253" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + id="linearGradient8215"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop8217" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop8219" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend" + inkscape:collect="always"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient8215" + id="linearGradient8221" + x1="119.05175" + y1="385.33261" + x2="145.39577" + y2="385.33261" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.67277217" + inkscape:cx="372.04724" + inkscape:cy="526.1811" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="M 189.82425,65.224411 387.89857,389.70213" + id="path7612" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="m 386.88842,387.68183 -171.08084,349.6" + id="path7614" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="M 386.88843,389.70213 736.70578,221.52721" + id="path7616" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8211" + y="385.78098" + x="145.59712" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + xml:space="preserve"><tspan + y="385.78098" + x="145.59712" + id="tspan8213" + sodipodi:role="line" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + x="363.9928" + y="221.1528" + id="text8235" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;" + sodipodi:role="line" + id="tspan8237" + x="363.9928" + y="221.1528">X</tspan></text> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8239" + y="556.086" + x="465.5513" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + xml:space="preserve"><tspan + y="556.086" + x="465.5513" + id="tspan8241" + sodipodi:role="line" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;">X</tspan></text> + </g> +</svg> diff --git a/labs/lab3-k-means/step4.png b/labs/lab3-k-means/step4.png new file mode 100644 index 0000000000000000000000000000000000000000..2eafaa4e26f7c97028692716d9474ab3a8ab2482 Binary files /dev/null and b/labs/lab3-k-means/step4.png differ diff --git a/labs/lab3-k-means/step4.svg b/labs/lab3-k-means/step4.svg new file mode 100644 index 0000000000000000000000000000000000000000..ad37ce85883bf092146048dcfe45c430968e4afd --- /dev/null +++ b/labs/lab3-k-means/step4.svg @@ -0,0 +1,441 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\kmeans\step4.png" + inkscape:export-xdpi="44.18" + inkscape:export-ydpi="44.18" + sodipodi:docname="step4.svg"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker12915" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path12917" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker12465" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend" + inkscape:collect="always"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path12467" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker11619" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path11621" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4153" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker10709" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path10711" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker9251" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path9253" /> + </marker> + <marker + inkscape:stockid="Arrow2Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow2Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4165" + style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " + transform="scale(1.1) rotate(180) translate(1,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker8251" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path8253" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + id="linearGradient8215"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop8217" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop8219" /> + </linearGradient> + <linearGradient + id="linearGradient7502" + osb:paint="solid"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop7504" /> + </linearGradient> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4494" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Lend" + inkscape:collect="always"> + <path + transform="scale(0.8) rotate(180) translate(12.5,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4496" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4147" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient8215" + id="linearGradient8221" + x1="119.05175" + y1="385.33261" + x2="145.39577" + y2="385.33261" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.67277217" + inkscape:cx="372.04724" + inkscape:cy="526.1811" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Lend)" + d="m 41.428567,463.79078 646.353683,0" + id="path4138" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4492" + d="m 338.83255,778.33762 0,-646.35368" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.07530761;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4494)" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke:#000000;stroke-opacity:1" + id="path5826" + cx="475.71429" + cy="179.50507" + r="10" /> + <circle + r="10" + cy="245.21935" + cx="505.71429" + id="circle5828" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5830" + cx="548.57141" + cy="189.50507" + r="10" /> + <circle + r="10" + cy="240.93364" + cx="581.42853" + id="circle5832" + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:0.29677418;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5834" + cx="585.71423" + cy="110.93364" + r="10" /> + <circle + r="10" + cy="316.64792" + cx="98.571434" + id="circle5838" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5840" + cx="302.31769" + cy="302.56015" + r="10" /> + <circle + r="10" + cy="340.79007" + cx="239.10878" + id="circle5842" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle5844" + cx="188.12323" + cy="373.02576" + r="10" /> + <circle + r="10" + cy="262.21863" + cx="227.76428" + id="circle5846" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7532" + cx="70.008804" + cy="691.26898" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="737.31219" + cx="36.781143" + id="circle7534" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7536" + cx="181.05341" + cy="695.65546" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + r="10" + cy="766.3324" + cx="123.32337" + id="circle7538" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <circle + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle7540" + cx="137.71626" + cy="630.1972" + r="10" + transform="matrix(0.77979134,-0.62603951,0.62603951,0.77979134,0,0)" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="M 189.82425,65.224411 387.89857,389.70213" + id="path7612" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="m 386.88842,387.68183 -171.08084,349.6" + id="path7614" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.5, 7.5;stroke-dashoffset:0;stroke-opacity:1" + d="M 386.88843,389.70213 736.70578,221.52721" + id="path7616" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8211" + y="385.78098" + x="145.59712" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + xml:space="preserve"><tspan + y="385.78098" + x="145.59712" + id="tspan8213" + sodipodi:role="line" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + x="363.9928" + y="221.1528" + id="text8235" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;" + sodipodi:role="line" + id="tspan8237" + x="363.9928" + y="221.1528">X</tspan></text> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text8239" + y="556.086" + x="465.5513" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + xml:space="preserve"><tspan + y="556.086" + x="465.5513" + id="tspan8241" + sodipodi:role="line" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;">X</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" + x="182.62602" + y="355.70956" + id="text11603" + sodipodi:linespacing="125%" + transform="scale(1.1239557,0.88971479)"><tspan + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1;" + sodipodi:role="line" + id="tspan11605" + x="182.62602" + y="355.70956">X</tspan></text> + <text + transform="scale(1.1239557,0.88971479)" + sodipodi:linespacing="125%" + id="text11607" + y="240.43587" + x="449.76309" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.58874893px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="240.43587" + x="449.76309" + id="tspan11609" + sodipodi:role="line" + style="fill:#000000;fill-opacity:0;stroke:#000000;stroke-opacity:1">X</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9, 9;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker11619)" + d="M 164.98899,315.1141 C 138.7091,262.04866 179.31776,214.18838 206.60783,282.41357" + id="path11617" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path12463" + d="m 434.02509,162.0162 c 16.82534,-48.60627 60.40678,-45.92938 87.69685,22.2958" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9, 9;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker12465)" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9, 9;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker12915)" + d="m 558.88163,474.15753 c 52.49863,-20.36492 73.78426,46.22663 -1.48639,19.32302" + id="path12913" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + </g> +</svg> diff --git a/labs/lab3-k-means/uniform-random-30steps.png b/labs/lab3-k-means/uniform-random-30steps.png new file mode 100644 index 0000000000000000000000000000000000000000..3ab1db8db80df4174f75cdd51c0385bce3370dad Binary files /dev/null and b/labs/lab3-k-means/uniform-random-30steps.png differ diff --git a/labs/lab4-barnes-hut-simulation/README.md b/labs/lab4-barnes-hut-simulation/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ef81cec3c8d45bdd05667cbc1e106e01b74e187a --- /dev/null +++ b/labs/lab4-barnes-hut-simulation/README.md @@ -0,0 +1,560 @@ +# Barnes-Hut Simulation + +Use the following commands to make a fresh clone of your repository: + +```sh +git clone -b barneshut git@gitlab.epfl.ch:lamp/student-repositories-s22/cs206-GASPAR.git cs206-barneshut +``` + +## Useful links + + * [The API documentation of the Scala standard library](https://www.scala-lang.org/files/archive/api/2.13.4) + * [The API documentation of the Java standard library](https://docs.oracle.com/en/java/javase/15/docs/api/index.html) + +**If you have issues with the IDE, try [reimporting the +build](https://gitlab.epfl.ch/lamp/cs206/-/blob/master/labs/example-lab.md#ide-features-like-type-on-hover-or-go-to-definition-do-not-work), +if you still have problems, use `compile` in sbt instead.** + +## Introduction + +In this assignment, you will implement the parallel Barnes-Hut algorithm for *N-body simulation*. +N-body simulation is a simulation of a system of *N* particles that interact with physical +forces, such as gravity or electrostatic force. +Given initial positions and velocities of all the *particles* (or *bodies*), the N-body simulation +computes the new positions and velocities of the particles as the time progresses. +It does so by dividing time into discrete short intervals, and computing the +positions of the particles after each interval. + +<!-- +Let us recall some basics of classical mechanics. +What makes a particle, such as an atom, a comet or a star, move through space? +First, the particle moves through space as a consequence of having some initial velocity +compared to other particles. +Second, the particle changes its velocity as a result of external forces. +These forces are in direct correlation with the proximity of other particles. +For example, Earth moves through space with some initial velocity, +which is constantly being changed due to the gravitational force between the Earth and the Sun. +--> + +Before we study the Barnes-Hut algorithm for the N-body simulation problem, +we will focus on a simpler algorithm -- the *direct sum N-body algorithm*. +The direct sum algorithm consists of multiple iterations, each of which performs +the following steps for each particle: + +1. The particle position is updated according to its current velocity (`delta` is a short time period). + + x' = x + v_x * delta + y' = y + v_y * delta + +2. The net force on the particle is computed by adding the individual forces from all the other particles. + + F_x = F_1x + F_2x + F_3x + ... + F_Nx + F_y = F_1y + F_2y + F_3y + ... + F_Ny + +3. The particle velocity is updated according to the net force on that particle. + + v_x' = v_x + F_x / mass * delta + v_y' = v_y + F_y / mass * delta + +In this exercise, we will assume that the force between particles is the *gravitational force* +from classical mechanics. Let's recall the formula for the gravitational force between two stellar bodies: + + F = G * (m1 * m2) / distance^2 + +Above, `F` is the absolute value of the gravitational force, `m1` and `m2` are the masses of the two bodies, +and `r` is the distance between them. `G` is the gravitational constant. + +<!-- +The gravitational force vector always points towards the other body. +The `F_x` and `F_y` components of the gravitational force on the body `m1` +can be computed by observing the following triangle similarity: + +```scala +distance = math.sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2) +F_x / F = (x2 - x1) / distance +F_y / F = (y2 - y1) / distance +``` + +This is shown in the following figure: + + +--> + +For each particle, the net force is computed by summing the components of individual forces from all other particles, +as shown in the following figure: + + + +The direct sum N-body algorithm is very simple, but also inefficient. +Since we need to update `N` particles, and compute `N - 1` force contributions for each of those particles, +the overall complexity of an iteration step of this algorithm is `O(N^2)`. +As the number of particles grows larger, the direct sum N-body algorithm becomes prohibitively expensive. + +The Barnes-Hut algorithm is an optimization of the direct sum N-body algorithm, +and is based on the following observation: + +> If a cluster of bodies is sufficiently distant from a body *A*, the net force on *A* +> from that cluster can be approximated with one big body with the mass of all the +> bodies in the cluster, positioned at the center of mass of the cluster. + +This is illustrated in the following figure: + + + +To take advantage of this observation, the Barnes-Hut algorithm relies on +a *quadtree* -- a data structure that divides the space into cells, and answers queries +such as 'What is the total mass and the center of mass of all the particles in this cell?'. +The following figure shows an example of a quadtree for 6 bodies: + + + +Above, the total force from the bodies *B*, *C*, *D* and *E* on the body *A* can be approximated +by a single body with *mass* equal to the sum of masses *B*, *C*, *D* and *E*, +positioned at the center of mass of bodies *B*, *C*, *D* and *E*. +The center of mass `(massX, massY)` is computed as follows: + +```scala +mass = m_B + m_C + m_D + m_E +massX = (m_B * x_B + m_C * x_C + m_D * x_D + m_E * x_E) / mass +massY = (m_B * y_B + m_C * y_C + m_D * y_D + m_E * y_E) / mass +``` +An iteration of the Barnes-Hut algorithm is composed of the following steps: + +1. Construct the quadtree for the current arrangement of the bodies. + 1. Determine the *boundaries*, i.e. the square into which all bodies fit. + 2. Construct a quadtree that covers the boundaries and contains all the bodies. +2. Update the bodies -- for each body: + 1. Update the body position according to its current velocity. + 2. Using the quadtree, compute the net force on the body by adding the individual forces from all the other bodies. + 3. Update the velocity according to the net force on that body. + +It turns out that, for most spatial distribution of bodies, +the expected number of cells that contribute to the net force on a body is `log n`, +so the overall complexity of the Barnes-Hut algorithm is `O(n log n)`. + +Now that we covered all the necessary theory, let's finally dig into the implementation! +You will implement: + +- a quadtree and its combiner data structure +- an operation that computes the total force on a body using the quadtree +- a simulation step of the Barnes-Hut algorithm + +Since this assignment consists of multiple components, +we will follow the principles of *test-driven development* and test each component separately, +before moving on to the next component. +That way, if anything goes wrong, we will more precisely know where the error is. +It is always better to detect errors sooner, rather than later. + + +## Data Structures + +We will start by implementing the necessary data structures: the quadtree, +the body data-type and the sector matrix. +You will find the stubs in the `package.scala` file of the `barneshut` package. + + +### Quadtree Data Structure + +In this part of the assignment, we implement the quadtree data structure, +denoted with the abstract data-type `Quad`. +Every `Quad` represents a square cell of space, and can be one of the following node types: + +- an `Empty` node, which represents an empty quadtree +- a `Leaf` node, which represents one or more bodies +- a `Fork` node, which divides a spatial cell into four quadrants + +The definition of `Quad` is as follows: + +```scala +sealed abstract class Quad { + def massX: Float + def massY: Float + def mass: Float + def centerX: Float + def centerY: Float + def size: Float + def total: Int + def insert(b: Body): Quad +} +``` + +Here, `massX` and `massY` represent the center of mass of the bodies in the respective cell, +`mass` is the total mass of bodies in that cell, `centerX` and `centerY` are the coordinates +of the center of the cell, `size` is the length of the side of the cell, +and `total` is the total number of bodies in the cell. + +Note that we consider the top left corner to be at coordinate (0, 0). We also consider the x axis to grow to the right and the y axis to the bottom. + + + +The method `insert` creates a new quadtree which additionally contains the body `b`, +and covers the same area in space as the original quadtree. +Quadtree is an *immutable* data structure -- `insert` does not modify the existing `Quad` object. +Note that `Body` has the following signature: + +```scala +class Body(val mass: Float, val x: Float, val y: Float, val xspeed: Float, val yspeed: Float) +``` + +In this part of the exercise, you only need to know about body's position `x` and `y`. + +Let's start by implementing the simplest `Quad` type -- the empty quadtree: + +```scala +case class Empty(centerX: Float, centerY: Float, size: Float) extends Quad +``` + +The center and the size of the `Empty` quadtree are specified in its constructor. +The `Empty` tree does not contain any bodies, so we specify that its center of mass is equal to its center. + +Next, let's implement the `Fork` quadtree: + +```scala +case class Fork(nw: Quad, ne: Quad, sw: Quad, se: Quad) extends Quad +``` + +This node is specified by four child quadtrees `nw`, `ne`, `sw` and `se`, +in the northwest, northeast, southwest and southeast quadrant, respectively. + +The northwest is located on the top left, northeast on the top right, southwest on the bottom left and southeast on the bottom right. + +The constructor assumes that the children nodes that represent four adjacent cells of the +same size and adjacent to each other, as in the earlier figure. +The center of the `Fork` quadtree is then specified by, say, the +lower right corner of the quadtree `nw`. If the `Fork` quadtree is empty, the +center of mass coincides with the center. + +Inserting into a `Fork` is recursive -- it updates the respective child and creates a new `Fork`. + +Finally, the `Leaf` quadtree represents one or more bodies: + +```scala +case class Leaf(centerX: Float, centerY: Float, size: Float, bodies: Seq[Body]) +extends Quad +``` + +If the `size` of a `Leaf` is greater than a predefined constant `minimumSize`, +inserting an additonal body into that `Leaf` quadtree creates a `Fork` quadtree +with empty children, and adds all the bodies into that `Fork` (including the new body). +Otherwise, inserting creates another `Leaf` with all the existing bodies and the new one. + + +### The Body Data-Type + +Next, we can implement the `Body` data-type: + +```scala +class Body(val mass: Float, val x: Float, val y: Float, val xspeed: Float, val yspeed: Float) { + def updated(quad: Quad): Body = ??? +} +``` + +Here, `xspeed` and `yspeed` represent the velocity of the body, `mass` is its mass, +and `x` and `y` are the coordinates of the body. + +The most interesting method on the `Body` is `updated` -- it takes a quadtree and +returns the updated version of the `Body`: + +```scala +def updated(quad: Quad): Body +``` + +This method is already half-completed for you -- you only need to implement +its nested method `traverse`, which goes through the quadtree and proceeds casewise: + +- empty quadtree does not affect the net force +- each body in a leaf quadtree adds some net force +- a fork quadtree that is sufficiently far away acts as a single point of mass +- a fork quadtree that is not sufficiently far away must be recursively traversed + +When are we allowed to approximate a cluster of bodies with a single point? +The heuristic that is used is that the size of the cell divided by the distance +`dist` between the center of mass and the particle is less than some constant `theta`: + +```scala +quad.size / dist < theta +``` + +Hint: make sure you use the `distance` to compute distance between points, +the `theta` value for the condition, and `addForce` to add force contributions! + +Before proceeding, make sure to run tests against your `Quad` and `Body` implementations. + + +### The Sector Matrix + +The last data structure that we will implement is the *sector matrix*. +In this data structure, we will use the auxiliary class `Boundaries`, which +contains the `minX`, `maxX`, `minY` and `maxY` fields for the boundaries of the scene: + +```scala +class Boundaries { + var minX: Float + var minY: Float + var maxX: Float + var maxY: Float + def size = math.max(maxX - minX, maxY - minY) +} +``` + +We will also rely on the `ConcBuffer` data structure, mentioned in the lecture: + +```scala +class ConcBuffer[T] +``` + +The `ConcBuffer` class comes with efficient `+=`, `combine` and `foreach` operations, +which add elements into the buffer, combine two buffers and traverse the buffer, respectively. +The sector matrix additionally has the `toQuad` method, which returns a quadtree that contains all +the elements previously added with the `+=` method. +Recall from the lectures that this combination of methods make the `ConcBuffer` a *combiner*. + +The `SectorMatrix` is just a square matrix that covers a square region of space +specified by the boundaries: + +```scala +class SectorMatrix(val boundaries: Boundaries, val sectorPrecision: Int) { + val sectorSize = boundaries.size / sectorPrecision + val matrix = new Array[ConcBuffer[Body]](sectorPrecision * sectorPrecision) + for (i <- 0 until matrix.length) matrix(i) = new ConcBuffer + def apply(x: Int, y: Int) = matrix(y * sectorPrecision + x) +} +``` + +The `sectorPrecision` argument denotes the width and height of the matrix, and +each entry contains a `ConcBuffer[Body]` object. Effectively, the `SectorMatrix` is a *combiner* -- +it partitions the square region of space into `sectorPrecision` times `sectorPrecision` buckets, called *sectors*. + + + +Combiners such as the `SectorMatrix` are used in parallel programming to partition the results into +some intermediate form that is more amenable to parallelization. +Recall from the lecture that one of the ways to implement a *combiner* is by using +a bucket data structure -- we will do exactly that in this part of the exercise! +We will add three methods on the `SectorMatrix` that will make it a combiner. +We start with the `+=` method: + +```scala +def +=(b: Body): SectorMatrix = { + ??? + this +} +``` + +This method should use the body position, `boundaries` and `sectorPrecision` +to determine the sector into which the body should go into, +and add the body into the corresponding `ConcBuffer` object. + +Importantly, if the `Body` lies outside of the `Boundaries`, it should be considered +to be located at the closest point within the `Boundaries` for the purpose of finding which `ConcBuffer` should hold the body. + +Next, we implement the `combine` method, which takes another `SectorMatrix`, +and creates a `SectorMatrix` which contains the elements of both input +`SectorMatrix` data structures: + +```scala +def combine(that: SectorMatrix): SectorMatrix +``` + +This method calls `combine` on the pair of `ConcBuffer`s in `this` and `that` +matrices to produce the `ConcBuffer` for the resulting matrix. +You can safely assume that combine will only be called on matrices of same dimensions, boundaries and sector precision. + + + + +The nice thing about the sector matrix is that a quadtree can be constructed +in parallel for each sector. Those little quadtrees can then be linked together. +The `toQuad` method on the `SectorMatrix` does this: + +```scala +def toQuad(parallelism: Int): Quad +``` + +This method is already implemented -- you can examine +it if you would like to know how it works. + +<!-- +Finally, we will implement the `toQuad` method, which uses the `SectorMatrix` +to create a `Quad` tree in parallel: + +```scala +def toQuad(parallelism: Int): Quad = { + def BALANCING_FACTOR = 4 + def quad(x: Int, y: Int, span: Int, achievedParallelism: Int): Quad = { + if (span == 1) { + ??? + } else { + ??? + } + } + quad(0, 0, sectorPrecision, 1) +} +``` + +The `toQuad` method takes the desired degree of `parallelism` as an argument, +and then calls the recursive `quad` method. +The `quad` method operates on a subsquare of the matrix starting at `x`, `y` coordinates, +with the length `span`. +The fourth parameter, `achievedParallelism`, describes how many tasks have been +created at a given call depth. + +Implement the `quad` method so that: + +1. If `span` is 1, the method sequentially converts the bodies in that sector to a quadtree. + Use `foldLeft` and the `insert` method on the bodies in each sector to get the quadtree. +2. Otherwise, if `parallelism > 1 && achievedParallelism < parallelism * BALANCING_FACTOR`, + the method recursively, and in parallel, creates quadtrees for the `4` subsquares + and links them together into a bigger quadtree. +3. Otherwise, if the `parallelism == 1 || achievedParallelism >= parallelism * BALANCING_FACTOR`, + the method does the same as in case 2, but without parallelism. + +Don't forget to multiply `achievedParallelism` by `4` at each step. +--> + +Congratulations, you just implemented your first combiner! +Before proceeding, make sure to run those unit tests. + + +## Implementing Barnes-Hut + +Now that we have all the right data structures ready and polished, +implementing Barnes-Hut becomes a piece of cake. + +Take a look at the file `Simulator.scala`, which contains the implementation +of the Barnes-Hut simulator, and in particular the `step` method. +The `step` method represents one step in the simulation: + +```scala +def step(bodies: Seq[Body]): (Seq[Body], Quad) = { + // 1. compute boundaries + val boundaries = computeBoundaries(bodies) + + // 2. compute sector matrix + val sectorMatrix = computeSectorMatrix(bodies, boundaries) + + // 3. compute quadtree + val quad = computeQuad(sectorMatrix) + + // 4. eliminate outliers + val filteredBodies = eliminateOutliers(bodies, sectorMatrix, quad) + + // 5. update body velocities and positions + val newBodies = updateBodies(filteredBodies, quad) + + (newBodies, quad) +} +``` + +The pre-existing code in `step` nicely summarizes what this method does. + + +### Computing the Scene Boundaries + +First, we must compute the boundaries of all the bodies in the scene. +Since bodies move and the boundaries dynamically change, +we must do this in every iteration of the algorithm. +The `computeBoundaries` method is already implemented -- it uses the `aggregate` +combinator on the sequence of bodies to compute the boundaries: + +```scala +def computeBoundaries(bodies: Seq[Body]): Boundaries = { + val parBodies = bodies.par + parBodies.tasksupport = taskSupport + parBodies.aggregate(new Boundaries)(updateBoundaries, mergeBoundaries) +} +``` + +How does this work? The `aggregate` method divides the input sequence into a +number of chunks. For each of the chunks, it uses the `new Boundaries` expression +to create the accumulation value, and then folds the values in that chunk +calling `updateBoundaries` on each body, in the same way a `foldLeft` operation would. +Finally, `aggregate` combines the results of different chunks using a reduction tree and `mergeBoundaries`. + +So, we need the `updateBoundaries` method: + +```scala +def updateBoundaries(boundaries: Boundaries, body: Body): Boundaries +``` + +Given an existing `boundaries` object and a body, the `updateBoundaries` updates +the `minX`, `minY`, `maxX` and `maxY` values so that the boundaries include the body. + +Next, the `mergeBoundaries` method creates a new `Boundaries` object, which represents +the smallest rectangle that contains both the input boundaries: + +```scala +def mergeBoundaries(a: Boundaries, b: Boundaries): Boundaries +``` + +Question: Is `mergeBoundaries` associative? Is it commutative? Does it need to be commutative? + +Implement these two methods, and test that they work correctly! + + +### Building the Quadtree + +Next, we need to build a `Quad` tree from the sequence of bodies. +We will first implement the `computeSectorMatrix` method to get the `SectorMatrix`: + +```scala +def computeSectorMatrix(bodies: Seq[Body], boundaries: Boundaries): SectorMatrix +``` + +Hint: aggregate the `SectorMatrix` from the sequence of bodies, the same way it was used for boundaries. +Use the SECTOR_PRECISION constant when creating a new `SectorMatrix`. + +<!-- +Next, implement `computeQuad`, which converts `SectorMatrix` to a `Quad`: + + def computeQuad(sectorMatrix: SectorMatrix): Quad + +Hint: use `taskSupport.parallelismLevel` to determine the desired parallelism. +--> + +Test that these methods work correctly before proceeding! + + +### Eliminating Outliers + +During the execution of the Barnes-Hut algorithm, some of the bodies tend to +move far away from most of the other bodies. There are many ways to deal with such *outliers*, +but to keep things simple, we will eliminate bodies that move too fast and too far away. + +We will not go into details of how this works, but if you'd like to know more, +you can try to understand how the `eliminateOutliers` method works. + + +### Updating Bodies + +The `updateBodies` method uses the quadtree to map each body from the +previous iteration of the algorithm to a new iteration: + +```scala +def updateBodies(bodies: Seq[Body], quad: Quad): Seq[Body] +``` + +Recall that we already implemented the `updated` method which updates a single body. + + +## Running Barnes-Hut + +At last, the parallel Barnes-Hut algorithm is implemented. +Note that, despite all the work, we kept our Barnes-Hut algorithm implementation simple +and avoided the details that a more realistic implementation must address. In particular: + +- we represented each body as a single point in space +- we restricted the simulation to two-dimensional space +- we ignored close encounter effects, such as body collision or tearing +- we ignored any relativistic effects, and assume classical mechanics +- we ignored errors induced by floating point computations + +You can now run it as follows: + + > runMain barneshut.BarnesHut + +To visualize the quadtree, press the *Show quad* button, and then hit the *Start/Pause* button. + +Play with the parallelism level and the number of bodies, and observe the average speedups in the lower right corner. +Then sit back, and enjoy the show! + diff --git a/labs/lab4-barnes-hut-simulation/cell.png b/labs/lab4-barnes-hut-simulation/cell.png new file mode 100644 index 0000000000000000000000000000000000000000..ad65b0d35f23d5c3bc891a5ee2d6f1fa1e708a53 Binary files /dev/null and b/labs/lab4-barnes-hut-simulation/cell.png differ diff --git a/labs/lab4-barnes-hut-simulation/cell.svg b/labs/lab4-barnes-hut-simulation/cell.svg new file mode 100644 index 0000000000000000000000000000000000000000..28ac7ec2f09622bcddfd8bce0f1894b12338af30 --- /dev/null +++ b/labs/lab4-barnes-hut-simulation/cell.svg @@ -0,0 +1,438 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="cell.svg" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\barneshut\cell.png" + inkscape:export-xdpi="32.65155" + inkscape:export-ydpi="32.65155"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker15906" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path15908" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker15306" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path15308" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker15086" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path15088" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="marker15028" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path15030" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker11876" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path11878" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker10168" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path10170" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker7470" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path7472" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4228" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4231" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.7" + inkscape:cx="970.66221" + inkscape:cy="85.954979" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" + inkscape:snap-text-baseline="false" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <circle + r="13.141105" + cy="721.93744" + cx="1136.2686" + id="circle4144" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + sodipodi:linespacing="125%" + id="text4152" + y="748.34113" + x="1165.1003" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="748.34113" + x="1165.1003" + id="tspan4154" + sodipodi:role="line">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4158">E</tspan></tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1152.1206" + y="688.21014" + id="text7888" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan7890" + x="1152.1206" + y="688.21014">(x<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan14976">E</tspan>,y<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan14974">E</tspan>)</tspan></text> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle8064" + cx="1028.7399" + cy="1061.7242" + r="13.141105" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1055.5515" + y="1070.8625" + id="text8066" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan8068" + x="1055.5515" + y="1070.8625">m<tspan + id="tspan8070" + style="font-size:64.99999762%;baseline-shift:sub">C</tspan></tspan></text> + <circle + r="13.141105" + cy="653.45074" + cx="741.34894" + id="circle10468" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + sodipodi:linespacing="125%" + id="text10470" + y="682.58905" + x="766.01764" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="682.58905" + x="766.01764" + id="tspan10472" + sodipodi:role="line">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan10474">D</tspan></tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="743.56964" + y="1123.7406" + id="text10476" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan10478" + x="743.56964" + y="1123.7406">m<tspan + id="tspan10480" + style="font-size:64.99999762%;baseline-shift:sub">B</tspan></tspan></text> + <circle + r="13.141105" + cy="1088.6008" + cx="727.80518" + id="circle10482" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="952.23749" + y="908.33813" + id="text13406" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan13408" + x="952.23749" + y="908.33813">mass</tspan></text> + <circle + r="24.149361" + cy="893.79889" + cx="923.70862" + id="circle13404" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:10, 5;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="558.17084" + x="604.85461" + height="531.79376" + width="531.79376" + id="rect14954" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="-822.98016" + x="-869.66394" + height="264.46457" + width="264.46457" + id="rect14958" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="scale(-1,-1)" /> + <rect + transform="scale(-1,-1)" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5.03303289;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect14960" + width="267.3674" + height="266.65311" + x="-1136.4081" + y="-1089.01" /> + <text + sodipodi:linespacing="125%" + id="text14978" + y="619.51978" + x="717.755" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="619.51978" + x="717.755" + id="tspan14980" + sodipodi:role="line">(x<tspan + id="tspan14982" + style="font-size:64.99999762%;baseline-shift:sub">D</tspan>,y<tspan + id="tspan14984" + style="font-size:64.99999762%;baseline-shift:sub">D</tspan>)</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="646.05164" + y="1057.5076" + id="text14986" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan14988" + x="646.05164" + y="1057.5076">(x<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan14990">B</tspan>,y<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan14992">B</tspan>)</tspan></text> + <text + sodipodi:linespacing="125%" + id="text14994" + y="1044.3879" + x="882.93494" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1044.3879" + x="882.93494" + id="tspan14996" + sodipodi:role="line">(x<tspan + id="tspan14998" + style="font-size:64.99999762%;baseline-shift:sub">C</tspan>,y<tspan + id="tspan15000" + style="font-size:64.99999762%;baseline-shift:sub">C</tspan>)</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:100%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="895.39038" + y="954.85413" + id="text15002" + sodipodi:linespacing="100%" + inkscape:export-xdpi="34.630001" + inkscape:export-ydpi="34.630001"><tspan + sodipodi:role="line" + id="tspan15004" + x="895.39038" + y="954.85413" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:30px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start">(mass<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan15020">X</tspan>,mass<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan15016">Y</tspan>)</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.89491892;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker15028);marker-end:url(#marker15086)" + d="m 611.75315,1157.4181 516.98645,0" + id="path15026" + inkscape:connector-curvature="0" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="825.29462" + y="1220.0476" + id="text15252" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan15254" + x="825.29462" + y="1220.0476">size<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan15256" /></tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1248.5714" + y="899.50507" + id="text4276" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4278" + x="1248.5714" + y="899.50507">total=4</tspan></text> + <text + inkscape:export-ydpi="34.630001" + inkscape:export-xdpi="34.630001" + sodipodi:linespacing="100%" + id="text4280" + y="793.42554" + x="875.39038" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:100%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:30px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start" + y="793.42554" + x="875.39038" + id="tspan4282" + sodipodi:role="line">(center<tspan + id="tspan4284" + style="font-size:64.99999762%;baseline-shift:sub">X</tspan>,center<tspan + id="tspan4286" + style="font-size:64.99999762%;baseline-shift:sub">Y</tspan>)</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:11.70279694;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 854.21813,808.4712 31.66682,31.66682" + id="path4288" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:11.70279694;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 855.14272,840.36917 32.36025,-32.36026" + id="path4290" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/labs/lab4-barnes-hut-simulation/combine.png b/labs/lab4-barnes-hut-simulation/combine.png new file mode 100644 index 0000000000000000000000000000000000000000..f54059cf101152332af25658cc26e5bd29c2c694 Binary files /dev/null and b/labs/lab4-barnes-hut-simulation/combine.png differ diff --git a/labs/lab4-barnes-hut-simulation/combine.svg b/labs/lab4-barnes-hut-simulation/combine.svg new file mode 100644 index 0000000000000000000000000000000000000000..09fb5286d7e6f23a9e1274a6cc70ae1476562769 --- /dev/null +++ b/labs/lab4-barnes-hut-simulation/combine.svg @@ -0,0 +1,1082 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="combine.svg" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\barneshut\sectormatrix.png" + inkscape:export-xdpi="32.6516" + inkscape:export-ydpi="32.6516"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="marker4830" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4832" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Sstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Sstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4202" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.2) translate(6,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.49497475" + inkscape:cx="370.35135" + inkscape:cy="411.90881" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4138" + width="157.25688" + height="157.25688" + x="746.3056" + y="293.24829" /> + <rect + y="293.24829" + x="903.69269" + height="157.25688" + width="157.25688" + id="rect4140" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="293.24829" + x="1060.2903" + height="157.25688" + width="157.25688" + id="rect4142" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4144" + width="157.25688" + height="157.25688" + x="1217.6774" + y="293.24829" /> + <rect + y="450.89859" + x="746.3056" + height="157.25688" + width="157.25688" + id="rect4146" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4148" + width="157.25688" + height="157.25688" + x="903.69269" + y="450.89859" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4150" + width="157.25688" + height="157.25688" + x="1060.2903" + y="450.89859" /> + <rect + y="450.89859" + x="1217.6774" + height="157.25688" + width="157.25688" + id="rect4152" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="608.02252" + x="746.3056" + height="157.25688" + width="157.25688" + id="rect4154" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4156" + width="157.25688" + height="157.25688" + x="903.69269" + y="608.02252" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4158" + width="157.25688" + height="157.25688" + x="1060.2903" + y="608.02252" /> + <rect + y="608.02252" + x="1217.6774" + height="157.25688" + width="157.25688" + id="rect4160" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4162" + width="157.25688" + height="157.25688" + x="746.3056" + y="765.67279" /> + <rect + y="765.67279" + x="903.69269" + height="157.25688" + width="157.25688" + id="rect4164" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="765.67279" + x="1060.2903" + height="157.25688" + width="157.25688" + id="rect4166" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4168" + width="157.25688" + height="157.25688" + x="1217.6774" + y="765.67279" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path4170" + cx="1020.8884" + cy="491.64792" + r="13.571428" /> + <circle + r="13.571428" + cy="854.50507" + cx="1285.1742" + id="circle4172" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4174" + cx="1355.1742" + cy="824.50507" + r="13.571428" /> + <circle + r="13.571428" + cy="894.50507" + cx="1376.6028" + id="circle4176" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4178" + cx="1312.3171" + cy="295.93362" + r="13.571428" /> + <circle + r="13.571428" + cy="805.93365" + cx="853.74573" + id="circle4180" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4182" + cx="1141.0917" + cy="717.37964" + r="13.571428" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="757.61438" + y="345.25543" + id="text5218" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5220" + x="757.61438" + y="345.25543">0,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5222" + y="345.25543" + x="927.32001" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="345.25543" + x="927.32001" + id="tspan5224" + sodipodi:role="line">1,0</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1080.8633" + y="345.25543" + id="text5226" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5228" + x="1080.8633" + y="345.25543">2,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5230" + y="345.25543" + x="1236.4268" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="345.25543" + x="1236.4268" + id="tspan5232" + sodipodi:role="line">3,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5234" + y="504.85953" + x="757.61438" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="504.85953" + x="757.61438" + id="tspan5236" + sodipodi:role="line">0,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="927.32001" + y="504.85953" + id="text5238" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5240" + x="927.32001" + y="504.85953">1,1</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5242" + y="504.85953" + x="1080.8633" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="504.85953" + x="1080.8633" + id="tspan5244" + sodipodi:role="line">2,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1236.4268" + y="504.85953" + id="text5246" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5248" + x="1236.4268" + y="504.85953">3,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="757.61438" + y="656.38239" + id="text5250" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5252" + x="757.61438" + y="656.38239">0,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5254" + y="656.38239" + x="927.32001" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="656.38239" + x="927.32001" + id="tspan5256" + sodipodi:role="line">1,2</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1080.8633" + y="656.38239" + id="text5258" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5260" + x="1080.8633" + y="656.38239">2,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5262" + y="656.38239" + x="1236.4268" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="656.38239" + x="1236.4268" + id="tspan5264" + sodipodi:role="line">3,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5266" + y="813.96619" + x="757.61438" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="813.96619" + x="757.61438" + id="tspan5268" + sodipodi:role="line">0,3</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="927.32001" + y="813.96619" + id="text5270" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5272" + x="927.32001" + y="813.96619">1,3</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5274" + y="813.96619" + x="1080.8633" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="813.96619" + x="1080.8633" + id="tspan5276" + sodipodi:role="line">2,3</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1236.4268" + y="813.96619" + id="text5278" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5280" + x="1236.4268" + y="813.96619">3,3</tspan></text> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4209" + cx="1180.1184" + cy="684.79944" + r="13.571428" /> + <circle + r="13.571428" + cy="884.80963" + cx="800.30096" + id="circle4211" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="293.24829" + x="-243.64386" + height="157.25688" + width="157.25688" + id="rect4213" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4215" + width="157.25688" + height="157.25688" + x="-86.256775" + y="293.24829" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4217" + width="157.25688" + height="157.25688" + x="70.340759" + y="293.24829" /> + <rect + y="293.24829" + x="227.72791" + height="157.25688" + width="157.25688" + id="rect4219" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4221" + width="157.25688" + height="157.25688" + x="-243.64386" + y="450.89859" /> + <rect + y="450.89859" + x="-86.256775" + height="157.25688" + width="157.25688" + id="rect4223" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="450.89859" + x="70.340759" + height="157.25688" + width="157.25688" + id="rect4225" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4227" + width="157.25688" + height="157.25688" + x="227.72791" + y="450.89859" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4229" + width="157.25688" + height="157.25688" + x="-243.64386" + y="608.02252" /> + <rect + y="608.02252" + x="-86.256775" + height="157.25688" + width="157.25688" + id="rect4231" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="608.02252" + x="70.340759" + height="157.25688" + width="157.25688" + id="rect4233" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4235" + width="157.25688" + height="157.25688" + x="227.72791" + y="608.02252" /> + <rect + y="765.67279" + x="-243.64386" + height="157.25688" + width="157.25688" + id="rect4237" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4239" + width="157.25688" + height="157.25688" + x="-86.256775" + y="765.67279" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4241" + width="157.25688" + height="157.25688" + x="70.340759" + y="765.67279" /> + <rect + y="765.67279" + x="227.72791" + height="157.25688" + width="157.25688" + id="rect4243" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + r="13.571428" + cy="824.50507" + cx="365.22473" + id="circle4249" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + r="13.571428" + cy="295.93362" + cx="322.36768" + id="circle4253" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4255" + cx="-136.20374" + cy="805.93365" + r="13.571428" /> + <text + sodipodi:linespacing="125%" + id="text4259" + y="345.25543" + x="-232.33508" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="345.25543" + x="-232.33508" + id="tspan4261" + sodipodi:role="line">0,0</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-62.629456" + y="345.25543" + id="text4263" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4265" + x="-62.629456" + y="345.25543">1,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4267" + y="345.25543" + x="90.913757" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="345.25543" + x="90.913757" + id="tspan4269" + sodipodi:role="line">2,0</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="246.47729" + y="345.25543" + id="text4271" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4273" + x="246.47729" + y="345.25543">3,0</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-232.33508" + y="504.85953" + id="text4275" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4277" + x="-232.33508" + y="504.85953">0,1</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4279" + y="504.85953" + x="-62.629456" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="504.85953" + x="-62.629456" + id="tspan4281" + sodipodi:role="line">1,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="90.913757" + y="504.85953" + id="text4283" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4285" + x="90.913757" + y="504.85953">2,1</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4287" + y="504.85953" + x="246.47729" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="504.85953" + x="246.47729" + id="tspan4289" + sodipodi:role="line">3,1</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4291" + y="656.38239" + x="-232.33508" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="656.38239" + x="-232.33508" + id="tspan4293" + sodipodi:role="line">0,2</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-62.629456" + y="656.38239" + id="text4295" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4297" + x="-62.629456" + y="656.38239">1,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4299" + y="656.38239" + x="90.913757" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="656.38239" + x="90.913757" + id="tspan4301" + sodipodi:role="line">2,2</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="246.47729" + y="656.38239" + id="text4303" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4305" + x="246.47729" + y="656.38239">3,2</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-232.33508" + y="813.96619" + id="text4307" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4309" + x="-232.33508" + y="813.96619">0,3</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4311" + y="813.96619" + x="-62.629456" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="813.96619" + x="-62.629456" + id="tspan4313" + sodipodi:role="line">1,3</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="90.913757" + y="813.96619" + id="text4315" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4317" + x="90.913757" + y="813.96619">2,3</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4319" + y="813.96619" + x="246.47729" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="813.96619" + x="246.47729" + id="tspan4321" + sodipodi:role="line">3,3</tspan></text> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4327" + width="157.25688" + height="157.25688" + x="-1231.5731" + y="293.24829" /> + <rect + y="293.24829" + x="-1074.1859" + height="157.25688" + width="157.25688" + id="rect4329" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="293.24829" + x="-917.58844" + height="157.25688" + width="157.25688" + id="rect4331" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4333" + width="157.25688" + height="157.25688" + x="-760.20129" + y="293.24829" /> + <rect + y="450.89859" + x="-1231.5731" + height="157.25688" + width="157.25688" + id="rect4335" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4337" + width="157.25688" + height="157.25688" + x="-1074.1859" + y="450.89859" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4339" + width="157.25688" + height="157.25688" + x="-917.58844" + y="450.89859" /> + <rect + y="450.89859" + x="-760.20129" + height="157.25688" + width="157.25688" + id="rect4341" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="608.02252" + x="-1231.5731" + height="157.25688" + width="157.25688" + id="rect4343" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4345" + width="157.25688" + height="157.25688" + x="-1074.1859" + y="608.02252" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4347" + width="157.25688" + height="157.25688" + x="-917.58844" + y="608.02252" /> + <rect + y="608.02252" + x="-760.20129" + height="157.25688" + width="157.25688" + id="rect4349" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4351" + width="157.25688" + height="157.25688" + x="-1231.5731" + y="765.67279" /> + <rect + y="765.67279" + x="-1074.1859" + height="157.25688" + width="157.25688" + id="rect4353" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="765.67279" + x="-917.58844" + height="157.25688" + width="157.25688" + id="rect4355" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4357" + width="157.25688" + height="157.25688" + x="-760.20129" + y="765.67279" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4359" + cx="-956.99023" + cy="491.64792" + r="13.571428" /> + <circle + r="13.571428" + cy="854.50507" + cx="-692.70447" + id="circle4361" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + r="13.571428" + cy="894.50507" + cx="-601.27588" + id="circle4365" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4371" + cx="-836.78705" + cy="717.37964" + r="13.571428" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-1220.2643" + y="345.25543" + id="text4373" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4375" + x="-1220.2643" + y="345.25543">0,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4377" + y="345.25543" + x="-1050.5586" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="345.25543" + x="-1050.5586" + id="tspan4379" + sodipodi:role="line">1,0</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-897.01544" + y="345.25543" + id="text4381" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4383" + x="-897.01544" + y="345.25543">2,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4385" + y="345.25543" + x="-741.4519" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="345.25543" + x="-741.4519" + id="tspan4387" + sodipodi:role="line">3,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4389" + y="504.85953" + x="-1220.2643" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="504.85953" + x="-1220.2643" + id="tspan4391" + sodipodi:role="line">0,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-1050.5586" + y="504.85953" + id="text4393" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4395" + x="-1050.5586" + y="504.85953">1,1</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4397" + y="504.85953" + x="-897.01544" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="504.85953" + x="-897.01544" + id="tspan4399" + sodipodi:role="line">2,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-741.4519" + y="504.85953" + id="text4401" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4403" + x="-741.4519" + y="504.85953">3,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-1220.2643" + y="656.38239" + id="text4405" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4407" + x="-1220.2643" + y="656.38239">0,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4409" + y="656.38239" + x="-1050.5586" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="656.38239" + x="-1050.5586" + id="tspan4411" + sodipodi:role="line">1,2</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-897.01544" + y="656.38239" + id="text4413" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4415" + x="-897.01544" + y="656.38239">2,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4417" + y="656.38239" + x="-741.4519" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="656.38239" + x="-741.4519" + id="tspan4419" + sodipodi:role="line">3,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4421" + y="813.96619" + x="-1220.2643" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="813.96619" + x="-1220.2643" + id="tspan4423" + sodipodi:role="line">0,3</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-1050.5586" + y="813.96619" + id="text4425" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4427" + x="-1050.5586" + y="813.96619">1,3</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4429" + y="813.96619" + x="-897.01544" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="813.96619" + x="-897.01544" + id="tspan4431" + sodipodi:role="line">2,3</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-741.4519" + y="813.96619" + id="text4433" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4435" + x="-741.4519" + y="813.96619">3,3</tspan></text> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4437" + cx="-797.76031" + cy="684.79944" + r="13.571428" /> + <circle + r="13.571428" + cy="884.80963" + cx="-1177.5776" + id="circle4439" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:61.06264496px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-556.66376" + y="625.3916" + id="text4441" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4443" + x="-556.66376" + y="625.3916">combine</tspan></text> + <text + sodipodi:linespacing="125%" + id="text4445" + y="668.05292" + x="504.32611" + style="font-style:normal;font-weight:normal;font-size:151.51826477px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="668.05292" + x="504.32611" + id="tspan4447" + sodipodi:role="line">=</tspan></text> + </g> +</svg> diff --git a/labs/lab4-barnes-hut-simulation/force-components.png b/labs/lab4-barnes-hut-simulation/force-components.png new file mode 100644 index 0000000000000000000000000000000000000000..455cd799507df3eb94731acb4f0275a252fb6fe5 Binary files /dev/null and b/labs/lab4-barnes-hut-simulation/force-components.png differ diff --git a/labs/lab4-barnes-hut-simulation/force_components.svg b/labs/lab4-barnes-hut-simulation/force_components.svg new file mode 100644 index 0000000000000000000000000000000000000000..265c77f152b2ad67570dc885c8d7c73a85976350 --- /dev/null +++ b/labs/lab4-barnes-hut-simulation/force_components.svg @@ -0,0 +1,343 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="force_components.svg" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\barneshut\force-components.png" + inkscape:export-xdpi="43.470001" + inkscape:export-ydpi="43.470001"> + <defs + id="defs4"> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker7470" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path7472" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker6528" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path6530" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker5832" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend" + inkscape:collect="always"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path5834" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4718" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4720" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker4622" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4624" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4228" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4231" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.49497475" + inkscape:cx="596.83099" + inkscape:cy="659.30507" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path4142" + cx="269.28571" + cy="190.21935" + r="13.141105" /> + <circle + r="13.141105" + cy="470.63928" + cx="802.48016" + id="circle4144" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="267.72015" + y="150.9595" + id="text4146" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4148" + x="267.72015" + y="150.9595">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4150">1</tspan></tspan></text> + <text + sodipodi:linespacing="125%" + id="text4152" + y="460.49185" + x="837.86316" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="460.49185" + x="837.86316" + id="tspan4154" + sodipodi:role="line">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4158">2</tspan></tspan></text> + <text + sodipodi:linespacing="125%" + id="text4160" + y="178.65207" + x="113.20886" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="178.65207" + x="113.20886" + id="tspan4162" + sodipodi:role="line">(x<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4180">1</tspan>,y<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4178">1</tspan>)</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="817.0473" + y="529.71088" + id="text4182" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4184" + x="817.0473" + y="529.71088">(x<tspan + id="tspan4186" + style="font-size:64.99999762%;baseline-shift:sub">2</tspan>,y<tspan + id="tspan4188" + style="font-size:64.99999762%;baseline-shift:sub">2</tspan>)</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4622)" + d="m 269.71073,191.71224 0,272.93917" + id="path4190" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.90697932;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow1Mstart)" + d="m 782.93078,471.122 -512.2099,0" + id="path4192" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="452.44324" + y="517.38312" + id="text4182-2" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4184-5" + x="452.44324" + y="517.38312">x<tspan + id="tspan4186-4" + style="font-size:64.99999762%;baseline-shift:sub">2</tspan>-x<tspan + id="tspan4188-5" + style="font-size:64.99999762%;baseline-shift:sub">1</tspan></tspan></text> + <text + sodipodi:linespacing="125%" + id="text4614" + y="380.34897" + x="152.27205" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="380.34897" + x="152.27205" + id="tspan4616" + sodipodi:role="line">y<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4618">2</tspan>-y<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4620">1</tspan></tspan></text> + <path + inkscape:connector-curvature="0" + id="path4716" + d="M 269.71073,191.71224 791.91605,462.45778" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4718)" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="611.58893" + y="349.7601" + id="text5130" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5132" + x="611.58893" + y="349.7601">distance</tspan></text> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path5830" + d="m 258.28216,197.42653 0,113.16557" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9, 3;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker5832)" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9, 3;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker6528)" + d="m 258.28216,311.71224 228.57143,-2.54872" + id="path6526" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path7468" + d="M 280.42502,182.42653 496.85359,297.02067" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:9, 3;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker7470)" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="400" + y="223.07649" + id="text7888" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan7890" + x="400" + y="223.07649">F</tspan></text> + <text + sodipodi:linespacing="125%" + id="text7892" + y="266.64792" + x="202.85715" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="266.64792" + x="202.85715" + id="tspan7894" + sodipodi:role="line">F<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan7896">y</tspan></tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="356.42859" + y="354.50507" + id="text7898" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan7900" + x="356.42859" + y="354.50507">F<tspan + id="tspan7902" + style="font-size:64.99999762%;baseline-shift:sub">x</tspan></tspan></text> + </g> +</svg> diff --git a/labs/lab4-barnes-hut-simulation/net-force.png b/labs/lab4-barnes-hut-simulation/net-force.png new file mode 100644 index 0000000000000000000000000000000000000000..0a24549d568fe8cdb5168bbf74dc03db5a41ded6 Binary files /dev/null and b/labs/lab4-barnes-hut-simulation/net-force.png differ diff --git a/labs/lab4-barnes-hut-simulation/net-force.svg b/labs/lab4-barnes-hut-simulation/net-force.svg new file mode 100644 index 0000000000000000000000000000000000000000..49e716b6bed3eb6b3ba4f656289e2e2ac2896549 --- /dev/null +++ b/labs/lab4-barnes-hut-simulation/net-force.svg @@ -0,0 +1,327 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="net-force.svg" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\barneshut\net-force.png" + inkscape:export-xdpi="44.869999" + inkscape:export-ydpi="44.869999"> + <defs + id="defs4"> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4222" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:0.50289019;fill:#000000;fill-opacity:0.50289019" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4224" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4214" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4216" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4208" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4210" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker12608" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path12610" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker11876" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path11878" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker10168" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path10170" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker7470" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path7472" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker4622" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4624" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4228" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4231" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.7" + inkscape:cx="742.82023" + inkscape:cy="615.35072" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path10486" + d="M 281.85359,190.99796 1066.8536,329.87782" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,24;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path4142" + cx="269.28571" + cy="190.21935" + r="13.141105" /> + <circle + r="13.141105" + cy="332.01859" + cx="1071.6188" + id="circle4144" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="267.72015" + y="162.38808" + id="text4146" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4148" + x="267.72015" + y="162.38808">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4150">1</tspan></tspan></text> + <text + sodipodi:linespacing="125%" + id="text4152" + y="360.44257" + x="1098.4303" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="360.44257" + x="1098.4303" + id="tspan4154" + sodipodi:role="line">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4158">2</tspan></tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4622)" + d="m 259.71073,187.42653 257.14285,45.7963" + id="path4190" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path5830" + d="M 273.99645,200.28367 659.71073,696.30638" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,24;stroke-dashoffset:0;stroke-opacity:1" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="724.85712" + y="443.07648" + id="text7888" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan7890" + x="724.85712" + y="443.07648">F<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan10448">net</tspan></tspan></text> + <text + sodipodi:linespacing="125%" + id="text7892" + y="192.36221" + x="402.85715" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="192.36221" + x="402.85715" + id="tspan7894" + sodipodi:role="line">F<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan7896">21</tspan></tspan></text> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.83889103, 3.91944551;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker10168)" + d="M 271.13929,191.71224 699.0589,476.74351" + id="path10166" + inkscape:connector-curvature="0" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="678.91986" + y="739.88269" + id="text10476" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan10478" + x="678.91986" + y="739.88269">m<tspan + id="tspan10480" + style="font-size:64.99999762%;baseline-shift:sub">3</tspan></tspan></text> + <circle + r="13.141105" + cy="704.74292" + cx="663.1554" + id="circle10482" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker11876)" + d="M 268.28215,190.28367 449.0589,429.60064" + id="path11874" + inkscape:connector-curvature="0" /> + <text + sodipodi:linespacing="125%" + id="text13116" + y="268.07651" + x="245.71429" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="268.07651" + x="245.71429" + id="tspan13118" + sodipodi:role="line">F<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan13120">31</tspan></tspan></text> + </g> +</svg> diff --git a/labs/lab4-barnes-hut-simulation/observation.png b/labs/lab4-barnes-hut-simulation/observation.png new file mode 100644 index 0000000000000000000000000000000000000000..722840d6db1e3cd4821265e9b05f781fc600ce25 Binary files /dev/null and b/labs/lab4-barnes-hut-simulation/observation.png differ diff --git a/labs/lab4-barnes-hut-simulation/observation.svg b/labs/lab4-barnes-hut-simulation/observation.svg new file mode 100644 index 0000000000000000000000000000000000000000..b41f92d7936430e19f2daf1f4d0b4e24d9b89d28 --- /dev/null +++ b/labs/lab4-barnes-hut-simulation/observation.svg @@ -0,0 +1,407 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="observation.svg" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\barneshut\observation.png" + inkscape:export-xdpi="44.869999" + inkscape:export-ydpi="44.869999"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker12608" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path12610" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker11876" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path11878" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker10168" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path10170" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker7470" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path7472" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker4718" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend" + inkscape:collect="always"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4720" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker4622" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4624" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4228" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4231" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.7" + inkscape:cx="557.69109" + inkscape:cy="615.35072" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path4142" + cx="269.28571" + cy="190.21935" + r="13.141105" /> + <circle + r="13.141105" + cy="332.01859" + cx="1071.6188" + id="circle4144" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="267.72015" + y="162.38808" + id="text4146" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4148" + x="267.72015" + y="162.38808">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4150">1</tspan></tspan></text> + <text + sodipodi:linespacing="125%" + id="text4152" + y="360.44257" + x="1098.4303" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="360.44257" + x="1098.4303" + id="tspan4154" + sodipodi:role="line">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4158">2</tspan></tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4622)" + d="m 259.71073,187.42653 152.85714,25.7963" + id="path4190" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + inkscape:connector-curvature="0" + id="path4716" + d="M 262.56786,184.56938 390.48747,293.88635" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker4718)" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path5830" + d="M 273.99645,200.28367 659.71073,696.30638" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,24;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path7468" + d="M 277.56788,196.71225 898.28217,742.73496" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,24;stroke-dashoffset:0;stroke-opacity:1" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="677.71429" + y="470.21933" + id="text7888" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan7890" + x="677.71429" + y="470.21933">F<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan10448">net</tspan></tspan></text> + <text + sodipodi:linespacing="125%" + id="text7892" + y="192.36221" + x="402.85715" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="192.36221" + x="402.85715" + id="tspan7894" + sodipodi:role="line">F<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan7896">21</tspan></tspan></text> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle8064" + cx="898.1554" + cy="741.17151" + r="13.141105" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="914.96698" + y="778.88129" + id="text8066" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan8068" + x="914.96698" + y="778.88129">m<tspan + id="tspan8070" + style="font-size:64.99999762%;baseline-shift:sub">3</tspan></tspan></text> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:7.83889103, 3.91944551;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#marker10168)" + d="M 271.13929,191.71224 661.91604,423.88636" + id="path10166" + inkscape:connector-curvature="0" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="335.71429" + y="329.50507" + id="text10450" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan10452" + x="335.71429" + y="329.50507">F<tspan + id="tspan10454" + style="font-size:64.99999762%;baseline-shift:sub">31</tspan></tspan></text> + <circle + r="13.141105" + cy="497.88727" + cx="1058.5369" + id="circle10468" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + sodipodi:linespacing="125%" + id="text10470" + y="527.02557" + x="1083.2056" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="527.02557" + x="1083.2056" + id="tspan10472" + sodipodi:role="line">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan10474">4</tspan></tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="678.91986" + y="739.88269" + id="text10476" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan10478" + x="678.91986" + y="739.88269">m<tspan + id="tspan10480" + style="font-size:64.99999762%;baseline-shift:sub">5</tspan></tspan></text> + <circle + r="13.141105" + cy="704.74292" + cx="663.1554" + id="circle10482" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,24;stroke-dashoffset:0;stroke-opacity:1" + d="M 281.85359,190.99796 1056.8536,497.02068" + id="path10484" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path10486" + d="M 281.85359,190.99796 1066.8536,329.87782" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3,24;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker11876)" + d="m 268.28215,190.28367 59.34818,80.74554" + id="path11874" + inkscape:connector-curvature="0" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.91944551;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker12608)" + d="M 266.85357,188.85509 493.34462,276.7435" + id="path12606" + inkscape:connector-curvature="0" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="498.57144" + y="269.50507" + id="text13110" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan13112" + x="498.57144" + y="269.50507">F<tspan + id="tspan13114" + style="font-size:64.99999762%;baseline-shift:sub">41</tspan></tspan></text> + <text + sodipodi:linespacing="125%" + id="text13116" + y="268.07651" + x="245.71429" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="268.07651" + x="245.71429" + id="tspan13118" + sodipodi:role="line">F<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan13120">51</tspan></tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="991.77698" + y="642.73987" + id="text13406" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan13408" + x="991.77698" + y="642.73987">M<tspan + id="tspan13410" + style="font-size:64.99999762%;baseline-shift:sub" /></tspan></text> + <circle + r="24.149361" + cy="598.31439" + cx="961.01251" + id="circle13404" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:10, 5;stroke-dashoffset:0;stroke-opacity:1" /> + </g> +</svg> diff --git a/labs/lab4-barnes-hut-simulation/quadtree.png b/labs/lab4-barnes-hut-simulation/quadtree.png new file mode 100644 index 0000000000000000000000000000000000000000..6db7c2139831b26340ee4480912c61de70f1d379 Binary files /dev/null and b/labs/lab4-barnes-hut-simulation/quadtree.png differ diff --git a/labs/lab4-barnes-hut-simulation/quadtree.svg b/labs/lab4-barnes-hut-simulation/quadtree.svg new file mode 100644 index 0000000000000000000000000000000000000000..e36aff055bc0fb5f3c4599a855e54d814e72b296 --- /dev/null +++ b/labs/lab4-barnes-hut-simulation/quadtree.svg @@ -0,0 +1,789 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="quadtree.svg" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\barneshut\quadtree.png" + inkscape:export-xdpi="32.65155" + inkscape:export-ydpi="32.65155"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker15906" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path15908" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker15660" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend" + inkscape:collect="always"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path15662" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker15306" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path15308" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker15086" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path15088" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="marker15028" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path15030" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker12608" + style="overflow:visible;" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path12610" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker11876" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path11878" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="marker10168" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path10170" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible;" + id="marker7470" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mend"> + <path + transform="scale(0.4) rotate(180) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path7472" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4228" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path4231" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.175" + inkscape:cx="1095.4717" + inkscape:cy="135.41975" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" + inkscape:snap-text-baseline="false" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path4142" + cx="83.397331" + cy="151.83354" + r="13.141105" /> + <circle + r="13.141105" + cy="721.93744" + cx="1136.2686" + id="circle4144" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="-17.160173" + y="189.79347" + id="text4146" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4148" + x="-17.160173" + y="189.79347">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4150">A</tspan></tspan></text> + <text + sodipodi:linespacing="125%" + id="text4152" + y="748.34113" + x="1165.1003" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="748.34113" + x="1165.1003" + id="tspan4154" + sodipodi:role="line">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan4158">E</tspan></tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1152.1206" + y="688.21014" + id="text7888" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan7890" + x="1152.1206" + y="688.21014">(x<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan14976">E</tspan>,y<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan14974">E</tspan>)</tspan></text> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle8064" + cx="1028.7399" + cy="1033.1528" + r="13.141105" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1045.5515" + y="1070.8625" + id="text8066" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan8068" + x="1045.5515" + y="1070.8625">m<tspan + id="tspan8070" + style="font-size:64.99999762%;baseline-shift:sub">C</tspan></tspan></text> + <circle + r="13.141105" + cy="653.45074" + cx="741.34894" + id="circle10468" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + sodipodi:linespacing="125%" + id="text10470" + y="682.58905" + x="766.01764" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="682.58905" + x="766.01764" + id="tspan10472" + sodipodi:role="line">m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan10474">D</tspan></tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="743.56964" + y="1123.7406" + id="text10476" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan10478" + x="743.56964" + y="1123.7406">m<tspan + id="tspan10480" + style="font-size:64.99999762%;baseline-shift:sub">B</tspan></tspan></text> + <circle + r="13.141105" + cy="1088.6008" + cx="727.80518" + id="circle10482" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="966.52319" + y="915.48102" + id="text13406" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan13408" + x="966.52319" + y="915.48102">mass</tspan></text> + <circle + r="24.149361" + cy="902.3703" + cx="916.56573" + id="circle13404" + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:10, 5;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.00350261;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle14942" + cx="1019.0909" + cy="35.033726" + r="13.141105" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1029.74" + y="8.9094801" + id="text14944" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan14946" + x="1029.74" + y="8.9094801">m<tspan + id="tspan14948" + style="font-size:64.99999762%;baseline-shift:sub">F</tspan></tspan></text> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect14952" + width="1052.579" + height="1052.579" + x="82.832512" + y="36.148746" /> + <rect + y="558.17084" + x="604.85461" + height="531.79376" + width="531.79376" + id="rect14954" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect14956" + width="521.14429" + height="521.14429" + x="84.185783" + y="37.502014" /> + <rect + y="-822.98016" + x="-869.66394" + height="264.46457" + width="264.46457" + id="rect14958" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + transform="scale(-1,-1)" /> + <rect + transform="scale(-1,-1)" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect14960" + width="265.25757" + height="265.25757" + x="-1134.2817" + y="-1087.5979" /> + <text + sodipodi:linespacing="125%" + id="text14978" + y="619.51978" + x="717.755" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="619.51978" + x="717.755" + id="tspan14980" + sodipodi:role="line">(x<tspan + id="tspan14982" + style="font-size:64.99999762%;baseline-shift:sub">D</tspan>,y<tspan + id="tspan14984" + style="font-size:64.99999762%;baseline-shift:sub">D</tspan>)</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="704.62305" + y="1058.9362" + id="text14986" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan14988" + x="704.62305" + y="1058.9362">(x<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan14990">B</tspan>,y<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan14992">B</tspan>)</tspan></text> + <text + sodipodi:linespacing="125%" + id="text14994" + y="1004.3879" + x="991.50635" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1004.3879" + x="991.50635" + id="tspan14996" + sodipodi:role="line">(x<tspan + id="tspan14998" + style="font-size:64.99999762%;baseline-shift:sub">C</tspan>,y<tspan + id="tspan15000" + style="font-size:64.99999762%;baseline-shift:sub">C</tspan>)</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:100%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="888.2475" + y="861.99701" + id="text15002" + sodipodi:linespacing="100%" + inkscape:export-xdpi="34.630001" + inkscape:export-ydpi="34.630001"><tspan + sodipodi:role="line" + id="tspan15004" + x="888.2475" + y="861.99701" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:30px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start">(mass<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan15020">X</tspan>,mass<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan15016">Y</tspan>)</tspan></text> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path15022" + cx="-218.31874" + cy="1531.9603" + r="74.751289" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.89491892;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#marker15028);marker-end:url(#marker15086)" + d="m 611.75315,1157.4181 516.98645,0" + id="path15026" + inkscape:connector-curvature="0" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="825.29462" + y="1220.0476" + id="text15252" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan15254" + x="825.29462" + y="1220.0476">size<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan15256">SE</tspan></tspan></text> + <circle + r="74.751289" + cy="1300.5319" + cx="301.68127" + id="circle15266" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + r="74.751289" + cy="1531.9603" + cx="130.25279" + id="circle15268" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + r="74.751289" + cy="1531.9603" + cx="495.96689" + id="circle15270" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle15272" + cx="861.68121" + cy="1531.9603" + r="74.751289" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="253.18787" + y="1313.6995" + id="text15274" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan15276" + x="253.18787" + y="1313.6995">Fork</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker12608)" + d="m 229.18777,1310.8423 -392.8572,165.7143" + id="path15278" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + inkscape:connector-curvature="0" + id="path15304" + d="m 256.33057,1357.9852 -85.7143,108.5714" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker15306)" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path15658" + d="m 350.61637,1359.4137 104.2857,108.5715" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker15660)" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker15906)" + d="m 376.33067,1312.2709 425.7143,164.2857" + id="path15904" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="20.037586" + y="1358.3875" + id="text16312" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan16314" + x="20.037586" + y="1358.3875">nw</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="143.27599" + y="1409.9053" + id="text16316" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan16318" + x="143.27599" + y="1409.9053">ne</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="412.98669" + y="1405.8646" + id="text16320" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan16322" + x="412.98669" + y="1405.8646">sw</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="537.23566" + y="1364.4484" + id="text16324" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan16326" + x="537.23566" + y="1364.4484">se</tspan></text> + <text + sodipodi:linespacing="125%" + id="text16328" + y="1544.2709" + x="430.90222" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1544.2709" + x="430.90222" + id="tspan16330" + sodipodi:role="line">Empty</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:111.40943146px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="97.928688" + y="1576.5566" + id="text16332" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan16334" + x="97.928688" + y="1576.5566">F</tspan></text> + <text + sodipodi:linespacing="125%" + id="text16342" + y="1574.5566" + x="-253.49989" + style="font-style:normal;font-weight:normal;font-size:111.40943146px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1574.5566" + x="-253.49989" + id="tspan16344" + sodipodi:role="line">A</tspan></text> + <text + sodipodi:linespacing="125%" + id="text16916" + y="1542.2709" + x="813.18781" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1542.2709" + x="813.18781" + id="tspan16918" + sodipodi:role="line">Fork</tspan></text> + <circle + r="74.751289" + cy="1766.2461" + cx="338.8241" + id="circle16920" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle16922" + cx="687.39557" + cy="1766.2461" + r="74.751289" /> + <circle + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle16924" + cx="1053.1097" + cy="1766.2461" + r="74.751289" /> + <circle + r="74.751289" + cy="1766.2461" + cx="1418.8241" + id="circle16926" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path16928" + d="m 786.33067,1545.128 -392.8572,165.7143" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker12608)" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker15306)" + d="m 813.47347,1592.2709 -85.7143,108.5714" + id="path16930" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker15660)" + d="m 907.75927,1593.6994 104.28563,108.5715" + id="path16932" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path16934" + d="m 933.47357,1546.5566 425.71423,164.2857" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker15906)" /> + <text + sodipodi:linespacing="125%" + id="text16936" + y="1584.1017" + x="605.75201" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1584.1017" + x="605.75201" + id="tspan16938" + sodipodi:role="line">nw</tspan></text> + <text + sodipodi:linespacing="125%" + id="text16940" + y="1644.1909" + x="700.41876" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1644.1909" + x="700.41876" + id="tspan16942" + sodipodi:role="line">ne</tspan></text> + <text + sodipodi:linespacing="125%" + id="text16944" + y="1640.1503" + x="970.12946" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1640.1503" + x="970.12946" + id="tspan16946" + sodipodi:role="line">sw</tspan></text> + <text + sodipodi:linespacing="125%" + id="text16948" + y="1598.7341" + x="1094.3785" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1598.7341" + x="1094.3785" + id="tspan16950" + sodipodi:role="line">se</tspan></text> + <text + sodipodi:linespacing="125%" + id="text16956" + y="1810.8424" + x="655.07159" + style="font-style:normal;font-weight:normal;font-size:111.40943146px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1810.8424" + x="655.07159" + id="tspan16958" + sodipodi:role="line">E</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:111.40943146px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="303.64294" + y="1808.8424" + id="text16960" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan16962" + x="303.64294" + y="1808.8424">D</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:111.40943146px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1383.6429" + y="1807.9852" + id="text16968" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan16970" + x="1383.6429" + y="1807.9852">C</tspan></text> + <text + sodipodi:linespacing="125%" + id="text16972" + y="1808.8424" + x="1017.9285" + style="font-style:normal;font-weight:normal;font-size:111.40943146px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="1808.8424" + x="1017.9285" + id="tspan16974" + sodipodi:role="line">B</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="918.23126" + y="1466.4738" + id="text16976" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan16978" + x="918.23126" + y="1466.4738">mass = m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan16980">D</tspan> + m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan16982">E</tspan> + m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan16984">B</tspan> + m<tspan + style="font-size:64.99999762%;baseline-shift:sub" + id="tspan16986">C</tspan></tspan></text> + </g> +</svg> diff --git a/labs/lab4-barnes-hut-simulation/sectormatrix.png b/labs/lab4-barnes-hut-simulation/sectormatrix.png new file mode 100644 index 0000000000000000000000000000000000000000..3d95d1fe934fd00122e95803dc3e2fa6a1789feb Binary files /dev/null and b/labs/lab4-barnes-hut-simulation/sectormatrix.png differ diff --git a/labs/lab4-barnes-hut-simulation/sectormatrix.svg b/labs/lab4-barnes-hut-simulation/sectormatrix.svg new file mode 100644 index 0000000000000000000000000000000000000000..e9c18380570ae70575c148b07bddf03cc51c82cd --- /dev/null +++ b/labs/lab4-barnes-hut-simulation/sectormatrix.svg @@ -0,0 +1,477 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 744.09448819 1052.3622047" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="sectormatrix.svg" + inkscape:export-filename="C:\cygwin\home\axel22\workspaces\scala\parprog\statements\barneshut\sectormatrix.png" + inkscape:export-xdpi="32.6516" + inkscape:export-ydpi="32.6516"> + <defs + id="defs4"> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="marker4830" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4832" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:isstock="true" + style="overflow:visible" + id="marker4542" + refX="0.0" + refY="0.0" + orient="auto" + inkscape:stockid="Arrow1Mstart" + inkscape:collect="always"> + <path + transform="scale(0.4) translate(10,0)" + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + id="path4544" /> + </marker> + <marker + inkscape:stockid="Arrow1Mstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mstart" + style="overflow:visible" + inkscape:isstock="true" + inkscape:collect="always"> + <path + id="path4196" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.4) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Sstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Sstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4202" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.2) translate(6,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.49497475" + inkscape:cx="692.30131" + inkscape:cy="448.67197" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1600" + inkscape:window-height="877" + inkscape:window-x="-4" + inkscape:window-y="-4" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4138" + width="157.25688" + height="157.25688" + x="160.41716" + y="293.24829" /> + <rect + y="293.24829" + x="317.80426" + height="157.25688" + width="157.25688" + id="rect4140" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="293.24829" + x="474.40179" + height="157.25688" + width="157.25688" + id="rect4142" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4144" + width="157.25688" + height="157.25688" + x="631.78894" + y="293.24829" /> + <rect + y="450.89859" + x="160.41716" + height="157.25688" + width="157.25688" + id="rect4146" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4148" + width="157.25688" + height="157.25688" + x="317.80426" + y="450.89859" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4150" + width="157.25688" + height="157.25688" + x="474.40179" + y="450.89859" /> + <rect + y="450.89859" + x="631.78894" + height="157.25688" + width="157.25688" + id="rect4152" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="608.02252" + x="160.41716" + height="157.25688" + width="157.25688" + id="rect4154" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4156" + width="157.25688" + height="157.25688" + x="317.80426" + y="608.02252" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4158" + width="157.25688" + height="157.25688" + x="474.40179" + y="608.02252" /> + <rect + y="608.02252" + x="631.78894" + height="157.25688" + width="157.25688" + id="rect4160" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4162" + width="157.25688" + height="157.25688" + x="160.41716" + y="765.67279" /> + <rect + y="765.67279" + x="317.80426" + height="157.25688" + width="157.25688" + id="rect4164" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + y="765.67279" + x="474.40179" + height="157.25688" + width="157.25688" + id="rect4166" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.60580969;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4168" + width="157.25688" + height="157.25688" + x="631.78894" + y="765.67279" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path4170" + cx="435" + cy="491.64792" + r="13.571428" /> + <circle + r="13.571428" + cy="854.50507" + cx="699.28577" + id="circle4172" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4174" + cx="769.28577" + cy="824.50507" + r="13.571428" /> + <circle + r="13.571428" + cy="894.50507" + cx="790.71436" + id="circle4176" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4178" + cx="726.42865" + cy="295.93362" + r="13.571428" /> + <circle + r="13.571428" + cy="805.93365" + cx="267.85727" + id="circle4180" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <circle + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="circle4182" + cx="555.20319" + cy="717.37964" + r="13.571428" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:15, 5;stroke-dashoffset:0;marker-start:url(#Arrow1Mstart)" + d="m 721.42857,569.50506 c 250,-70 350.00003,-5.71428 350.00003,-5.71428" + id="path4184" + inkscape:connector-curvature="0" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="1090" + y="582.36218" + id="text4530" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan4532" + x="1090" + y="582.36218" + style="-inkscape-font-specification:'Andale Mono';font-family:'Andale Mono';font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal">ConcBuffer[Body]</tspan></text> + <path + inkscape:connector-curvature="0" + id="path4540" + d="m 738.57143,392.3622 c 250,-70 395.71437,142.85715 395.71437,142.85715" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:15, 5;stroke-dashoffset:0;stroke-opacity:1;marker-start:url(#marker4542)" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:15, 5;stroke-dashoffset:0;stroke-opacity:1;marker-start:url(#marker4830)" + d="m 725.71429,699.50506 c 280.00001,38.57143 402.85731,-92.85714 402.85731,-92.85714" + id="path4828" + inkscape:connector-curvature="0" /> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="171.72594" + y="345.25543" + id="text5218" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5220" + x="171.72594" + y="345.25543">0,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5222" + y="345.25543" + x="341.43158" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="345.25543" + x="341.43158" + id="tspan5224" + sodipodi:role="line">1,0</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="494.97476" + y="345.25543" + id="text5226" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5228" + x="494.97476" + y="345.25543">2,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5230" + y="345.25543" + x="650.53827" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="345.25543" + x="650.53827" + id="tspan5232" + sodipodi:role="line">3,0</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5234" + y="504.85953" + x="171.72594" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="504.85953" + x="171.72594" + id="tspan5236" + sodipodi:role="line">0,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="341.43158" + y="504.85953" + id="text5238" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5240" + x="341.43158" + y="504.85953">1,1</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5242" + y="504.85953" + x="494.97476" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="504.85953" + x="494.97476" + id="tspan5244" + sodipodi:role="line">2,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="650.53827" + y="504.85953" + id="text5246" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5248" + x="650.53827" + y="504.85953">3,1</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="171.72594" + y="656.38239" + id="text5250" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5252" + x="171.72594" + y="656.38239">0,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5254" + y="656.38239" + x="341.43158" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="656.38239" + x="341.43158" + id="tspan5256" + sodipodi:role="line">1,2</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="494.97476" + y="656.38239" + id="text5258" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5260" + x="494.97476" + y="656.38239">2,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5262" + y="656.38239" + x="650.53827" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="656.38239" + x="650.53827" + id="tspan5264" + sodipodi:role="line">3,2</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5266" + y="813.96619" + x="171.72594" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="813.96619" + x="171.72594" + id="tspan5268" + sodipodi:role="line">0,3</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="341.43158" + y="813.96619" + id="text5270" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5272" + x="341.43158" + y="813.96619">1,3</tspan></text> + <text + sodipodi:linespacing="125%" + id="text5274" + y="813.96619" + x="494.97476" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + y="813.96619" + x="494.97476" + id="tspan5276" + sodipodi:role="line">2,3</tspan></text> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="650.53827" + y="813.96619" + id="text5278" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan5280" + x="650.53827" + y="813.96619">3,3</tspan></text> + </g> +</svg>