clad icon indicating copy to clipboard operation
clad copied to clipboard

clad -- automatic differentiation for C/C++

Results 301 clad issues
Sort by recently updated
recently updated
newest added

Reproducible example: ```c++ double identity(double i) { return i; } namespace custom_derivatives { void identity_grad(double i, clad::array_ref d_i) { d_i += 1; } } auto d_identity = clad::gradient(identity); ``` **Result:**...

This PR adds support for differentiating switch statements in the reverse mode AD. The basic idea used to differentiate switch statement is that in the forward pass, processing of the...

Clad uses the [`isUnusedResult`](https://github.com/vgvassilev/clad/blob/edb192554fb3b45a5ebaa786227847779e16b4a0/lib/Differentiator/VisitorBase.cpp#L197) function to check for unneccessary statements and remove them from the generated code. Since the array subscript expression of `clad::array` calls it's operator overload the function...

good first issue

Add a no-op c-style cast in the function argument to numerical differentiation so that the printing of the generated code retains the context(type) of the function argument. Earlier the printed...

I am trying to setup clad via conda. I have installed clad via conda-forge. when I run `clang -cc1 -x c++ -std=c++11 -load /Users/me/opt/miniconda3/envs/clad_env/lib/clad.dylib sourcfile.cpp`, I see the error: ```...

This gives us a great deal of coverage. Clang has well-developed assert system which often can detect malformed AST. This is very essential for clad as until today I would...

It might be useful to employ a callback-based approach to implement a generic interface that all plugins to clad can implement, this will maintain uniformity and ensure that access rights...

```bash ./bin/cling -fplugin=etc/cling/plugins/lib/clad.so -I /home/vvassilev/workspace/builds/scratch/cling-build/builddir/etc/cling/plugins/include/ [cling]$ #include ``` Shows: ```cling: /home/vvassilev/workspace/builds/scratch/cling-build/cling-src/tools/cling/lib/Interpreter/Transaction.cpp:173: void cling::Transaction::forceAppend(cling::Transaction::DelayCallInfo): Assertion `oldDCI != DCI && "Duplicates?!"' failed. #0 0x0000555557d64bc3 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/vvassilev/workspace/builds/scratch/cling-build/cling-src/lib/Support/Unix/Signals.inc:533:0 #1 0x0000555557d64c56 PrintStackTraceSignalHandler(void*) /home/vvassilev/workspace/builds/scratch/cling-build/cling-src/lib/Support/Unix/Signals.inc:594:0 #2 0x0000555557d62b30...

Currently, we have defined several functions in the `Differentiator.h` header file (and also in header files that `Differentiator.h` includes). This causes redefinition errors if more than one source files includes...