diff --git a/acinclude.m4 b/acinclude.m4 index 46e8efdf944..961aeda8db5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -100,31 +100,6 @@ AC_DEFUN([QL_CHECK_BOOST_VERSION_1_59_OR_HIGHER], ]) ]) - - -# QL_CHECK_BOOST_UBLAS -# -------------------- -# Check whether the Boost headers are available -AC_DEFUN([QL_CHECK_BOOST_UBLAS], -[AC_MSG_CHECKING([for Boost::uBLAS support]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[@%:@include - @%:@if BOOST_VERSION > 106300 - @%:@include - @%:@endif - @%:@include - @%:@include - @%:@include ]], - [[]])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_WARN([Some functionality will be disabled.]) - AC_DEFINE([QL_NO_UBLAS_SUPPORT],[], - [Define this if your compiler does not support Boost::uBLAS.]) - ]) -]) - # QL_CHECK_BOOST_UNIT_TEST # ------------------------ # Check whether the Boost unit-test framework is available @@ -303,7 +278,6 @@ AC_DEFUN([QL_CHECK_BOOST_TEST_INTERPROCESS], AC_DEFUN([QL_CHECK_BOOST], [AC_REQUIRE([QL_CHECK_BOOST_DEVEL]) AC_REQUIRE([QL_CHECK_BOOST_VERSION]) - AC_REQUIRE([QL_CHECK_BOOST_UBLAS]) AC_REQUIRE([QL_CHECK_BOOST_UNIT_TEST]) ]) diff --git a/ql/experimental/finitedifferences/fdmblackscholesfwdop.cpp b/ql/experimental/finitedifferences/fdmblackscholesfwdop.cpp index 19168470f91..932f5c35652 100644 --- a/ql/experimental/finitedifferences/fdmblackscholesfwdop.cpp +++ b/ql/experimental/finitedifferences/fdmblackscholesfwdop.cpp @@ -121,11 +121,10 @@ namespace QuantLib { return solve_splitting(direction_, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmBlackScholesFwdOp::toMatrixDecomp() const { std::vector retVal(1, mapT_.toMatrix()); return retVal; } -#endif + } diff --git a/ql/experimental/finitedifferences/fdmblackscholesfwdop.hpp b/ql/experimental/finitedifferences/fdmblackscholesfwdop.hpp index 9a9f5603da2..072a35a1dfc 100644 --- a/ql/experimental/finitedifferences/fdmblackscholesfwdop.hpp +++ b/ql/experimental/finitedifferences/fdmblackscholesfwdop.hpp @@ -52,9 +52,7 @@ class FdmBlackScholesFwdOp : public FdmLinearOpComposite { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif private: const ext::shared_ptr mesher_; const ext::shared_ptr rTS_, qTS_; diff --git a/ql/experimental/finitedifferences/fdmdupire1dop.cpp b/ql/experimental/finitedifferences/fdmdupire1dop.cpp index ef6921a61d8..e270c005829 100644 --- a/ql/experimental/finitedifferences/fdmdupire1dop.cpp +++ b/ql/experimental/finitedifferences/fdmdupire1dop.cpp @@ -19,10 +19,7 @@ #include #include - -#if !defined(QL_NO_UBLAS_SUPPORT) #include -#endif namespace QuantLib { @@ -66,11 +63,10 @@ Disposable FdmDupire1dOp::preconditioner(const Array &r, Real dt) const { return solve_splitting(0, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmDupire1dOp::toMatrixDecomp() const { std::vector retVal(1); retVal[0] = mapT_.toMatrix(); return retVal; } -#endif + } diff --git a/ql/experimental/finitedifferences/fdmdupire1dop.hpp b/ql/experimental/finitedifferences/fdmdupire1dop.hpp index df31d4b719e..a2f4afbd9e0 100644 --- a/ql/experimental/finitedifferences/fdmdupire1dop.hpp +++ b/ql/experimental/finitedifferences/fdmdupire1dop.hpp @@ -47,9 +47,7 @@ class FdmDupire1dOp : public FdmLinearOpComposite { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif private: const ext::shared_ptr mesher_; diff --git a/ql/experimental/finitedifferences/fdmextendedornsteinuhlenbeckop.cpp b/ql/experimental/finitedifferences/fdmextendedornsteinuhlenbeckop.cpp index 950dd3ef4af..cbfb6ed88bc 100644 --- a/ql/experimental/finitedifferences/fdmextendedornsteinuhlenbeckop.cpp +++ b/ql/experimental/finitedifferences/fdmextendedornsteinuhlenbeckop.cpp @@ -102,12 +102,10 @@ namespace QuantLib { return solve_splitting(direction_, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmExtendedOrnsteinUhlenbeckOp::toMatrixDecomp() const { std::vector retVal(1, mapX_.toMatrix()); return retVal; } -#endif } diff --git a/ql/experimental/finitedifferences/fdmextendedornsteinuhlenbeckop.hpp b/ql/experimental/finitedifferences/fdmextendedornsteinuhlenbeckop.hpp index 3686c932a09..9013f870469 100644 --- a/ql/experimental/finitedifferences/fdmextendedornsteinuhlenbeckop.hpp +++ b/ql/experimental/finitedifferences/fdmextendedornsteinuhlenbeckop.hpp @@ -54,9 +54,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const ext::shared_ptr mesher_; const ext::shared_ptr process_; diff --git a/ql/experimental/finitedifferences/fdmextoujumpop.cpp b/ql/experimental/finitedifferences/fdmextoujumpop.cpp index 9225df79429..b332a75e6e2 100644 --- a/ql/experimental/finitedifferences/fdmextoujumpop.cpp +++ b/ql/experimental/finitedifferences/fdmextoujumpop.cpp @@ -32,12 +32,6 @@ #include #include -#if defined(QL_NO_UBLAS_SUPPORT) - -#include - -#else - #if defined(QL_PATCH_MSVC) #pragma warning(push) #pragma warning(disable:4180) @@ -59,8 +53,6 @@ #pragma GCC diagnostic pop #endif -#endif - namespace QuantLib { FdmExtOUJumpOp::FdmExtOUJumpOp( @@ -81,7 +73,6 @@ namespace QuantLib { dyMap_ (FirstDerivativeOp(1, mesher) .mult(-process->beta()*mesher->locations(1))) { -#if !defined(QL_NO_UBLAS_SUPPORT) const Real eta = process_->eta(); const Real lambda = process_->jumpIntensity(); @@ -124,7 +115,6 @@ namespace QuantLib { += weight*lambda*s; } } -#endif } Size FdmExtOUJumpOp::size() const { @@ -175,79 +165,6 @@ namespace QuantLib { return ouOp_->solve_splitting(0, r, dt); } -#if defined(QL_NO_UBLAS_SUPPORT) - FdmExtOUJumpOp::IntegroIntegrand::IntegroIntegrand( - const ext::shared_ptr& interpl, - const FdmBoundaryConditionSet& bcSet, - Real y, Real eta) - : y_ (y), - eta_ (eta), - bcSet_ (bcSet), - interpl_(interpl) { } - - Real FdmExtOUJumpOp::IntegroIntegrand::operator()(Real u) const { - const Real y = y_ + u/eta_; - Real valueOfDerivative = (*interpl_)(y, true); - - for (FdmBoundaryConditionSet::const_iterator iter=bcSet_.begin(); - iter < bcSet_.end(); ++iter) { - const ext::shared_ptr dirichletBC = - ext::dynamic_pointer_cast(*iter); - - if (dirichletBC != 0) { - valueOfDerivative= - dirichletBC->applyAfterApplying(y, valueOfDerivative); - } - } - - return std::exp(-u)*valueOfDerivative; - } - - Disposable FdmExtOUJumpOp::integro(const Array& r) const { - Array integral(r.size()); - const ext::shared_ptr layout = mesher_->layout(); - const Size extraDims=layout->size()/(layout->dim()[0]*layout->dim()[1]); - - std::vector y(extraDims, Array(layout->dim()[1])); - std::vector f(extraDims, - Matrix(layout->dim()[1], layout->dim()[0])); - - const FdmLinearOpIterator endIter = layout->end(); - for (FdmLinearOpIterator iter = layout->begin(); iter != endIter; - ++iter) { - const Size i = iter.coordinates()[0]; - const Size j = iter.coordinates()[1]; - const Size k = iter.index() / (layout->dim()[0]*layout->dim()[1]); - - y[k][j] = mesher_->location(iter, 1); - f[k][j][i] = r[iter.index()]; - } - std::vector > > - interpl(extraDims, std::vector< - ext::shared_ptr >(f[0].columns())); - - for (Size k=0; k < extraDims; ++k) { - for (Size i=0; i < f[k].columns(); ++i) { - interpl[k][i] = ext::shared_ptr( - new LinearInterpolation(y[k].begin(), y[k].end(), - f[k].column_begin(i))); - } - } - - const Real eta = process_->eta(); - - for (FdmLinearOpIterator iter=layout->begin(); iter!=endIter; ++iter) { - const Size i = iter.coordinates()[0]; - const Size j = iter.coordinates()[1]; - const Size k = iter.index() / (layout->dim()[0]*layout->dim()[1]); - - integral[iter.index()] = gaussLaguerreIntegration_( - IntegroIntegrand(interpl[k][i], bcSet_, y[k][j], eta)); - } - - return process_->jumpIntensity()*(integral-r); - } -#else Disposable FdmExtOUJumpOp::integro(const Array& r) const { return prod(integroPart_, r); } @@ -262,5 +179,5 @@ namespace QuantLib { return retVal; } -#endif + } diff --git a/ql/experimental/finitedifferences/fdmextoujumpop.hpp b/ql/experimental/finitedifferences/fdmextoujumpop.hpp index 3e5f5e5bfec..6d82413f5dd 100644 --- a/ql/experimental/finitedifferences/fdmextoujumpop.hpp +++ b/ql/experimental/finitedifferences/fdmextoujumpop.hpp @@ -61,9 +61,7 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif private: Disposable integro(const Array& r) const; @@ -78,23 +76,7 @@ namespace QuantLib { const TripleBandLinearOp dyMap_; -#if defined(QL_NO_UBLAS_SUPPORT) - class IntegroIntegrand { - public: - IntegroIntegrand(const ext::shared_ptr& i, - const FdmBoundaryConditionSet& bcSet, - Real y, Real eta); - Real operator()(Real u) const; - - private: - const Real y_, eta_; - const FdmBoundaryConditionSet& bcSet_; - const ext::shared_ptr& interpl_; - }; - -#else SparseMatrix integroPart_; -#endif }; } diff --git a/ql/experimental/finitedifferences/fdmhestonfwdop.cpp b/ql/experimental/finitedifferences/fdmhestonfwdop.cpp index a6a6b50a83a..c2b060d0ecc 100644 --- a/ql/experimental/finitedifferences/fdmhestonfwdop.cpp +++ b/ql/experimental/finitedifferences/fdmhestonfwdop.cpp @@ -224,7 +224,6 @@ namespace QuantLib { return v; } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmHestonFwdOp::toMatrixDecomp() const { @@ -236,5 +235,5 @@ namespace QuantLib { return retVal; } -#endif + } diff --git a/ql/experimental/finitedifferences/fdmhestonfwdop.hpp b/ql/experimental/finitedifferences/fdmhestonfwdop.hpp index 4f29ff61bc2..d8f65a8d019 100644 --- a/ql/experimental/finitedifferences/fdmhestonfwdop.hpp +++ b/ql/experimental/finitedifferences/fdmhestonfwdop.hpp @@ -58,9 +58,7 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif private: Disposable getLeverageFctSlice(Time t1, Time t2) const; const FdmSquareRootFwdOp::TransformationType type_; diff --git a/ql/experimental/finitedifferences/fdmklugeextouop.cpp b/ql/experimental/finitedifferences/fdmklugeextouop.cpp index dac1d2b4af8..7cf7a1e0f12 100644 --- a/ql/experimental/finitedifferences/fdmklugeextouop.cpp +++ b/ql/experimental/finitedifferences/fdmklugeextouop.cpp @@ -108,7 +108,6 @@ namespace QuantLib { return klugeOp_->solve_splitting(0, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmKlugeExtOUOp::toMatrixDecomp() const { const std::vector klugeDecomp @@ -122,5 +121,5 @@ namespace QuantLib { return retVal; } -#endif + } diff --git a/ql/experimental/finitedifferences/fdmklugeextouop.hpp b/ql/experimental/finitedifferences/fdmklugeextouop.hpp index 09c071ab30a..df9e35449b2 100644 --- a/ql/experimental/finitedifferences/fdmklugeextouop.hpp +++ b/ql/experimental/finitedifferences/fdmklugeextouop.hpp @@ -80,9 +80,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const ext::shared_ptr mesher_; diff --git a/ql/experimental/finitedifferences/fdmsquarerootfwdop.cpp b/ql/experimental/finitedifferences/fdmsquarerootfwdop.cpp index 382dfc558c3..e514473fb59 100644 --- a/ql/experimental/finitedifferences/fdmsquarerootfwdop.cpp +++ b/ql/experimental/finitedifferences/fdmsquarerootfwdop.cpp @@ -332,11 +332,10 @@ namespace QuantLib { return solve_splitting(direction_, r, dt); } - #if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmSquareRootFwdOp::toMatrixDecomp() const { std::vector retVal(1, mapX_->toMatrix()); return retVal; } - #endif + } diff --git a/ql/experimental/finitedifferences/fdmsquarerootfwdop.hpp b/ql/experimental/finitedifferences/fdmsquarerootfwdop.hpp index c33ea56dcca..ecf2291ae88 100644 --- a/ql/experimental/finitedifferences/fdmsquarerootfwdop.hpp +++ b/ql/experimental/finitedifferences/fdmsquarerootfwdop.hpp @@ -52,9 +52,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + Real lowerBoundaryFactor(TransformationType type = Plain) const; Real upperBoundaryFactor(TransformationType type = Plain) const; Real v(Size i) const; diff --git a/ql/experimental/finitedifferences/fdmzabrop.cpp b/ql/experimental/finitedifferences/fdmzabrop.cpp index 8eef28844b1..0c22dee292c 100644 --- a/ql/experimental/finitedifferences/fdmzabrop.cpp +++ b/ql/experimental/finitedifferences/fdmzabrop.cpp @@ -107,7 +107,6 @@ Disposable FdmZabrOp::preconditioner(const Array &r, Real dt) const { return solve_splitting(0, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmZabrOp::toMatrixDecomp() const { std::vector retVal(3); retVal[0] = dxMap_.getMap().toMatrix(); @@ -115,5 +114,5 @@ Disposable > FdmZabrOp::toMatrixDecomp() const { retVal[2] = dxyMap_.toMatrix(); return retVal; } -#endif + } diff --git a/ql/experimental/finitedifferences/fdmzabrop.hpp b/ql/experimental/finitedifferences/fdmzabrop.hpp index 48465c510de..a77789a7276 100644 --- a/ql/experimental/finitedifferences/fdmzabrop.hpp +++ b/ql/experimental/finitedifferences/fdmzabrop.hpp @@ -82,9 +82,7 @@ class FdmZabrOp : public FdmLinearOpComposite { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif private: const Array volatilityValues_; diff --git a/ql/experimental/math/laplaceinterpolation.hpp b/ql/experimental/math/laplaceinterpolation.hpp index cc5effd2247..d0a29ccf71b 100644 --- a/ql/experimental/math/laplaceinterpolation.hpp +++ b/ql/experimental/math/laplaceinterpolation.hpp @@ -24,8 +24,6 @@ #ifndef quantlib_laplace_interpolation #define quantlib_laplace_interpolation -#if !defined(QL_NO_UBLAS_SUPPORT) - #include #include @@ -162,5 +160,4 @@ template void laplaceInterpolation(M &A, Real relTol = 1E-6) { } // namespace QuantLib -#endif // QL_NO_UBLAS_SUPPORT #endif // include guard diff --git a/ql/math/matrix.cpp b/ql/math/matrix.cpp index b6502220d64..414dcdc9cff 100644 --- a/ql/math/matrix.cpp +++ b/ql/math/matrix.cpp @@ -38,14 +38,12 @@ #pragma clang diagnostic ignored "-Wunused-function" #endif -#if !defined(QL_NO_UBLAS_SUPPORT) #if BOOST_VERSION == 106400 #include #endif #include #include #include -#endif #if defined(QL_PATCH_MSVC) #pragma warning(pop) @@ -63,8 +61,6 @@ namespace QuantLib { Disposable inverse(const Matrix& m) { - #if !defined(QL_NO_UBLAS_SUPPORT) - QL_REQUIRE(m.rows() == m.columns(), "matrix is not square"); boost::numeric::ublas::matrix a(m.rows(), m.columns()); @@ -99,15 +95,9 @@ namespace QuantLib { retVal.begin()); return retVal; - - #else - QL_FAIL("this version of gcc does not support " - "the Boost uBLAS library"); - #endif } Real determinant(const Matrix& m) { - #if !defined(QL_NO_UBLAS_SUPPORT) QL_REQUIRE(m.rows() == m.columns(), "matrix is not square"); boost::numeric::ublas::matrix a(m.rows(), m.columns()); @@ -127,10 +117,6 @@ namespace QuantLib { retVal *= a(i,i); } return retVal; - - #else - QL_FAIL("this version of gcc does not support " - "the Boost uBLAS library"); - #endif } + } diff --git a/ql/math/matrixutilities/sparseilupreconditioner.cpp b/ql/math/matrixutilities/sparseilupreconditioner.cpp index be18e02bbcc..a849d332018 100644 --- a/ql/math/matrixutilities/sparseilupreconditioner.cpp +++ b/ql/math/matrixutilities/sparseilupreconditioner.cpp @@ -17,10 +17,6 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ -#include - -#if !defined(QL_NO_UBLAS_SUPPORT) - #include #include @@ -194,4 +190,3 @@ namespace QuantLib { } -#endif diff --git a/ql/math/matrixutilities/sparseilupreconditioner.hpp b/ql/math/matrixutilities/sparseilupreconditioner.hpp index cb7e7877483..c93e7bc052c 100644 --- a/ql/math/matrixutilities/sparseilupreconditioner.hpp +++ b/ql/math/matrixutilities/sparseilupreconditioner.hpp @@ -24,10 +24,6 @@ FOR A PARTICULAR PURPOSE. See the license for more details. #ifndef quantlib_sparse_ilu_preconditioner_hpp #define quantlib_sparse_ilu_preconditioner_hpp -#include - -#if !defined(QL_NO_UBLAS_SUPPORT) - #include #include @@ -57,4 +53,3 @@ namespace QuantLib { } #endif -#endif diff --git a/ql/math/matrixutilities/sparsematrix.hpp b/ql/math/matrixutilities/sparsematrix.hpp index 7647b870fe5..0840e68e426 100644 --- a/ql/math/matrixutilities/sparsematrix.hpp +++ b/ql/math/matrixutilities/sparsematrix.hpp @@ -25,9 +25,6 @@ FOR A PARTICULAR PURPOSE. See the license for more details. #define quantlib_sparse_matrix_hpp #include - -#if !defined(QL_NO_UBLAS_SUPPORT) - #include #if defined(QL_PATCH_MSVC) @@ -92,4 +89,3 @@ namespace QuantLib { } #endif -#endif diff --git a/ql/methods/finitedifferences/operators/fdm2dblackscholesop.cpp b/ql/methods/finitedifferences/operators/fdm2dblackscholesop.cpp index dafd2cdf673..08dc22f7a21 100644 --- a/ql/methods/finitedifferences/operators/fdm2dblackscholesop.cpp +++ b/ql/methods/finitedifferences/operators/fdm2dblackscholesop.cpp @@ -26,10 +26,7 @@ #include #include #include - -#if !defined(QL_NO_UBLAS_SUPPORT) #include -#endif namespace QuantLib { @@ -152,7 +149,6 @@ namespace QuantLib { return solve_splitting(0, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > Fdm2dBlackScholesOp::toMatrixDecomp() const { std::vector retVal(3); @@ -164,5 +160,5 @@ namespace QuantLib { return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdm2dblackscholesop.hpp b/ql/methods/finitedifferences/operators/fdm2dblackscholesop.hpp index 85449299b1d..202126ab063 100644 --- a/ql/methods/finitedifferences/operators/fdm2dblackscholesop.hpp +++ b/ql/methods/finitedifferences/operators/fdm2dblackscholesop.hpp @@ -54,9 +54,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& x, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const ext::shared_ptr mesher_; const ext::shared_ptr p1_, p2_; diff --git a/ql/methods/finitedifferences/operators/fdmbatesop.cpp b/ql/methods/finitedifferences/operators/fdmbatesop.cpp index f43dff60ca7..748bb9290f4 100644 --- a/ql/methods/finitedifferences/operators/fdmbatesop.cpp +++ b/ql/methods/finitedifferences/operators/fdmbatesop.cpp @@ -123,10 +123,8 @@ namespace QuantLib { return lambda_*(integral-r); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmBatesOp::toMatrixDecomp() const { QL_FAIL("not implemented"); } -#endif } diff --git a/ql/methods/finitedifferences/operators/fdmbatesop.hpp b/ql/methods/finitedifferences/operators/fdmbatesop.hpp index 40b6dd2f2f7..60862fe5815 100644 --- a/ql/methods/finitedifferences/operators/fdmbatesop.hpp +++ b/ql/methods/finitedifferences/operators/fdmbatesop.hpp @@ -52,9 +52,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: class IntegroIntegrand { public: diff --git a/ql/methods/finitedifferences/operators/fdmblackscholesop.cpp b/ql/methods/finitedifferences/operators/fdmblackscholesop.cpp index 17320858316..3c43d3301e8 100644 --- a/ql/methods/finitedifferences/operators/fdmblackscholesop.cpp +++ b/ql/methods/finitedifferences/operators/fdmblackscholesop.cpp @@ -140,11 +140,10 @@ namespace QuantLib { return solve_splitting(direction_, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmBlackScholesOp::toMatrixDecomp() const { std::vector retVal(1, mapT_.toMatrix()); return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdmblackscholesop.hpp b/ql/methods/finitedifferences/operators/fdmblackscholesop.hpp index 34436662b12..5efb63de9e1 100644 --- a/ql/methods/finitedifferences/operators/fdmblackscholesop.hpp +++ b/ql/methods/finitedifferences/operators/fdmblackscholesop.hpp @@ -55,9 +55,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const ext::shared_ptr mesher_; const ext::shared_ptr rTS_, qTS_; diff --git a/ql/methods/finitedifferences/operators/fdmcevop.cpp b/ql/methods/finitedifferences/operators/fdmcevop.cpp index 3acfab10fc2..368b9600878 100644 --- a/ql/methods/finitedifferences/operators/fdmcevop.cpp +++ b/ql/methods/finitedifferences/operators/fdmcevop.cpp @@ -85,11 +85,10 @@ namespace QuantLib { return solve_splitting(direction_, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmCEVOp::toMatrixDecomp() const { std::vector retVal(1, mapT_.toMatrix()); return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdmcevop.hpp b/ql/methods/finitedifferences/operators/fdmcevop.hpp index f8f42a99619..5c446cad18a 100644 --- a/ql/methods/finitedifferences/operators/fdmcevop.hpp +++ b/ql/methods/finitedifferences/operators/fdmcevop.hpp @@ -57,9 +57,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const ext::shared_ptr& rTS_; const Size direction_; diff --git a/ql/methods/finitedifferences/operators/fdmcirop.cpp b/ql/methods/finitedifferences/operators/fdmcirop.cpp index a1dc1f74b0f..e9d02b82816 100644 --- a/ql/methods/finitedifferences/operators/fdmcirop.cpp +++ b/ql/methods/finitedifferences/operators/fdmcirop.cpp @@ -168,7 +168,6 @@ namespace QuantLib { return solve_splitting(1, solve_splitting(0, r, dt), dt) ; } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmCIROp::toMatrixDecomp() const { std::vector retVal(3); @@ -179,5 +178,5 @@ namespace QuantLib { return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdmcirop.hpp b/ql/methods/finitedifferences/operators/fdmcirop.hpp index 3254671c0ac..0800b6e9108 100644 --- a/ql/methods/finitedifferences/operators/fdmcirop.hpp +++ b/ql/methods/finitedifferences/operators/fdmcirop.hpp @@ -111,9 +111,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: FdmCIREquityPart dxMap_; FdmCIRRatesPart dyMap_; diff --git a/ql/methods/finitedifferences/operators/fdmg2op.cpp b/ql/methods/finitedifferences/operators/fdmg2op.cpp index ae9643656a4..45eff364fa0 100644 --- a/ql/methods/finitedifferences/operators/fdmg2op.cpp +++ b/ql/methods/finitedifferences/operators/fdmg2op.cpp @@ -111,7 +111,6 @@ namespace QuantLib { return solve_splitting(direction1_, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmG2Op::toMatrixDecomp() const { std::vector retVal(3); retVal[0] = mapX_.toMatrix(); @@ -120,6 +119,6 @@ namespace QuantLib { return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdmg2op.hpp b/ql/methods/finitedifferences/operators/fdmg2op.hpp index 2ed3f406f51..668bae8df32 100644 --- a/ql/methods/finitedifferences/operators/fdmg2op.hpp +++ b/ql/methods/finitedifferences/operators/fdmg2op.hpp @@ -50,9 +50,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const Size direction1_, direction2_; const Array x_, y_; diff --git a/ql/methods/finitedifferences/operators/fdmhestonhullwhiteop.cpp b/ql/methods/finitedifferences/operators/fdmhestonhullwhiteop.cpp index 4efbaeeb71c..3292f84efd2 100644 --- a/ql/methods/finitedifferences/operators/fdmhestonhullwhiteop.cpp +++ b/ql/methods/finitedifferences/operators/fdmhestonhullwhiteop.cpp @@ -146,7 +146,6 @@ namespace QuantLib { return solve_splitting(0, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmHestonHullWhiteOp::toMatrixDecomp() const { std::vector retVal(4); @@ -157,5 +156,5 @@ namespace QuantLib { return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdmhestonhullwhiteop.hpp b/ql/methods/finitedifferences/operators/fdmhestonhullwhiteop.hpp index 21898e15e8b..3585029f60c 100644 --- a/ql/methods/finitedifferences/operators/fdmhestonhullwhiteop.hpp +++ b/ql/methods/finitedifferences/operators/fdmhestonhullwhiteop.hpp @@ -77,9 +77,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const Real v0_, kappa_, theta_, sigma_, rho_; const ext::shared_ptr hwModel_; diff --git a/ql/methods/finitedifferences/operators/fdmhestonop.cpp b/ql/methods/finitedifferences/operators/fdmhestonop.cpp index 2bb97dc948c..0a278c381c8 100644 --- a/ql/methods/finitedifferences/operators/fdmhestonop.cpp +++ b/ql/methods/finitedifferences/operators/fdmhestonop.cpp @@ -194,7 +194,6 @@ namespace QuantLib { return solve_splitting(1, solve_splitting(0, r, dt), dt) ; } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmHestonOp::toMatrixDecomp() const { std::vector retVal(3); @@ -205,5 +204,5 @@ namespace QuantLib { return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdmhestonop.hpp b/ql/methods/finitedifferences/operators/fdmhestonop.hpp index e47271876a6..0e2437dc97c 100644 --- a/ql/methods/finitedifferences/operators/fdmhestonop.hpp +++ b/ql/methods/finitedifferences/operators/fdmhestonop.hpp @@ -103,9 +103,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: NinePointLinearOp correlationMap_; FdmHestonVariancePart dyMap_; diff --git a/ql/methods/finitedifferences/operators/fdmhullwhiteop.cpp b/ql/methods/finitedifferences/operators/fdmhullwhiteop.cpp index 661b5870b66..9ebd2ef9399 100644 --- a/ql/methods/finitedifferences/operators/fdmhullwhiteop.cpp +++ b/ql/methods/finitedifferences/operators/fdmhullwhiteop.cpp @@ -92,12 +92,11 @@ namespace QuantLib { return solve_splitting(direction_, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmHullWhiteOp::toMatrixDecomp() const { std::vector retVal(1, mapT_.toMatrix()); return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdmhullwhiteop.hpp b/ql/methods/finitedifferences/operators/fdmhullwhiteop.hpp index 698b37fa55a..2e8e8e6f3e7 100644 --- a/ql/methods/finitedifferences/operators/fdmhullwhiteop.hpp +++ b/ql/methods/finitedifferences/operators/fdmhullwhiteop.hpp @@ -51,9 +51,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const Size direction_; const Array x_; diff --git a/ql/methods/finitedifferences/operators/fdmlinearop.hpp b/ql/methods/finitedifferences/operators/fdmlinearop.hpp index 175f4256e5c..0c6d6d353e2 100644 --- a/ql/methods/finitedifferences/operators/fdmlinearop.hpp +++ b/ql/methods/finitedifferences/operators/fdmlinearop.hpp @@ -37,9 +37,7 @@ namespace QuantLib { virtual ~FdmLinearOp() = default; virtual Disposable apply(const array_type& r) const = 0; -#if !defined(QL_NO_UBLAS_SUPPORT) virtual Disposable toMatrix() const = 0; -#endif }; } diff --git a/ql/methods/finitedifferences/operators/fdmlinearopcomposite.hpp b/ql/methods/finitedifferences/operators/fdmlinearopcomposite.hpp index 4f61f326d3e..febdff53245 100644 --- a/ql/methods/finitedifferences/operators/fdmlinearopcomposite.hpp +++ b/ql/methods/finitedifferences/operators/fdmlinearopcomposite.hpp @@ -28,10 +28,7 @@ #include #include - -#if !defined(QL_NO_UBLAS_SUPPORT) #include -#endif namespace QuantLib { @@ -51,7 +48,6 @@ namespace QuantLib { virtual Disposable preconditioner(const Array& r, Real s) const = 0; -#if !defined(QL_NO_UBLAS_SUPPORT) virtual Disposable > toMatrixDecomp() const { QL_FAIL(" ublas representation is not implemented"); } @@ -62,7 +58,7 @@ namespace QuantLib { SparseMatrix(dcmp.front())); return retVal; } -#endif + }; } diff --git a/ql/methods/finitedifferences/operators/fdmlocalvolfwdop.cpp b/ql/methods/finitedifferences/operators/fdmlocalvolfwdop.cpp index 82dc7dcaaea..7ae9be0e04f 100644 --- a/ql/methods/finitedifferences/operators/fdmlocalvolfwdop.cpp +++ b/ql/methods/finitedifferences/operators/fdmlocalvolfwdop.cpp @@ -93,11 +93,10 @@ namespace QuantLib { return solve_splitting(direction_, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmLocalVolFwdOp::toMatrixDecomp() const { std::vector retVal(1, mapT_.toMatrix()); return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdmlocalvolfwdop.hpp b/ql/methods/finitedifferences/operators/fdmlocalvolfwdop.hpp index 9a58cbd0415..27aa00b0fed 100644 --- a/ql/methods/finitedifferences/operators/fdmlocalvolfwdop.hpp +++ b/ql/methods/finitedifferences/operators/fdmlocalvolfwdop.hpp @@ -51,9 +51,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const ext::shared_ptr mesher_; const ext::shared_ptr rTS_, qTS_; diff --git a/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.cpp b/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.cpp index e7c854b0c98..8f9d15cd880 100644 --- a/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.cpp +++ b/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.cpp @@ -106,12 +106,10 @@ namespace QuantLib { return solve_splitting(direction_, r, dt); } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmOrnsteinUhlenbeckOp::toMatrixDecomp() const { std::vector retVal(1, mapX_.toMatrix()); return retVal; } -#endif } diff --git a/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.hpp b/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.hpp index 420ae1135e8..bc6e5c94665 100644 --- a/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.hpp +++ b/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.hpp @@ -53,9 +53,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const ext::shared_ptr mesher_; const ext::shared_ptr process_; diff --git a/ql/methods/finitedifferences/operators/fdmsabrop.cpp b/ql/methods/finitedifferences/operators/fdmsabrop.cpp index 631b4200c2b..9b6a7189fcb 100644 --- a/ql/methods/finitedifferences/operators/fdmsabrop.cpp +++ b/ql/methods/finitedifferences/operators/fdmsabrop.cpp @@ -96,7 +96,6 @@ namespace QuantLib { return solve_splitting(1, solve_splitting(0, r, dt), dt) ; } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > FdmSabrOp::toMatrixDecomp() const { std::vector retVal(3); @@ -106,5 +105,5 @@ namespace QuantLib { return retVal; } -#endif + } diff --git a/ql/methods/finitedifferences/operators/fdmsabrop.hpp b/ql/methods/finitedifferences/operators/fdmsabrop.hpp index 468d7737a67..79f7df2ed5b 100644 --- a/ql/methods/finitedifferences/operators/fdmsabrop.hpp +++ b/ql/methods/finitedifferences/operators/fdmsabrop.hpp @@ -61,9 +61,8 @@ namespace QuantLib { Disposable solve_splitting(Size direction, const Array& r, Real s) const override; Disposable preconditioner(const Array& r, Real s) const override; -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable > toMatrixDecomp() const override; -#endif + private: const ext::shared_ptr rTS_; diff --git a/ql/methods/finitedifferences/operators/ninepointlinearop.cpp b/ql/methods/finitedifferences/operators/ninepointlinearop.cpp index ff662d4c2a1..0f6661ad378 100644 --- a/ql/methods/finitedifferences/operators/ninepointlinearop.cpp +++ b/ql/methods/finitedifferences/operators/ninepointlinearop.cpp @@ -154,7 +154,6 @@ namespace QuantLib { return retVal; } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable NinePointLinearOp::toMatrix() const { const ext::shared_ptr index = mesher_->layout(); const Size n = index->size(); @@ -174,7 +173,6 @@ namespace QuantLib { return retVal; } -#endif Disposable diff --git a/ql/methods/finitedifferences/operators/ninepointlinearop.hpp b/ql/methods/finitedifferences/operators/ninepointlinearop.hpp index 01d473fe0cd..f3402f36289 100644 --- a/ql/methods/finitedifferences/operators/ninepointlinearop.hpp +++ b/ql/methods/finitedifferences/operators/ninepointlinearop.hpp @@ -57,9 +57,7 @@ namespace QuantLib { void swap(NinePointLinearOp& m); -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable toMatrix() const override; -#endif protected: NinePointLinearOp() = default; diff --git a/ql/methods/finitedifferences/operators/nthorderderivativeop.cpp b/ql/methods/finitedifferences/operators/nthorderderivativeop.cpp index b15eeeebac7..2635a6c269d 100644 --- a/ql/methods/finitedifferences/operators/nthorderderivativeop.cpp +++ b/ql/methods/finitedifferences/operators/nthorderderivativeop.cpp @@ -21,9 +21,6 @@ \brief n-th order derivative linear operator */ -#include -#ifndef QL_NO_UBLAS_SUPPORT - #include #include #include @@ -95,4 +92,3 @@ namespace QuantLib { } -#endif diff --git a/ql/methods/finitedifferences/operators/nthorderderivativeop.hpp b/ql/methods/finitedifferences/operators/nthorderderivativeop.hpp index a31dcfe6db3..8fd8f8f4fe7 100644 --- a/ql/methods/finitedifferences/operators/nthorderderivativeop.hpp +++ b/ql/methods/finitedifferences/operators/nthorderderivativeop.hpp @@ -24,9 +24,6 @@ #ifndef quantlib_nth_order_derivative_op_hpp #define quantlib_nth_order_derivative_op_hpp -#include -#ifndef QL_NO_UBLAS_SUPPORT - #include #include @@ -47,4 +44,3 @@ namespace QuantLib { } #endif -#endif diff --git a/ql/methods/finitedifferences/operators/triplebandlinearop.cpp b/ql/methods/finitedifferences/operators/triplebandlinearop.cpp index bf5c92a3854..fcf103250bb 100644 --- a/ql/methods/finitedifferences/operators/triplebandlinearop.cpp +++ b/ql/methods/finitedifferences/operators/triplebandlinearop.cpp @@ -260,7 +260,6 @@ namespace QuantLib { return retVal; } -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable TripleBandLinearOp::toMatrix() const { const ext::shared_ptr index = mesher_->layout(); const Size n = index->size(); @@ -274,7 +273,6 @@ namespace QuantLib { return retVal; } -#endif Disposable diff --git a/ql/methods/finitedifferences/operators/triplebandlinearop.hpp b/ql/methods/finitedifferences/operators/triplebandlinearop.hpp index f3056323c7d..c1bc97db75e 100644 --- a/ql/methods/finitedifferences/operators/triplebandlinearop.hpp +++ b/ql/methods/finitedifferences/operators/triplebandlinearop.hpp @@ -70,9 +70,7 @@ namespace QuantLib { void swap(TripleBandLinearOp& m); -#if !defined(QL_NO_UBLAS_SUPPORT) Disposable toMatrix() const override; -#endif protected: TripleBandLinearOp() = default; diff --git a/test-suite/fdmlinearop.cpp b/test-suite/fdmlinearop.cpp index ab4686be72d..cea504ebd18 100644 --- a/test-suite/fdmlinearop.cpp +++ b/test-suite/fdmlinearop.cpp @@ -76,10 +76,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedefs" #endif -#if !defined(QL_NO_UBLAS_SUPPORT) #include #include -#endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)) #pragma GCC diagnostic pop #endif @@ -383,7 +381,6 @@ void FdmLinearOpTest::testSecondDerivativesMapApply() { } void FdmLinearOpTest::testDerivativeWeightsOnNonUniformGrids() { -#ifndef QL_NO_UBLAS_SUPPORT BOOST_TEST_MESSAGE("Testing finite differences coefficients..."); const ext::shared_ptr mesherX( @@ -557,7 +554,6 @@ void FdmLinearOpTest::testDerivativeWeightsOnNonUniformGrids() { } } } -#endif } void FdmLinearOpTest::testSecondOrderMixedDerivativesMapApply() { @@ -1205,7 +1201,6 @@ void FdmLinearOpTest::testFdmHestonHullWhiteOp() { } } -#if !defined(QL_NO_UBLAS_SUPPORT) namespace { Disposable axpy( const boost::numeric::ublas::compressed_matrix& A, @@ -1247,10 +1242,8 @@ namespace { return a; } } -#endif void FdmLinearOpTest::testBiCGstab() { -#if !defined(QL_NO_UBLAS_SUPPORT) BOOST_TEST_MESSAGE( "Testing bi-conjugated gradient stabilized algorithm..."); @@ -1285,11 +1278,9 @@ void FdmLinearOpTest::testBiCGstab() { "\n tolerance: " << tol << "\n error: " << error); } -#endif } void FdmLinearOpTest::testGMRES() { -#if !defined(QL_NO_UBLAS_SUPPORT) BOOST_TEST_MESSAGE("Testing GMRES algorithm..."); const Size n=41, m=21; @@ -1343,7 +1334,6 @@ void FdmLinearOpTest::testGMRES() { "\n tolerance: " << tol << "\n error: " << errorWithRestart); } -#endif } void FdmLinearOpTest::testCrankNicolsonWithDamping() { @@ -1439,7 +1429,6 @@ void FdmLinearOpTest::testCrankNicolsonWithDamping() { } void FdmLinearOpTest::testSpareMatrixReference() { -#ifndef QL_NO_UBLAS_SUPPORT BOOST_TEST_MESSAGE("Testing SparseMatrixReference type..."); const Size rows = 10; @@ -1480,11 +1469,10 @@ void FdmLinearOpTest::testSpareMatrixReference() { } } } -#endif } namespace { -#ifndef QL_NO_UBLAS_SUPPORT + Size nrElementsOfSparseMatrix(const SparseMatrix& m) { Size retVal = 0; for (SparseMatrix::const_iterator1 i1 = m.begin1(); @@ -1493,11 +1481,10 @@ namespace { } return retVal; } -#endif + } void FdmLinearOpTest::testSparseMatrixZeroAssignment() { -#ifndef QL_NO_UBLAS_SUPPORT BOOST_TEST_MESSAGE("Testing assignment to zero in sparse matrix..."); SparseMatrix m(5,5); @@ -1516,7 +1503,6 @@ void FdmLinearOpTest::testSparseMatrixZeroAssignment() { if (nrElementsOfSparseMatrix(m) != 3) { BOOST_FAIL("three elements expected"); } -#endif } void FdmLinearOpTest::testFdmMesherIntegral() { diff --git a/test-suite/marketmodel_smmcapletalphacalibration.cpp b/test-suite/marketmodel_smmcapletalphacalibration.cpp index 8c1162b97c2..5e5a2dba3d7 100644 --- a/test-suite/marketmodel_smmcapletalphacalibration.cpp +++ b/test-suite/marketmodel_smmcapletalphacalibration.cpp @@ -348,9 +348,8 @@ void MarketModelSmmCapletAlphaCalibrationTest::testFunction() { // --- Call the desired tests test_suite* MarketModelSmmCapletAlphaCalibrationTest::suite() { auto* suite = BOOST_TEST_SUITE("SMM Caplet alpha calibration test"); -#if !defined(QL_NO_UBLAS_SUPPORT) - suite->add(QUANTLIB_TEST_CASE( - &MarketModelSmmCapletAlphaCalibrationTest::testFunction)); - #endif + + suite->add(QUANTLIB_TEST_CASE(&MarketModelSmmCapletAlphaCalibrationTest::testFunction)); + return suite; } diff --git a/test-suite/marketmodel_smmcapletcalibration.cpp b/test-suite/marketmodel_smmcapletcalibration.cpp index f8ffc7594bb..5865e6e82b6 100644 --- a/test-suite/marketmodel_smmcapletcalibration.cpp +++ b/test-suite/marketmodel_smmcapletcalibration.cpp @@ -340,9 +340,8 @@ void MarketModelSmmCapletCalibrationTest::testFunction() { // --- Call the desired tests test_suite* MarketModelSmmCapletCalibrationTest::suite() { auto* suite = BOOST_TEST_SUITE("SMM Caplet calibration test"); -#if !defined(QL_NO_UBLAS_SUPPORT) - suite->add(QUANTLIB_TEST_CASE( - &MarketModelSmmCapletCalibrationTest::testFunction)); - #endif + + suite->add(QUANTLIB_TEST_CASE(&MarketModelSmmCapletCalibrationTest::testFunction)); + return suite; } diff --git a/test-suite/marketmodel_smmcaplethomocalibration.cpp b/test-suite/marketmodel_smmcaplethomocalibration.cpp index 6c3cf0e71ed..2bab030d607 100644 --- a/test-suite/marketmodel_smmcaplethomocalibration.cpp +++ b/test-suite/marketmodel_smmcaplethomocalibration.cpp @@ -630,14 +630,11 @@ void MarketModelSmmCapletHomoCalibrationTest::testSphereCylinder() { test_suite* MarketModelSmmCapletHomoCalibrationTest::suite() { auto* suite = BOOST_TEST_SUITE("SMM Caplet homogeneous calibration test"); -#if !defined(QL_NO_UBLAS_SUPPORT) suite->add(QUANTLIB_TEST_CASE( &MarketModelSmmCapletHomoCalibrationTest::testFunction)); suite->add(QUANTLIB_TEST_CASE( &MarketModelSmmCapletHomoCalibrationTest::testPeriodFunction)); - #endif - // FLOATING_POINT_EXCEPTION suite->add(QUANTLIB_TEST_CASE( &MarketModelSmmCapletHomoCalibrationTest::testSphereCylinder)); diff --git a/test-suite/matrices.cpp b/test-suite/matrices.cpp index 57e9e21bfd8..7de4e72daed 100644 --- a/test-suite/matrices.cpp +++ b/test-suite/matrices.cpp @@ -677,7 +677,6 @@ void MatricesTest::testIterativeSolvers() { } } -#if !defined(QL_NO_UBLAS_SUPPORT) const Array v = GMRES(MatrixMult(M1), 1, relTol, MatrixMult(inverse(M1))).solve(b, b).x; @@ -696,7 +695,6 @@ void MatricesTest::testIterativeSolvers() { << "\n rel error : " << norm2(M1*w-b)/norm2(b) << "\n rel tolerance : " << relTol); } - #endif } void MatricesTest::testInitializers() { @@ -722,7 +720,7 @@ void MatricesTest::testInitializers() { namespace { - #if !defined(QL_NO_UBLAS_SUPPORT) + typedef std::pair< std::pair< std::vector, std::vector >, std::vector > coordinate_tuple; @@ -739,15 +737,12 @@ namespace { return std::make_pair(std::make_pair(row_idx, col_idx), data); } - #endif } void MatricesTest::testSparseMatrixMemory() { BOOST_TEST_MESSAGE("Testing sparse matrix memory layout..."); - #if !defined(QL_NO_UBLAS_SUPPORT) - SparseMatrix m(8, 4); BOOST_CHECK_EQUAL(m.filled1(), 1); BOOST_CHECK_EQUAL(m.size1(), 8); @@ -796,7 +791,6 @@ void MatricesTest::testSparseMatrixMemory() { BOOST_CHECK_EQUAL(entries, 4); - #endif } test_suite* MatricesTest::suite() { @@ -809,11 +803,9 @@ test_suite* MatricesTest::suite() { suite->add(QUANTLIB_TEST_CASE(&MatricesTest::testHighamSqrt)); suite->add(QUANTLIB_TEST_CASE(&MatricesTest::testQRDecomposition)); suite->add(QUANTLIB_TEST_CASE(&MatricesTest::testQRSolve)); - #if !defined(QL_NO_UBLAS_SUPPORT) suite->add(QUANTLIB_TEST_CASE(&MatricesTest::testInverse)); suite->add(QUANTLIB_TEST_CASE(&MatricesTest::testDeterminant)); suite->add(QUANTLIB_TEST_CASE(&MatricesTest::testSparseMatrixMemory)); - #endif suite->add(QUANTLIB_TEST_CASE(&MatricesTest::testCholeskyDecomposition)); suite->add(QUANTLIB_TEST_CASE(&MatricesTest::testMoorePenroseInverse)); suite->add(QUANTLIB_TEST_CASE(&MatricesTest::testIterativeSolvers)); diff --git a/test-suite/nthorderderivativeop.cpp b/test-suite/nthorderderivativeop.cpp index b9d73d7ea70..8d09acb9c52 100644 --- a/test-suite/nthorderderivativeop.cpp +++ b/test-suite/nthorderderivativeop.cpp @@ -50,8 +50,6 @@ using namespace QuantLib; using namespace boost::unit_test_framework; -#ifndef QL_NO_UBLAS_SUPPORT - #include #if defined(__clang__) || defined(__GNUC__) @@ -909,13 +907,11 @@ void NthOrderDerivativeOpTest::testMixedSecondOrder9PointsOnUniformGrid() { } } } -#endif + test_suite* NthOrderDerivativeOpTest::suite(SpeedLevel speed) { auto* suite = BOOST_TEST_SUITE("NthOrderDerivativeOp tests"); -#ifndef QL_NO_UBLAS_SUPPORT - suite->add(QUANTLIB_TEST_CASE( &NthOrderDerivativeOpTest::testSparseMatrixApply)); suite->add(QUANTLIB_TEST_CASE( @@ -949,8 +945,6 @@ test_suite* NthOrderDerivativeOpTest::suite(SpeedLevel speed) { suite->add(QUANTLIB_TEST_CASE(&NthOrderDerivativeOpTest::testHigherOrderHestonOptionPricing)); } -#endif - return suite; } diff --git a/test-suite/swapforwardmappings.cpp b/test-suite/swapforwardmappings.cpp index 3ec2fe82ad9..e1874cef249 100644 --- a/test-suite/swapforwardmappings.cpp +++ b/test-suite/swapforwardmappings.cpp @@ -452,16 +452,13 @@ void SwapForwardMappingsTest::testSwaptionImpliedVolatility() test_suite* SwapForwardMappingsTest::suite() { auto* suite = BOOST_TEST_SUITE("swap-forward mappings tests"); - suite->add(QUANTLIB_TEST_CASE( &SwapForwardMappingsTest::testSwaptionImpliedVolatility)); suite->add(QUANTLIB_TEST_CASE( &SwapForwardMappingsTest::testForwardSwapJacobians)); -// #if !defined(QL_NO_UBLAS_SUPPORT) -// suite->add(QUANTLIB_TEST_CASE( -// &SwapForwardMappingsTest::testForwardCoterminalMappings)); -// #endif + // suite->add(QUANTLIB_TEST_CASE( + // &SwapForwardMappingsTest::testForwardCoterminalMappings)); return suite; } diff --git a/test-suite/vpp.cpp b/test-suite/vpp.cpp index 0e0a53277b4..b1c853e233e 100644 --- a/test-suite/vpp.cpp +++ b/test-suite/vpp.cpp @@ -869,7 +869,6 @@ void VPPTest::testVPPPricing() { } void VPPTest::testKlugeExtOUMatrixDecomposition() { -#ifndef QL_NO_UBLAS_SUPPORT BOOST_TEST_MESSAGE("Testing KlugeExtOU matrix decomposition..."); using namespace vpp_test; @@ -962,7 +961,6 @@ void VPPTest::testKlugeExtOUMatrixDecomposition() { } } } -#endif }