Skip to content

Commit

Permalink
Apply a few clang-tidy suggestions manually
Browse files Browse the repository at this point in the history
The workflow action fails linking, probably because it changes the
hpp and cpp at different times, who knows
  • Loading branch information
lballabio committed Nov 17, 2024
1 parent 1aae346 commit 5bf7c0d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Checks: >
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-use-default-member-init,
misc-*,
-misc-confusable-identifiers,
-misc-const-correctness,
Expand Down
4 changes: 2 additions & 2 deletions ql/math/matrixutilities/householder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace QuantLib {

HouseholderTransformation::HouseholderTransformation(const Array v)
HouseholderTransformation::HouseholderTransformation(Array v)
: v_(std::move(v)) {}


Expand All @@ -41,7 +41,7 @@ namespace QuantLib {
return m;
}

HouseholderReflection::HouseholderReflection(const Array e)
HouseholderReflection::HouseholderReflection(Array e)
: e_(std::move(e)) {}

Array HouseholderReflection::reflectionVector(const Array& a) const {
Expand Down
14 changes: 7 additions & 7 deletions ql/math/matrixutilities/householder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@
namespace QuantLib {

/*! References:
https://en.wikipedia.org/wiki/Householder_transformation
https://en.wikipedia.org/wiki/Householder_transformation
*/

class HouseholderTransformation {
public:
explicit HouseholderTransformation(const Array v);
explicit HouseholderTransformation(Array v);

Matrix getMatrix() const;
Array operator()(const Array& x) const;
Array operator()(const Array& x) const;

private:
const Array v_;
const Array v_;
};


class HouseholderReflection {
public:
explicit HouseholderReflection(const Array e);
explicit HouseholderReflection(Array e);

Array operator()(const Array& a) const;
Array reflectionVector(const Array& a) const;
Array reflectionVector(const Array& a) const;

private:
const Array e_;
const Array e_;
};
}

Expand Down
8 changes: 4 additions & 4 deletions ql/methods/finitedifferences/operators/fdmwienerop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
namespace QuantLib {

FdmWienerOp::FdmWienerOp(
ext::shared_ptr<FdmMesher> mesher,
const ext::shared_ptr<FdmMesher>& mesher,
ext::shared_ptr<YieldTermStructure> rTS,
Array lambdas)
: rTS_(rTS),
r_(0.0) {
const Array& lambdas)
: rTS_(std::move(rTS)),
r_(0.0) {

QL_REQUIRE(mesher->layout()->dim().size() == lambdas.size(),
"mesher and lambdas need to be of the same dimension");
Expand Down
4 changes: 2 additions & 2 deletions ql/methods/finitedifferences/operators/fdmwienerop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ namespace QuantLib {
class FdmWienerOp : public FdmLinearOpComposite {
public:
FdmWienerOp(
ext::shared_ptr<FdmMesher> mesher,
const ext::shared_ptr<FdmMesher>& mesher,
ext::shared_ptr<YieldTermStructure> rTS,
Array lambdas);
const Array& lambdas);

Size size() const override;
void setTime(Time t1, Time t2) override;
Expand Down

0 comments on commit 5bf7c0d

Please sign in to comment.