MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
testMatVecProductGradient_testData Namespace Reference

Classes

struct  test_b
 
struct  test_c
 
struct  test_d
 
struct  test_e
 
struct  test_f
 
struct  test_g
 
struct  test_i
 
struct  test_j
 
struct  test_l
 
struct  test_m
 
struct  test_norm_g
 
struct  test_r
 
struct  test_s
 
struct  test_t
 

Functions

template<typename S , index_type N_rows, index_type N_SIZE>
void testGradient (const S &ref, const Vector< Gradient< N_SIZE >, N_rows > &v, doublereal dTol)
 
template<typename S , index_type N_SIZE>
void testGradient (const S &ref, const Gradient< N_SIZE > &g, doublereal dTol)
 

Variables

static const struct
testMatVecProductGradient_testData::test_b 
oct_b
 
static const struct
testMatVecProductGradient_testData::test_c 
oct_c
 
static const struct
testMatVecProductGradient_testData::test_d 
oct_d
 
static const struct
testMatVecProductGradient_testData::test_e 
oct_e
 
static const struct
testMatVecProductGradient_testData::test_f 
oct_f
 
static const struct
testMatVecProductGradient_testData::test_g 
oct_g
 
static const struct
testMatVecProductGradient_testData::test_i 
oct_i
 
static const struct
testMatVecProductGradient_testData::test_j 
oct_j
 
static const struct
testMatVecProductGradient_testData::test_l 
oct_l
 
static const struct
testMatVecProductGradient_testData::test_m 
oct_m
 
static const struct
testMatVecProductGradient_testData::test_r 
oct_r
 
static const struct
testMatVecProductGradient_testData::test_s 
oct_s
 
static const struct
testMatVecProductGradient_testData::test_t 
oct_t
 
static const struct
testMatVecProductGradient_testData::test_norm_g 
oct_norm_g
 

Function Documentation

template<typename S , index_type N_rows, index_type N_SIZE>
void testMatVecProductGradient_testData::testGradient ( const S &  ref,
const Vector< Gradient< N_SIZE >, N_rows > &  v,
doublereal  dTol 
)

Definition at line 1108 of file matvectest.cc.

References bCompare(), and grad::dGetValue().

1108  {
1109  for (index_type i = 0; i < index_type(sizeof(ref.val)/sizeof(ref.val[0])); ++i) {
1110  assert(bCompare(v(i + 1).dGetValue(), ref.val[i], dTol));
1111  for (index_type j = 0; j < index_type(sizeof(ref.der[0])/sizeof(ref.der[0][0])); ++j) {
1112  std::cout << "v(" << i + 1 << ")=" << v(i + 1).dGetDerivativeGlobal(j + 1) << std::endl;
1113  std::cout << "ref.der[" << i << "][" << j << "]=" << ref.der[i][j] << std::endl;
1114 
1115  const bool bOK = bCompare<scalar_deriv_type>(v(i + 1).dGetDerivativeGlobal(j + 1), ref.der[i][j], dTol);
1116  std::cout << "dTol=" << dTol << " :[" << (bOK ? "OK" : "NOK") << "]" << std::endl;
1117  assert(bOK);
1118  }
1119  }
1120 }
scalar_func_type dGetValue(scalar_func_type d)
Definition: gradient.h:2845
bool bCompare(const T &a, const T &b, doublereal dTolRel=0.)
Definition: matvectest.cc:367
integer index_type
Definition: gradient.h:104

Here is the call graph for this function:

template<typename S , index_type N_SIZE>
void testMatVecProductGradient_testData::testGradient ( const S &  ref,
const Gradient< N_SIZE > &  g,
doublereal  dTol 
)

Definition at line 1123 of file matvectest.cc.

References bCompare(), grad::Gradient< N_SIZE >::dGetDerivativeGlobal(), and grad::Gradient< N_SIZE >::dGetValue().

1123  {
1124  for (index_type i = 0; i < index_type(sizeof(ref.val)/sizeof(ref.val[0])); ++i) {
1125  assert(bCompare(g.dGetValue(), ref.val[i], dTol));
1126  for (index_type j = 0; j < index_type(sizeof(ref.der[0])/sizeof(ref.der[0][0])); ++j) {
1127  assert(bCompare<scalar_deriv_type>(g.dGetDerivativeGlobal(j + 1), ref.der[i][j], dTol));
1128  }
1129  }
1130 }
scalar_deriv_type dGetDerivativeGlobal(index_type iGlobalDof) const
Definition: gradient.h:2532
bool bCompare(const T &a, const T &b, doublereal dTolRel=0.)
Definition: matvectest.cc:367
integer index_type
Definition: gradient.h:104
scalar_func_type dGetValue() const
Definition: gradient.h:2502

Here is the call graph for this function:

Variable Documentation

