Я написал код реализации расчета любого порядка производной (значение) функции std :: tgamma (). Но этот код часто пересматривает выражения. Как можно это оптимизировать? < /P>
#include
#include
#include
namespace peter
{
template
struct multiplication;
template
struct polygamma
{ struct derivative
{ typedef polygamma type;
};
double operator()(const double _d) const
{ return boost::math::polygamma(ORDER, _d);
}
};
struct gamma
{ struct derivative
{ typedef multiplication type;
};
double operator()(const double _d) const
{ return std::tgamma(_d);
}
};
template
struct addition
{ struct derivative
{ typedef addition<
typename L::derivative::type,
typename R::derivative::type
> type;
};
double operator()(const double _d) const
{ return L()(_d) + R()(_d);
}
};
template
struct multiplication
{ struct derivative
{ typedef addition<
multiplication<
typename L::derivative::type,
R
>,
multiplication<
L,
typename R::derivative::type
>
> type;
};
double operator()(const double _d) const
{ return L()(_d) * R()(_d);
}
};
template
struct derive
{ typedef typename derive::type::derivative::type type;
};
template
struct derive
{ typedef T type;
};
}
int main()
{ //using namespace peter;
peter::derive
::type s;
std::cout
Подробнее здесь: https://stackoverflow.com/questions/793 ... r-any-give
Как вычислить усеченный ряд Тейлора для гамма-функции для любого заданного порядка? ⇐ C++
Программы на C++. Форум разработчиков
1737842647
Anonymous
Я написал код реализации расчета любого порядка производной (значение) функции std :: tgamma (). Но этот код часто пересматривает выражения. Как можно это оптимизировать? < /P>
#include
#include
#include
namespace peter
{
template
struct multiplication;
template
struct polygamma
{ struct derivative
{ typedef polygamma type;
};
double operator()(const double _d) const
{ return boost::math::polygamma(ORDER, _d);
}
};
struct gamma
{ struct derivative
{ typedef multiplication type;
};
double operator()(const double _d) const
{ return std::tgamma(_d);
}
};
template
struct addition
{ struct derivative
{ typedef addition<
typename L::derivative::type,
typename R::derivative::type
> type;
};
double operator()(const double _d) const
{ return L()(_d) + R()(_d);
}
};
template
struct multiplication
{ struct derivative
{ typedef addition<
multiplication<
typename L::derivative::type,
R
>,
multiplication<
L,
typename R::derivative::type
>
> type;
};
double operator()(const double _d) const
{ return L()(_d) * R()(_d);
}
};
template
struct derive
{ typedef typename derive::type::derivative::type type;
};
template
struct derive
{ typedef T type;
};
}
int main()
{ //using namespace peter;
peter::derive
::type s;
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79387595/how-to-calculate-the-truncated-taylor-series-for-the-gamma-function-for-any-give[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия