Commit 8d862c5c authored by Lasse Hinrichsen's avatar Lasse Hinrichsen
Browse files

Use CamelCase in SeminlinearFunctional

parent 6e567ba4
Pipeline #34897 passed with stage
in 10 minutes and 27 seconds
......@@ -122,13 +122,13 @@ computeFunctionalValue(const V& weights, V pos, const F& phi)
}
template<typename V, typename ScalarFunction, typename R = double>
class SemilinearfunctionalDirectionalRestriction
class SemilinearFunctionalDirectionalRestriction
{
public:
using Vector = V;
using Range = R;
template<typename FF>
SemilinearfunctionalDirectionalRestriction(const Vector& weights,
SemilinearFunctionalDirectionalRestriction(const Vector& weights,
const Vector& origin,
const Vector& direction,
FF&& phi)
......@@ -188,20 +188,20 @@ private:
};
template<typename V, typename ScalarFunction, typename R = double>
class Semilinearfunctional
class SemilinearFunctional
{
public:
using Vector = V;
using Range = R;
template<typename FF>
Semilinearfunctional(const Vector& weights, FF&& phi)
SemilinearFunctional(const Vector& weights, FF&& phi)
: weights_(weights)
, origin_(Impl::zeroCopy(weights_))
, phi_(std::forward<FF>(phi))
{}
template<typename FF>
Semilinearfunctional(const Vector& weights, const Vector& origin, FF&& phi)
SemilinearFunctional(const Vector& weights, const Vector& origin, FF&& phi)
: weights_(weights)
, origin_(origin)
, phi_(std::forward<FF>(phi))
......@@ -230,26 +230,26 @@ public:
return Impl::computeFunctionalValue(weights_, std::move(x), phi_);
}
friend auto shift(const Semilinearfunctional& f, const Vector& origin)
friend auto shift(const SemilinearFunctional& f, const Vector& origin)
{
auto new_origin = f.origin_;
new_origin += origin;
return Semilinearfunctional(f.weights_, new_origin, f.phi_);
return SemilinearFunctional(f.weights_, new_origin, f.phi_);
}
friend auto directionalRestriction(const Semilinearfunctional& f,
friend auto directionalRestriction(const SemilinearFunctional& f,
const Vector& origin,
const Vector& direction)
{
// TODO What happens if f already has a nontrivial origin? And if so,
// what SHOULD happen?
return SemilinearfunctionalDirectionalRestriction<decltype(f.weights_),
return SemilinearFunctionalDirectionalRestriction<decltype(f.weights_),
decltype(f.phi_)>(
f.weights_, origin, direction, f.phi_);
}
template<typename Index>
friend auto coordinateRestriction(const Semilinearfunctional& f,
friend auto coordinateRestriction(const SemilinearFunctional& f,
const Index& i)
{
using BT = std::decay_t<decltype(f.weights_[0])>;
......@@ -257,7 +257,7 @@ public:
// other components. But since the minimization is independent from these,
// why bother? The coupling between components should be handled in the
// quadratic part.
return Semilinearfunctional<BT, decltype(f.phi_)>(
return SemilinearFunctional<BT, decltype(f.phi_)>(
f.weights_[i], f.origin_[i], f.phi_);
}
......@@ -273,6 +273,6 @@ private:
};
template<typename V, typename ScalarFunction>
Semilinearfunctional(const V& weights, ScalarFunction&& phi) -> Semilinearfunctional<std::decay_t<V>, std::decay_t<ScalarFunction>>;
SemilinearFunctional(const V& weights, ScalarFunction&& phi) -> SemilinearFunctional<std::decay_t<V>, std::decay_t<ScalarFunction>>;
}
\ No newline at end of file
}
......@@ -210,7 +210,7 @@ solveSystem(V const& u_old, M const& matrix, Grid const& grid)
auto phi = LogPotential();
auto quadratic = TNNMG::QuadraticFunctional<M, V, double>(matrix, u_old);
auto nonlinear = TNNMG::Semilinearfunctional(weights, phi);
auto nonlinear = TNNMG::SemilinearFunctional(weights, phi);
auto functional =
TNNMG::SumFunctional(quadratic, nonlinear);
......@@ -414,4 +414,4 @@ main(int argc, char** argv)
for (int t = 1; t < solutions.size(); ++t) {
plot(gridview, solutions[t], t);
}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment