n*****e 发帖数: 17 | 1 下面程序中的数组c和S用到了负数维数,请问它是怎么实现的?
谢谢!
double CRRTrinomialTree::buildTrinomialTreeCRRAmerican(double price,
double strike,
double vol, double rate, double div, double T, long N, char type)
{
int i, j;
double pd; // down probability
double pm; // middle probability
double pu; // up probability
double S[250][250]; // stock price at node i, j
double c[250][250]; // call price at node i,j
double up = 0.0; // up movement
double down =0.0; // down movement
double dt = T/N; // time step
double drift = rate | u****u 发帖数: 229 | 2 Funny. Don't you remember how C access/store data in memory? It's obvious.
【在 n*****e 的大作中提到】 : 下面程序中的数组c和S用到了负数维数,请问它是怎么实现的? : 谢谢! : double CRRTrinomialTree::buildTrinomialTreeCRRAmerican(double price, : double strike, : double vol, double rate, double div, double T, long N, char type) : { : int i, j; : double pd; // down probability : double pm; // middle probability : double pu; // up probability
| n*****e 发帖数: 17 | 3 一句话点醒梦中人...
【在 u****u 的大作中提到】 : Funny. Don't you remember how C access/store data in memory? It's obvious.
|
|