const struct testMatVecProductGradient_testData::test_b testMatVecProductGradient_testData::oct_b
static
Initial value:
= {
{6300,
11300,
16300},
{{220, 0, 0, 240, 0, 0, 260, 0, 0, 280, 0, 0},
{210, 110, 0, 220, 120, 0, 230, 130, 0, 240, 140, 0},
{310, 0, 110, 320, 0, 120, 330, 0, 130, 340, 0, 140}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_c testMatVecProductGradient_testData::oct_c
static
Initial value:
= {
{-6300,
-11300,
-16300},
{{-220, 0, 0, -240, 0, 0, -260, 0, 0, -280, 0, 0},
{-210, -110, 0, -220, -120, 0, -230, -130, 0, -240, -140, 0},
{-310, 0, -110, -320, 0, -120, -330, 0, -130, -340, 0, -140}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_d testMatVecProductGradient_testData::oct_d
static
Initial value:
= {
{0,
0,
0},
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_e testMatVecProductGradient_testData::oct_e
static
Initial value:
= {
{0,
0,
0},
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_f testMatVecProductGradient_testData::oct_f
static
Initial value:
= {
{0,
0,
0},
{{0, 0, -0, 0, 0, -0, 0, 0, -0, 0, 0, -0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, -0, 0, 0, -0, 0, 0, -0, 0, 0, -0, 0}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_g testMatVecProductGradient_testData::oct_g
static
Initial value:
= {
{6300,
11300,
16300},
{{220, 0, 0, 240, 0, 0, 260, 0, 0, 280, 0, 0},
{210, 110, 0, 220, 120, 0, 230, 130, 0, 240, 140, 0},
{310, 0, 110, 320, 0, 120, 330, 0, 130, 340, 0, 140}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_i testMatVecProductGradient_testData::oct_i
static
Initial value:
= {
{0,
0,
-0},
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_j testMatVecProductGradient_testData::oct_j
static
Initial value:
= {
{-74031.42857142857,
-50797.14285714286,
63828.57142857143},
{{-1390.571428571429, -389.7142857142857, -229.4285714285714, -1446.857142857143, -425.1428571428572, -250.2857142857143, -1503.142857142857, -460.5714285714286, -271.1428571428572, -1559.428571428571, -496, -292},
{-611.1428571428571, 0, -493.4285714285714, -585.1428571428571, 0, -538.2857142857143, -559.1428571428571, 0, -583.1428571428571, -533.1428571428571, 0, -628},
{1400.857142857143, 493.4285714285714, 0, 1487.428571428571, 538.2857142857143, 0, 1574, 583.1428571428571, 0, 1660.571428571429, 628, 0}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_l testMatVecProductGradient_testData::oct_l
static
Initial value:
= {
{163936.0000000001,
-1920098.285714285,
-1337944.571428571},
{{-2648.085714285714, -3602.028571428571, 6118.514285714286, -3602.457142857142, -3929.485714285714, 6674.742857142858, -4556.82857142857, -4256.942857142857, 7230.971428571428, -5511.200000000002, -4584.4, 7787.2},
{-39236.54285714286, -12579.28571428571, -2844.914285714286, -41293.65714285714, -13722.85714285714, -3103.542857142857, -43350.77142857143, -14866.42857142857, -3362.171428571429, -45407.88571428572, -16010, -3620.8},
{-19746.11428571428, -2844.914285714286, -9421.657142857142, -19748.8, -3103.542857142857, -10278.17142857143, -19751.48571428571, -3362.171428571428, -11134.68571428571, -19754.17142857143, -3620.8, -11991.2}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_m testMatVecProductGradient_testData::oct_m
static
Initial value:
= {
{819680.0000000002,
-9600491.428571427,
-6689722.857142856},
{{-13240.42857142857, -18010.14285714286, 30592.57142857143, -18012.28571428571, -19647.42857142857, 33373.71428571429, -22784.14285714285, -21284.71428571429, 36154.85714285714, -27556.00000000001, -22922, 38936},
{-196182.7142857143, -62896.42857142857, -14224.57142857143, -206468.2857142857, -68614.28571428572, -15517.71428571428, -216753.8571428572, -74332.14285714284, -16810.85714285714, -227039.4285714286, -80050, -18104},
{-98730.57142857142, -14224.57142857143, -47108.28571428571, -98743.99999999997, -15517.71428571429, -51390.85714285714, -98757.42857142858, -16810.85714285714, -55673.42857142857, -98770.85714285713, -18104, -59956}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_norm_g testMatVecProductGradient_testData::oct_norm_g
static
Initial value:
= {
{20810.33397137105},
{{423.4434686210582, 59.72994002450923, 86.15911702650448, 442.760794357062, 65.15993457219189, 93.99176402891398, 462.0781200930658, 70.58992911987455, 101.8244110313235, 481.3954458290696, 76.01992366755721, 109.657058033733}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_r testMatVecProductGradient_testData::oct_r
static
Initial value:
= {
{218540},
{{5765, -803, 1364, 6130, -876, 1488, 6495, -949, 1612, 6860, -1022, 1736}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_s testMatVecProductGradient_testData::oct_s
static
Initial value:
= {
{218540},
{{5765, -803, 1364, 6130, -876, 1488, 6495, -949, 1612, 6860, -1022, 1736}}}

Referenced by testMatVecProductGradient().

const struct testMatVecProductGradient_testData::test_t testMatVecProductGradient_testData::oct_t
static
Initial value:
= {
{433070000},
{{17624000, 2486000, 3586000, 18428000, 2712000, 3912000, 19232000, 2938000, 4238000, 20036000, 3164000, 4564000}}}

Referenced by testMatVecProductGradient().