Skip to content

Commit a62b204

Browse files
committed
Initial commit.
0 parents  commit a62b204

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name = "AlgorithmInterface"
2+
uuid = "125df6b2-f2b1-44d3-9e4a-6c50c163a640"
3+
authors = ["Ronny Bergmann <git@ronnybergmann.net>"]
4+
version = "0.1.0"

Readme.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# AlgorithmInterface.jl
2+
3+
`AlgorithmInterface.jl` is a Julia package tp provide a common interface to run iterative tasks. **Algorith** here refers to an iterative sequence of commands, that are run until a certain stopping criterion is met.
4+
5+
# Statement of need
6+
7+
A first approach to algorithms is a simple for-loop for a maxiimum number of iterations.
8+
Using an interface instead allows to both specify different criteria to stop easily, even in their combination.
9+
Furthermore a generic interface allows to both “hok into” an algorithm easily as well as combining them.
10+
11+
A common interface for algorithms allows to reuse common code – especially stopping criteria, but especially also logging, debug, recording, and caching capabilities. Finally, a common interface also allows to easily combine existing algorithms, hence enhancing interoperability, for example using one algorithm as a sub routine of another one.
12+
13+
# Main features
14+
15+
We consider solving _Tasks_, which consist of a
16+
17+
* `Problem` to solve, which constains all information that is static to the problem and usually does not change during the iterations, this might for example be a cost function and its gradient in an optimisation problem
18+
* An `AlgorithmState` that both specifies which algorithm to use to _solve_ the problem, but also stores all parameters that an algorithm needs as well as everything the algorithm needs to store between two iterations.
19+
20+
This generic data structures are accompanied by the methods
21+
22+
* `step!(problem::Problem, state::AlgorithmState, k)` to perform the `k`th iteration of the algorithm.
23+
* `solve!(problem::Problem, state::AlgorithmState)` to solve a problem with a given algorithm, which is identified by the `AlgorithmState`.
24+
* `stop(problem::Problem, state::AlgorithmState)` to check whether the algorithm should stop.
25+
26+
where the first is the main one to implement for a new algorithm.

src/AlgorithmInterface.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module AlgorithmInterface
2+
3+
end # module AlgorithmInterface

0 commit comments

Comments
 (0)