Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 380 Bytes

README.md

File metadata and controls

22 lines (18 loc) · 380 Bytes

numeric

Automatic differentiation and L-BFGS implementation in the D Programming Language.

auto solver = new SimpleSolver!(double, 2);

struct Func
{
    T opCall(T)(in T[] x)
    {
        return x[0] * x[0] + x[1] * x[1];
    }
}

Func f;
solver.setAutoDiffCost(f);

auto x = new double[2];
x[] = 1;
solver.solve(x); //solve by L-BFGS
assert(equals(x, [0.0, 0.0]));