⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bonds_duration_termstru.cc

📁 Financial Recipes
💻 CC
字号:
#include <vector>#include "term_structure_class.h"double bonds_duration(const vector<double>& cashflow_times,		      const vector<double>& cashflow_amounts,		      const term_structure_class& d ) {    double S=0;    double D1=0;    for (unsigned i=0;i<cashflow_times.size();i++){	S += cashflow_amounts[i] * d.discount_factor(cashflow_times[i]);	D1 += cashflow_times[i] * cashflow_amounts[i] * d.discount_factor(cashflow_times[i]);    };    return D1/S;};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -