Skip to content

Instantly share code, notes, and snippets.

View pierre-24's full-sized avatar
😃

Pierre Beaujean pierre-24

😃
View GitHub Profile
@pierre-24
pierre-24 / Install guide for OpenJML.md
Last active May 26, 2024 06:53
OpenJML install guide

Install guide for OpenJML

If you have any problem, send an email to pierre.beaujean@unamur.be, find me on Discord or IRL in the lecture room, I'll be happy to help ;)

Preamble

Whatever your choice, OpenJML only runs with Java <= 8. Thus, you need to install this version of Java.

On ubuntu, you may do the following:

class KnapSackProblem {
int[] vals;
int[] weights;
KnapSackProblem(int[] v, int[] w) { vals = v; weights = w; }
public int solve_naive(int W) {
return solve_recnaive(vals.length - 1, W);
}
4 1 0 1
7 0.000000000000 0.000000000000 -0.114091591161 0.000000000000
1 -1.817280998039 0.000000000000 0.528409372569 0.000000000000
1 0.908640499019 -1.573811509290 0.528409372569 0.000000000000
1 0.908640499019 1.573811509290 0.528409372569 0.000000000000
1 2 1.000 3 1.000 4 1.000
2 1 1.000
3 1 1.000
4 1 1.000