-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0095a6f
commit 7963145
Showing
44 changed files
with
482 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""J1: peaks function""" | ||
|
||
|
||
def j1(x: float, y: float) -> float: | ||
"""J1: peaks function""" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""J2: Rastrigin's function""" | ||
|
||
|
||
def j2(x: float, y: float) -> float: | ||
"""J2: Rastrigin's function""" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""J3: circles function""" | ||
|
||
|
||
def j3(x: float, y: float) -> float: | ||
"""J3: circles function""" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""J4: staircase function""" | ||
|
||
|
||
def j4(x: float, y: float) -> float: | ||
"""J4: staircase function""" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""J5: plateaus function""" | ||
|
||
|
||
def j5(x: float, y: float) -> float: | ||
"""J5: plateaus function""" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from typing import Iterable | ||
|
||
|
||
def sum_of_squares(values: Iterable[float]) -> float: | ||
""" | ||
Calculates the sum of squares of each value in values | ||
""" | ||
... | ||
|
||
|
||
def norm(values: Iterable[float]) -> float: | ||
""" | ||
Calculates the norm of the given values | ||
""" | ||
... | ||
|
||
|
||
def float_equals(a: float, b: float, precision: float = 1e-7) -> bool: | ||
""" | ||
Compares two floats for equality given precision | ||
""" | ||
... | ||
|
||
|
||
def sum_of_square_difference(v1: Iterable[float], v2: Iterable[float]) -> float: | ||
""" | ||
Calculates the sum of the square differences of the components of | ||
v1 and v2 vectors. | ||
""" | ||
... | ||
|
||
|
||
def distance(x1: float, y1: float, z1: float, x2: float, y2: float, z2: float) -> float: | ||
""" | ||
Calculates the distance between point 1 and point 2. | ||
""" | ||
... | ||
|
||
|
||
def distance2(x1: float, y1: float, z1: float, x2: float, y2: float, z2: float) -> float: | ||
""" | ||
Calculates the distance^2 between point 1 and point 2. | ||
""" | ||
... |
Oops, something went wrong.