Skip to content

Commit c53ca4d

Browse files
rolandlichtersjenkins
authored andcommitted
namespace fixes for oreplus swig
1 parent 4fffaf0 commit c53ca4d

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

OREData/ored/utilities/initbuilders.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
1717
*/
1818

19-
/*! \file orea/app/initbuilders.hpp
19+
/*! \file ored/utilities/initbuilders.hpp
2020
\brief add builders to factories
2121
*/
2222

QuantExt/qle/math/blockmatrixinverse.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bool isNull(const Matrix& A) {
3434
return true;
3535
} // isNull
3636

37-
bool isNull(const SparseMatrix& A) {
37+
bool isNull(const QuantLib::SparseMatrix& A) {
3838
for (auto i1 = A.begin1(); i1 != A.end1(); ++i1) {
3939
for (auto i2 = i1.begin(); i2 != i1.end(); ++i2) {
4040
if (std::abs(*i2) > QL_EPSILON)
@@ -46,13 +46,13 @@ bool isNull(const SparseMatrix& A) {
4646

4747
} // namespace
4848

49-
SparseMatrix inverse(SparseMatrix m) {
49+
QuantLib::SparseMatrix inverse(QuantLib::SparseMatrix m) {
5050
QL_REQUIRE(m.size1() == m.size2(), "matrix is not square");
5151
boost::numeric::ublas::permutation_matrix<Size> pert(m.size1());
5252
// lu decomposition
5353
const Size singular = lu_factorize(m, pert);
5454
QL_REQUIRE(singular == 0, "singular matrix given");
55-
SparseMatrix inverse = boost::numeric::ublas::identity_matrix<Real>(m.size1());
55+
QuantLib::SparseMatrix inverse = boost::numeric::ublas::identity_matrix<Real>(m.size1());
5656
// backsubstitution
5757
boost::numeric::ublas::lu_substitute(m, pert, inverse);
5858
return inverse;
@@ -134,7 +134,7 @@ Matrix blockMatrixInverse(const Matrix& A, const std::vector<Size>& blockIndices
134134
return res;
135135
} // blockMatrixInverse(Matrix)
136136

137-
SparseMatrix blockMatrixInverse(const SparseMatrix& A, const std::vector<Size>& blockIndices) {
137+
QuantLib::SparseMatrix blockMatrixInverse(const QuantLib::SparseMatrix& A, const std::vector<Size>& blockIndices) {
138138

139139
QL_REQUIRE(blockIndices.size() > 0, "blockMatrixInverse: at least one entry in blockIndices required");
140140
Size n = blockIndices.back();
@@ -143,7 +143,7 @@ SparseMatrix blockMatrixInverse(const SparseMatrix& A, const std::vector<Size>&
143143
<< "x" << n << ", n>0");
144144

145145
if (blockIndices.size() == 1) {
146-
SparseMatrix res = inverse(A);
146+
QuantLib::SparseMatrix res = inverse(A);
147147
return res;
148148
}
149149

@@ -159,13 +159,13 @@ SparseMatrix blockMatrixInverse(const SparseMatrix& A, const std::vector<Size>&
159159
QL_REQUIRE(leftIndices.size() > 0, "blockMatrixInverse: expected left indices to be non-empty");
160160
QL_REQUIRE(rightIndices.size() > 0, "blockMatrixInverse: expected right indices to be non-empty");
161161

162-
SparseMatrix a = project(A, range(0, m), range(0, m));
163-
SparseMatrix b = project(A, range(0, m), range(m, n));
164-
SparseMatrix c = project(A, range(m, n), range(0, m));
165-
SparseMatrix d = project(A, range(m, n), range(m, n));
162+
QuantLib::SparseMatrix a = project(A, range(0, m), range(0, m));
163+
QuantLib::SparseMatrix b = project(A, range(0, m), range(m, n));
164+
QuantLib::SparseMatrix c = project(A, range(m, n), range(0, m));
165+
QuantLib::SparseMatrix d = project(A, range(m, n), range(m, n));
166166

167-
SparseMatrix aInv = blockMatrixInverse(a, leftIndices);
168-
SparseMatrix tmp(n - m, m), schurCompInv, p(m, n - m), p1(n - m, n - m), p2(m, m), b2(m, n - m), c2(n - m, m);
167+
QuantLib::SparseMatrix aInv = blockMatrixInverse(a, leftIndices);
168+
QuantLib::SparseMatrix tmp(n - m, m), schurCompInv, p(m, n - m), p1(n - m, n - m), p2(m, m), b2(m, n - m), c2(n - m, m);
169169
axpy_prod(c, aInv, tmp, true);
170170
if (isNull(c) || isNull(b))
171171
schurCompInv = blockMatrixInverse(d, rightIndices);
@@ -176,10 +176,10 @@ SparseMatrix blockMatrixInverse(const SparseMatrix& A, const std::vector<Size>&
176176
axpy_prod(aInv, b, p, true);
177177
axpy_prod(-p, schurCompInv, b2);
178178
axpy_prod(b2, tmp, p2);
179-
SparseMatrix a2 = aInv - p2;
179+
QuantLib::SparseMatrix a2 = aInv - p2;
180180
axpy_prod(-schurCompInv, tmp, c2);
181181

182-
SparseMatrix res(n, n);
182+
QuantLib::SparseMatrix res(n, n);
183183

184184
for (auto i1 = a2.begin1(); i1 != a2.end1(); ++i1) {
185185
for (auto i2 = i1.begin(); i2 != i1.end(); ++i2) {
@@ -205,7 +205,7 @@ SparseMatrix blockMatrixInverse(const SparseMatrix& A, const std::vector<Size>&
205205
return res;
206206
} // blockMatrixInverse(SparseMatrix)
207207

208-
Real modifiedMaxNorm(const SparseMatrix& A) {
208+
Real modifiedMaxNorm(const QuantLib::SparseMatrix& A) {
209209
Real r = 0.0;
210210
for (auto i1 = A.begin1(); i1 != A.end1(); ++i1) {
211211
for (auto i2 = i1.begin(); i2 != i1.end(); ++i2) {

0 commit comments

Comments
 (0)