rotgen/include/rotgen/container/map/dynamic/model.hpp
Joel Falcou ffa9309332 Reorganize internals
See merge request oss/rotgen!36
2025-10-12 19:01:13 +02:00

132 lines
No EOL
3.9 KiB
C++

//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
//==================================================================================================
/*
This file is a X-File to generate various map_impl_* declarations variant
*/
//==================================================================================================
class ROTGEN_EXPORT CLASSNAME
{
public:
CLASSNAME(TYPE CONST* ptr, Index r, Index c);
CLASSNAME(TYPE CONST* ptr, Index r, Index c, stride s);
CLASSNAME(CLASSNAME const& other);
CLASSNAME(CLASSNAME&&) noexcept;
#if !defined(USE_CONST)
CLASSNAME& operator=(CLASSNAME const& other);
CLASSNAME& operator=(CLASSNAME&& other);
#endif
~CLASSNAME();
Index rows() const;
Index cols() const;
Index size() const;
Index innerStride() const;
Index outerStride() const;
SOURCENAME normalized() const;
TRANSSOURCENAME transpose() const;
SOURCENAME conjugate() const;
TRANSSOURCENAME adjoint() const;
SOURCENAME cwiseAbs() const;
SOURCENAME cwiseAbs2() const;
SOURCENAME cwiseInverse() const;
SOURCENAME cwiseSqrt() const;
SOURCENAME cwiseMax (CLASSNAME const&) const;
SOURCENAME cwiseMin (CLASSNAME const&) const;
SOURCENAME cwiseProduct (CLASSNAME const&) const;
SOURCENAME cwiseQuotient (CLASSNAME const&) const;
SOURCENAME cwiseMax(TYPE) const;
SOURCENAME cwiseMin(TYPE) const;
#if !defined(USE_CONST)
void normalize();
void transposeInPlace();
void adjointInPlace();
#endif
TYPE sum() const;
TYPE prod() const;
TYPE mean() const;
TYPE trace() const;
TYPE maxCoeff() const;
TYPE minCoeff() const;
TYPE maxCoeff(Index*, Index*) const;
TYPE minCoeff(Index*, Index*) const;
TYPE dot(CLASSNAME const&) const;
TYPE dot(TRANSCLASSNAME const&) const;
TYPE squaredNorm() const;
TYPE norm() const;
TYPE lpNorm(int p) const;
SOURCENAME qr_solve(CLASSNAME const& rhs) const;
#if !defined(USE_CONST)
TYPE& operator()(Index i, Index j);
TYPE& operator()(Index i);
#endif
TYPE operator()(Index i, Index j) const;
TYPE operator()(Index i) const;
#if !defined(USE_CONST)
CLASSNAME& operator+=(CLASSNAME const& rhs);
CLASSNAME& operator+=(CLASSCONSTNAME const& rhs);
CLASSNAME& operator-=(CLASSNAME const& rhs);
CLASSNAME& operator-=(CLASSCONSTNAME const& rhs);
CLASSNAME& operator*=(CLASSNAME const& rhs);
CLASSNAME& operator*=(CLASSCONSTNAME const& rhs);
CLASSNAME& operator*=(TYPE d);
CLASSNAME& operator/=(TYPE d);
#endif
SOURCENAME operator-() const;
SOURCENAME add(CLASSNAME const& rhs) const;
SOURCENAME add(TRANSCLASSNAME const& rhs) const;
SOURCENAME sub(CLASSNAME const& rhs) const;
SOURCENAME sub(TRANSCLASSNAME const& rhs) const;
SOURCENAME mul(CLASSNAME const& rhs) const;
SOURCENAME mul(TRANSCLASSNAME const& rhs) const;
SOURCENAME mul(TYPE s) const;
SOURCENAME div(TYPE s) const;
SOURCENAME inverse() const;
friend ROTGEN_EXPORT std::ostream& operator<<(std::ostream&, CLASSNAME const&);
friend ROTGEN_EXPORT std::ostream& operator<<(std::ostream&, format<CLASSNAME> const&);
const TYPE* data() const;
#if !defined(USE_CONST)
TYPE* data();
void setZero();
void setOnes();
void setRandom();
void setIdentity();
void setConstant(TYPE);
#endif
friend ROTGEN_EXPORT bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend ROTGEN_EXPORT bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs);
private:
struct payload;
std::unique_ptr<payload> storage_;
public:
std::unique_ptr<payload>& storage() { return storage_; }
std::unique_ptr<payload> const& storage() const { return storage_; }
};