thank you Ferdinando, I got it. Here duplicate means same date but different value, I've been misled, 'conflict' is better ------------------ Original ------------------ From: "Ferdinando Ametrano"<[hidden email]>; Date: Wed, Nov 14, 2012 11:04 PM To: "rage"<[hidden email]>; Cc: "QuantLib-users"<[hidden email]>; Subject: Re: [Quantlib-users] some doubt about the the value ofnoDuplicatedFixing in "ql/index.hpp" _same_ value) it is just silently ignored. The noDuplicatedFixing alert is set to false only if trying to add a different value for an existing fixing. The noDuplicatedFixing variable should actually be called noConflictingFixing instead ciao -- Nando On Tue, Nov 13, 2012 at 12:16 PM, rage <[hidden email]> wrote: > hi guys, I have some doubt in the index class when determining the value of > noDueplicateFixing. pls help me figure out. thanks! > > "ql/index.hpp" > this is the part that determining weather there is a duplicated value in the > history: > > while (dBegin != dEnd) { > validFixing = isValidFixingDate(*dBegin); > Real currentValue = h[*dBegin]; > missingFixing= forceOverwrite || > close(currentValue,nullValue); > if (validFixing) { > if (missingFixing) > h[*(dBegin++)] = *(vBegin++); > else if (close(currentValue,*(vBegin))) { > ++dBegin; > ++vBegin; > } else { > noDuplicatedFixing = false; > duplicatedDate = *(dBegin++); > duplicatedValue = *(vBegin++); > } > } else { > noInvalidFixing = false; > invalidDate = *(dBegin++); > invalidValue = *(vBegin++); > } > } > > ------>I think this snippet has some problem > else if (close(currentValue,*(vBegin))) { > ++dBegin; > ++vBegin; > } else { > noDuplicatedFixing = false; > duplicatedDate = *(dBegin++); > duplicatedValue = *(vBegin++); > } > > ----->I think it should look like this: > else if (close(currentValue,*(vBegin))) { > noDuplicatedFixing = false; > duplicatedDate = *(dBegin++); > duplicatedValue = *(vBegin++); > } > > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |