QUGaR 0.0.4
Loading...
Searching...
No Matches
qugar::impl::funcs::Square< dim > Class Template Reference

Dimension independent square function in domain [-1,1]^dim. More...

#include <impl_funcs_lib.hpp>

Inheritance diagram for qugar::impl::funcs::Square< dim >:
[legend]
Collaboration diagram for qugar::impl::funcs::Square< dim >:
[legend]

Public Member Functions

 Square ()=default
 Constructs a new square aligned with the Cartesian axes.
 
 Square (const AffineTransf< dim > &transf)
 Constructs a new square object transformed according to transf.
 
- Public Member Functions inherited from qugar::impl::funcs::FuncWithAffineTransf< dim >
 FuncWithAffineTransf ()
 Default constructor. Creates and stores an identity transformation.
 
 FuncWithAffineTransf (const AffineTransf< dim > &transf)
 Constructs a new class storing the given transf.
 
- Public Member Functions inherited from qugar::impl::DomainFunc< dim, range >
 DomainFunc ()=default
 Default constructor.
 
 DomainFunc (const DomainFunc &)=default
 Default copy constructor.
 
 DomainFunc (DomainFunc &&)=default
 Default move constructor.
 
DomainFuncoperator= (const DomainFunc &)=default
 Default copy assignment operator.
 
DomainFuncoperator= (DomainFunc &&)=default
 Default move assignment operator.
 
virtual ~DomainFunc ()=default
 Default virtual destructor.
 
virtual Value< realoperator() (const Point< dim > &point) const =0
 Evaluator operator.
 
virtual Value< Interval< dim > > operator() (const Point< dim, Interval< dim > > &point) const =0
 Evaluator operator.
 
virtual Gradient< realgrad (const Point< dim > &point) const =0
 Gradient evaluator operator.
 
virtual Gradient< Interval< dim > > grad (const Point< dim, Interval< dim > > &point) const =0
 Gradient evaluator operator.
 
virtual Hessian< realhessian (const Point< dim > &point) const =0
 Hessian evaluator operator.
 

Static Public Member Functions

template<typename T >
static int sgn (const T &val)
 Returns the sign of the given value.
 

Public Attributes

 declare_impl_func_virtual_interface
 

Additional Inherited Members

- Public Types inherited from qugar::impl::DomainFunc< dim, range >
template<int N>
using Interval = ::algoim::Interval<N>
 Algoim's interval alias.
 
template<typename T >
using Value = std::conditional_t<range == 1, T, Vector<T, range>>
 Value type.
 
template<typename T >
using Gradient = Vector<Value<T>, dim>
 Gradient type.
 
template<typename T >
using Hessian = Vector<Value<T>, num_hessian>
 Hessian (symmetric type).
 
- Static Public Attributes inherited from qugar::impl::DomainFunc< dim, range >
static const int num_hessian = dim * (dim + 1) / 2
 Number of Hessian (symmetric) components.
 
- Protected Attributes inherited from qugar::impl::funcs::FuncWithAffineTransf< dim >
AffineTransf< dim > transf_
 Stored affine transformation.
 

Detailed Description

template<int dim>
class qugar::impl::funcs::Square< dim >

Dimension independent square function in domain [-1,1]^dim.

Template Parameters
dimParametric dimension.
Warning
So far, only implemented for the 2D case.

Constructor & Destructor Documentation

◆ Square() [1/2]

template<int dim>
qugar::impl::funcs::Square< dim >::Square ( )
default

Constructs a new square aligned with the Cartesian axes.

◆ Square() [2/2]

template<int dim>
qugar::impl::funcs::Square< dim >::Square ( const AffineTransf< dim > & transf)
explicit

Constructs a new square object transformed according to transf.

Parameters
transfAffine transformation applied to the square. It may rotate the axes, translate the square, and/or scale it (iso or anisotropically).

Member Function Documentation

◆ sgn()

template<int dim>
template<typename T >
static int qugar::impl::funcs::Square< dim >::sgn ( const T & val)
static

Returns the sign of the given value.

Template Parameters
TType of the value.
Parameters
valValue to be tested.
Returns
+1 is val is positive, -1 if it is negative, 0 otherwise.

Member Data Documentation

◆ declare_impl_func_virtual_interface

template<int dim>
qugar::impl::funcs::Square< dim >::declare_impl_func_virtual_interface

The documentation for this class was generated from the following file: