https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: db2a382e8aa9f29feae3a3ed092ae713ef64bd21 authored by Wenqing Wang on 19 March 2021, 10:59:24 UTC
[MPL/Vapour] Corrected the DBUG message in two creators.
Tip revision: db2a382
TemplateWeightedPoint.h
/**
 * \file
 * \date Sep 3, 2013
 * \brief Weighted point class.
 *
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 */

#pragma once

#include "TemplatePoint.h"

namespace MathLib
{

template <typename FP_T, typename W_T, std::size_t DIM>
class TemplateWeightedPoint : public TemplatePoint<FP_T, DIM>
{
public:
    TemplateWeightedPoint(std::array<FP_T, DIM> const& x, W_T weight) :
        TemplatePoint<FP_T, DIM>(x), _weight(weight)
    {}

    W_T getWeight() const
    {
        return _weight;
    }

private:
    W_T const _weight;
};

using WeightedPoint1D = TemplateWeightedPoint<double, double, 1>;
using WeightedPoint2D = TemplateWeightedPoint<double, double, 2>;
using WeightedPoint3D = TemplateWeightedPoint<double, double, 3>;

} // end namespace MathLib
back to top