ReactOS  0.4.15-dev-1070-ge1a01de
InnerprodTest Class Reference
Inheritance diagram for InnerprodTest:
Collaboration diagram for InnerprodTest:

Protected Member Functions

void inprod0 ()
 
void inprod1 ()
 
void inprod2 ()
 

Static Protected Member Functions

static size_t add (size_t a_, size_t b_)
 
static size_t mult (size_t a_, size_t b_)
 

Private Member Functions

 CPPUNIT_TEST_SUITE (InnerprodTest)
 
 CPPUNIT_TEST (inprod0)
 
 CPPUNIT_TEST (inprod1)
 
 CPPUNIT_TEST (inprod2)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 14 of file innerprod_test.cpp.

Member Function Documentation

◆ add()

static size_t InnerprodTest::add ( size_t  a_,
size_t  b_ 
)
inlinestaticprotected

Definition at line 27 of file innerprod_test.cpp.

27  {
28  return a_ + b_;
29  }

◆ CPPUNIT_TEST() [1/3]

InnerprodTest::CPPUNIT_TEST ( inprod0  )
private

◆ CPPUNIT_TEST() [2/3]

InnerprodTest::CPPUNIT_TEST ( inprod1  )
private

◆ CPPUNIT_TEST() [3/3]

InnerprodTest::CPPUNIT_TEST ( inprod2  )
private

◆ CPPUNIT_TEST_SUITE()

InnerprodTest::CPPUNIT_TEST_SUITE ( InnerprodTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

InnerprodTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ inprod0()

void InnerprodTest::inprod0 ( )
protected

Definition at line 41 of file innerprod_test.cpp.

42 {
43  int vector1[5] = { 1, 2, 3, 4, 5 };
44  int vector2[5] = { 1, 2, 3, 4, 5 };
45 
46  int result;
47  result = inner_product(vector1, vector1 + 5, vector2, 0);
49 }
_STLP_INLINE_LOOP _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp _Init)
Definition: _numeric.h:61
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLuint64EXT * result
Definition: glext.h:11304

◆ inprod1()

void InnerprodTest::inprod1 ( )
protected

Definition at line 50 of file innerprod_test.cpp.

51 {
52  vector<size_t> v1(3);
53  vector<size_t> v2(v1.size());
54  for (size_t i = 0; i < v1.size(); ++i) {
55  v1[i] = i + 1;
56  v2[i] = v1.size() - i;
57  }
58  size_t result = inner_product(v1.begin(), v1.end(), v2.begin(), (size_t)0);
59  CPPUNIT_ASSERT(result == 10);
60 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_STLP_INLINE_LOOP _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp _Init)
Definition: _numeric.h:61
__kernel_size_t size_t
Definition: linux.h:237
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat v1
Definition: glext.h:6062

◆ inprod2()

void InnerprodTest::inprod2 ( )
protected

Definition at line 61 of file innerprod_test.cpp.

62 {
63  vector<size_t> v1(3);
64  vector<size_t> v2(v1.size());
65  for(size_t i = 0; i < v1.size(); ++i) {
66  v1[i] = i + 1;
67  v2[i] = v1.size() - i;
68  }
69  size_t result=inner_product(v1.begin(), v1.end(), v2.begin(), (size_t)1, mult, add);
70 
71  CPPUNIT_ASSERT(result == 64);
72 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_STLP_INLINE_LOOP _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp _Init)
Definition: _numeric.h:61
__kernel_size_t size_t
Definition: linux.h:237
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
static size_t mult(size_t a_, size_t b_)
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat v1
Definition: glext.h:6062
static size_t add(size_t a_, size_t b_)

◆ mult()

static size_t InnerprodTest::mult ( size_t  a_,
size_t  b_ 
)
inlinestaticprotected

Definition at line 31 of file innerprod_test.cpp.

31  {
32  return a_ * b_;
33  }

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