Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Algorithms Sedgewick Wayne | 1,944 | 15 days ago | 7 | mit | Java | |||||
Solutions to all the exercises of the Algorithms book by Robert Sedgewick and Kevin Wayne | ||||||||||
Mir Algorithm | 167 | 10 | 29 | 9 days ago | 610 | February 07, 2023 | 24 | other | D | |
Dlang Core Library | ||||||||||
Floaxie | 28 | 3 months ago | apache-2.0 | C++ | ||||||
Floating point printing and parsing library based on Grisu2 and Krosh algorithms | ||||||||||
Strip Packing | 14 | 4 years ago | 1 | mit | Python | |||||
Algorithm for the strip packing problem with guillotine cuts constraint | ||||||||||
Prettyprint | 7 | a year ago | 3 | other | Ruby | |||||
This class implements a pretty printing algorithm. | ||||||||||
Gopprint | 5 | 5 years ago | mit | Go | ||||||
Implementation of Kiselyov et al's pretty printing algorithm in Go. | ||||||||||
Algorithms | 4 | a year ago | 3 | mit | C++ | |||||
A collection of templates/algorithms for competitive coding. | ||||||||||
Packager | 3 | 6 years ago | JavaScript | |||||||
Binary tree bin packing algorithm for packing pictures to sheet for printing | ||||||||||
Diff Java | 2 | 7 years ago | gpl-3.0 | Java | ||||||
Clone and improvements | ||||||||||
Soren Cslab Scripts | 2 | 7 years ago | mit | Shell | ||||||
Scripts for fixing firefox locks, printing, timing algorithms, and checking your quota. |
/+dub.sdl:
dependency "mir-algorithm" version="~>2.0.0"
+/
void main()
{
import mir.ndslice;
auto matrix = slice!double(3, 4);
matrix[] = 0;
matrix.diagonal[] = 1;
auto row = matrix[2];
row[3] = 6;
assert(matrix[2, 3] == 6); // D & C index order
import mir.stdio;
matrix.writeln;
// prints [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 6.0]]
}
/+dub.sdl:
dependency "mir-algorithm" version="~>2.0.0"
+/
void main()
{
import mir.ndslice;
import std.stdio : writefln;
enum fmt = "%(%(%.2f %)\n%)\n";
// Magic sqaure.
// `a` is lazy, each element is computed on-demand.
auto a = magic(5).as!float;
writefln(fmt, a);
// 5x5 grid on sqaure [1, 2] x [0, 1] with values x * x + y.
// `b` is lazy, each element is computed on-demand.
auto b = linspace!float([5, 5], [1f, 2f], [0f, 1f]).map!"a * a + b";
writefln(fmt, b);
// allocate a 5 x 5 contiguous matrix
auto c = slice!float(5, 5);
c[] = transposed(a + b / 2); // no memory allocations here
// 1. b / 2 - lazy element-wise operation with scalars
// 2. a + (...) - lazy element-wise operation with other slices
// Both slices must be `contiguous` or one-dimensional.
// 3. transposed(...) - trasposes matrix view. The result is `universal` (numpy-like) matrix.
// 5. c[] = (...) -- performs element-wise assignment.
writefln(fmt, c);
}