タグ

2015年11月8日のブックマーク (1件)

  • 二重数で自動微分する - Qiita

    と記述する数である。ここで、$\epsilon$ が複素数の $i$ にあたるもので、$\epsilon^2 = 0$ という性質を持つものとして定義されている。 加減乗除も複素数と同様に定義されて、C++ で実装すると、 #pragma once #include <ostream> namespace math { // 二重数 a + b ε template <typename T = double> class dual_number { public: using this_type = dual_number<T>; public: dual_number(T a, T b = T(0)) : a_(a), b_(b) {} this_type operator - () const { return this_type(-a_, -b_); } this_type& ope

    二重数で自動微分する - Qiita
    ir9
    ir9 2015/11/08