This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %%MatrixMarket matrix coordinate real general | |
| 1200 1200 4963 | |
| 1 1 6.92520775623268483e-04 | |
| 801 1 -1.00000000000000022e+00 | |
| 802 1 5.00000000000000111e-01 | |
| 821 1 5.00000000000000111e-01 | |
| 2 2 1.38504155124653697e-03 | |
| 801 2 5.00000000000000111e-01 | |
| 802 2 -2.00000000000000044e+00 | |
| 803 2 5.00000000000000111e-01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # https://stackoverflow.com/questions/13719122/how-to-use-opendiff-as-default-mergetool/36841553#36841553 | |
| # https://apple.stackexchange.com/questions/476348/use-apples-filemerge-from-command-line-and-have-it-wait-instead-of-exiting-imme | |
| file1=$(readlink -f "$1") | |
| file2=$(readlink -f "$2") | |
| open -a FileMerge -n -W --args -left "$file1" -right "$file2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <optional> | |
| #include <cmath> | |
| ////////////////////////////////////////////////////////////////////////// | |
| /// ElasticModuli class implementing the conversion table at | |
| /// https://en.wikipedia.org/wiki/Elastic_modulus | |
| /// | |
| /// Setting any two input parameters will calculate the remaining four. | |
| /// | |
| ////////////////////////////////////////////////////////////////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from semanticscholar import SemanticScholar | |
| from collections import defaultdict | |
| from tqdm import tqdm | |
| import os | |
| import builtins | |
| import re | |
| import unicodedata | |
| from collections import defaultdict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Adapted from ADOL-C/examples/additional_examples/sparse/sparse_hessian.cpp | |
| #include <math.h> | |
| #include <cstdlib> | |
| #include <cstdio> | |
| #include <adolc/adolc.h> | |
| #include <adolc/adolc_sparse.h> | |
| #define tag 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # May need to have python 3.10 or higher installed | |
| # Use blender to convert .gltf file to .obj file | |
| # | |
| import bpy | |
| import sys | |
| # Get the arguments passed to the script, skipping the first three | |
| # sys.argv[0] is blender's executable, sys.argv[1] is '-P', sys.argv[2] is the script name | |
| args = sys.argv[1:] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://github.com/autodiff/autodiff/issues/179 | |
| #define FORWARD | |
| #ifdef FORWARD | |
| #include <autodiff/forward/dual.hpp> | |
| #else | |
| #include <autodiff/reverse/var.hpp> | |
| #endif | |
| #include <complex> | |
| template <typename T> T f(const T & x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // requires -std=c++17 | |
| #include <stdio.h> | |
| #include <autodiff/forward/real.hpp> // https://github.com/autodiff/autodiff/ | |
| /// Take a gradient descent step at a given function | |
| /// | |
| /// @tparam FuncType should be an auto-lambda (i.e., `[](auto x)->auto{…}`) | |
| /// @param[in] func scalar function | |
| /// @param[in] initial_guess initial input to func | |
| /// @return initial_guess - dfdx where dfdx is the derivative of func at initial_guess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cmath> | |
| #include <cstdio> | |
| float angle_via_law_of_cosines(float a, float b, float c) | |
| { | |
| return std::acos( (b+a-c) / (float(2)*std::sqrt(b*a)) ); | |
| } | |
| float angle_via_kahan(float a, float b, float c) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/CMakeLists.txt b/CMakeLists.txt | |
| index 8801572..a4ab77b 100644 | |
| --- a/CMakeLists.txt | |
| +++ b/CMakeLists.txt | |
| @@ -21,9 +21,11 @@ include(FeatureSummary) # More verbose Output for libraries using set_package_pr | |
| # Look for supporting libraries | |
| # ----------------------------- | |
| -find_package(Eigen3 NO_MODULE REQUIRED) | |
| -set_package_properties(Eigen3 PROPERTIES TYPE REQUIRED PURPOSE "C++ vector data structures") |
NewerOlder