MOAB: Mesh Oriented datABase  (version 5.2.1)
TMPCommon.hpp File Reference

Common utility stuff for implementing target metrics. More...

#include "Mesquite.hpp"
+ Include dependency graph for TMPCommon.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MBMesquite::DimConst< D >
 Dimension-specific constants. More...
struct  MBMesquite::DimConst< 2 >
struct  MBMesquite::DimConst< 3 >

Namespaces

namespace  MBMesquite
 

Implements the NonSmoothDescent class member functions.


Defines

#define TMP_T_TEMPL_IMPL_DIM(N, D)
#define TMP_T_TEMPL_IMPL_COMMON(N)
 A macro that declares virtual evaluation functions for a TMetric subclass N.
#define TMP_T_TEMPL_IMPL_ERR_DIM(N, D)
#define TMP_T_TEMPL_IMPL_COMMON_ERR(N)
 A macro that declares virtual evaluation functions for a TMetric subclass N.
#define TMP_AW_TEMPL_IMPL_DIM(N, D)
#define TMP_AW_TEMPL_IMPL_COMMON(N)
 A macro that declares virtual evaluation functions for a AWMetric subclass N.
#define TMP_AW_TEMPL_IMPL_NO2ND_DIM(N, D)
#define TMP_AW_TEMPL_IMPL_COMMON_NO2ND(N)

Detailed Description

Common utility stuff for implementing target metrics.

Author:
Jason Kraftcheck

Definition in file TMPCommon.hpp.


Define Documentation

#define TMP_AW_TEMPL_IMPL_COMMON (   N)
Value:
TMP_AW_TEMPL_IMPL_DIM( N, 2 )     \
    TMP_AW_TEMPL_IMPL_DIM( N, 3 )

A macro that declares virtual evaluation functions for a AWMetric subclass N.

Like TMP_AW_TEMPL_IMPL_COMMON, except no implementation of 2nd derivs.

IF a AWMetric class provides template functions named eval, grad, and hess, then this macro can be used to provide the trivial implementations of the 2D and 3D evaluate, evaluate_with_grad, and evaluate_with_hess virtual member functions in terms of those macros.

Value:
TMP_AW_TEMPL_IMPL_NO2ND_DIM( N, 2 )     \
    TMP_AW_TEMPL_IMPL_NO2ND_DIM( N, 3 )

Definition at line 145 of file TMPCommon.hpp.

#define TMP_AW_TEMPL_IMPL_DIM (   N,
 
)
Value:
bool N::evaluate( const MsqMatrix< D, D >& A, const MsqMatrix< D, D >& W, double& r, MsqError& ) \
    {                                                                                                \
        return eval( A, W, r );                                                                      \
    }                                                                                                \
    bool N::evaluate_with_grad( const MsqMatrix< D, D >& A, const MsqMatrix< D, D >& W, double& r,   \
                                MsqMatrix< D, D >& d1, MsqError& )                                   \
    {                                                                                                \
        return grad( A, W, r, d1 );                                                                  \
    }                                                                                                \
    bool N::evaluate_with_hess( const MsqMatrix< D, D >& A, const MsqMatrix< D, D >& W, double& r,   \
                                MsqMatrix< D, D >& d1, MsqMatrix< D, D >* d2, MsqError& )            \
    {                                                                                                \
        return hess( A, W, r, d1, d2 );                                                              \
    }

Definition at line 110 of file TMPCommon.hpp.

#define TMP_AW_TEMPL_IMPL_NO2ND_DIM (   N,
 
)
Value:
bool N::evaluate( const MsqMatrix< D, D >& A, const MsqMatrix< D, D >& W, double& r, MsqError& ) \
    {                                                                                                \
        return eval( A, W, r );                                                                      \
    }                                                                                                \
    bool N::evaluate_with_grad( const MsqMatrix< D, D >& A, const MsqMatrix< D, D >& W, double& r,   \
                                MsqMatrix< D, D >& d1, MsqError& )                                   \
    {                                                                                                \
        return grad( A, W, r, d1 );                                                                  \
    }

Definition at line 134 of file TMPCommon.hpp.

#define TMP_T_TEMPL_IMPL_COMMON (   N)
Value:
TMP_T_TEMPL_IMPL_DIM( N, 2 )     \
    TMP_T_TEMPL_IMPL_DIM( N, 3 )

A macro that declares virtual evaluation functions for a TMetric subclass N.

IF a TMetric class provides template functions named eval, grad, and hess, then this macro can be used to provide the trivial implementations of the 2D and 3D evaluate, evaluate_with_grad, and evaluate_with_hess virtual member functions in terms of those macros.

Definition at line 64 of file TMPCommon.hpp.

Value:
TMP_T_TEMPL_IMPL_ERR_DIM( N, 2 )     \
    TMP_T_TEMPL_IMPL_ERR_DIM( N, 3 )

A macro that declares virtual evaluation functions for a TMetric subclass N.

IF a TMetric class provides template functions named eval, grad, and hess, then this macro can be used to provide the trivial implementations of the 2D and 3D evaluate, evaluate_with_grad, and evaluate_with_hess virtual member functions in terms of those macros.

The difference between this macro and TMP_AW_TEMPL_IMPL_COMMON is that this variation expects the eval, grad, and hess to accept an MsqError as their last argument. This variation is typically used for metrics that are a function of some other metric.

Definition at line 97 of file TMPCommon.hpp.

#define TMP_T_TEMPL_IMPL_DIM (   N,
 
)
Value:
bool N::evaluate( const MsqMatrix< D, D >& T, double& r, MsqError& )                                             \
    {                                                                                                                \
        return eval( T, r );                                                                                         \
    }                                                                                                                \
    bool N::evaluate_with_grad( const MsqMatrix< D, D >& T, double& r, MsqMatrix< D, D >& d1, MsqError& )            \
    {                                                                                                                \
        return grad( T, r, d1 );                                                                                     \
    }                                                                                                                \
    bool N::evaluate_with_hess( const MsqMatrix< D, D >& T, double& r, MsqMatrix< D, D >& d1, MsqMatrix< D, D >* d2, \
                                MsqError& )                                                                          \
    {                                                                                                                \
        return hess( T, r, d1, d2 );                                                                                 \
    }

Definition at line 49 of file TMPCommon.hpp.

#define TMP_T_TEMPL_IMPL_ERR_DIM (   N,
 
)
Value:
bool N::evaluate( const MsqMatrix< D, D >& T, double& r, MsqError& err )                                         \
    {                                                                                                                \
        return eval( T, r, err );                                                                                    \
    }                                                                                                                \
    bool N::evaluate_with_grad( const MsqMatrix< D, D >& T, double& r, MsqMatrix< D, D >& d1, MsqError& err )        \
    {                                                                                                                \
        return grad( T, r, d1, err );                                                                                \
    }                                                                                                                \
    bool N::evaluate_with_hess( const MsqMatrix< D, D >& T, double& r, MsqMatrix< D, D >& d1, MsqMatrix< D, D >* d2, \
                                MsqError& err )                                                                      \
    {                                                                                                                \
        return hess( T, r, d1, d2, err );                                                                            \
    }

Definition at line 82 of file TMPCommon.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines