|
From: <mat...@gm...> - 2020-11-23 18:18:01
|
Hi David, Because of (c), I assume you are talking about the C++ version of QuantLib. There is, for example, this: https://github.com/lballabio/QuantLib/blob/60afa352713bac2b759332686ed3070d357cfde8/ql/utilities/null.hpp#L76 Referencing: https://github.com/lballabio/QuantLib/blob/60afa352713bac2b759332686ed3070d357cfde8/ql/qldefines.hpp#L181 I see there is also https://github.com/lballabio/QuantLib/blob/60afa352713bac2b759332686ed3070d357cfde8/ql/math/matrixutilities/sparsematrix.hpp#L68 Maybe a similar wrapper for something like vector_sparse.hpp in boost/uBLAS could also work (better) for your use case? Best regards, Matthias From: da...@el... <da...@el...> Sent: Monday, 23 November 2020 18:25 To: qua...@li... Subject: [Quantlib-users] Using NaN in Quantlib Hi, hope everyone is well. A simple question: does QuantLib define NaN somewhere? I have a sparse QuantLib::Array and want to set un-used elements to NaN so I can see which elements are valid and which aren’t. a) Is there any conceptual problem with this? b) how do I set a Real to NaN in QL? c) should I be using a std::vector instead, which could hold a pair<bool,Real> with the bool used to denote a valid value? Thanks David Sansom |