ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
TestClassVectors Class Reference

#include <TestClassVectors.h>

Collaboration diagram for TestClassVectors:

Public Member Functions

 TestClassVectors ()
 
 ~TestClassVectors ()
 
void setNonZero ()
 
bool operator== (const TestClassVectors &rhs) const
 
bool operator!= (const TestClassVectors &rhs) const
 
std::ostream & streamOut (std::ostream &os) const
 

Public Attributes

std::vector< std::string > m_vector_of_string
 
std::vector< double > m_vector_of_double
 
std::vector< std::vector< double > > m_vector_of_vector_of_double
 

Detailed Description

Definition at line 12 of file TestClassVectors.h.

Constructor & Destructor Documentation

◆ TestClassVectors()

TestClassVectors::TestClassVectors ( )
inline

Definition at line 29 of file TestClassVectors.h.

◆ ~TestClassVectors()

TestClassVectors::~TestClassVectors ( )
inline

Definition at line 15 of file TestClassVectors.h.

15 {}

Member Function Documentation

◆ operator!=()

bool TestClassVectors::operator!= ( const TestClassVectors rhs) const
inline

Definition at line 114 of file TestClassVectors.h.

115 {
116  return ( ( (*this) == rhs ) ? false : true );
117 }

◆ operator==()

bool TestClassVectors::operator== ( const TestClassVectors rhs) const
inline

Definition at line 79 of file TestClassVectors.h.

80 {
81  if ( m_vector_of_string.size() != rhs.m_vector_of_string.size() ) return false;
82  if ( m_vector_of_double.size() != rhs.m_vector_of_double.size() ) return false;
83  if ( m_vector_of_vector_of_double.size() != rhs.m_vector_of_vector_of_double.size() ) return false;
84 
85  std::vector< std::string >::const_iterator i_vector_of_string_rhs = rhs.m_vector_of_string.begin();
86  for ( std::vector< std::string >::const_iterator i = m_vector_of_string.begin();
87  i != m_vector_of_string.end(); ++i, ++i_vector_of_string_rhs ) {
88  if ( *i != *i_vector_of_string_rhs ) return false;
89  }
90 
91  std::vector< double >::const_iterator i_vector_of_double_rhs = rhs.m_vector_of_double.begin();
92  for ( std::vector< double >::const_iterator i = m_vector_of_double.begin();
93  i != m_vector_of_double.end(); ++i, ++i_vector_of_double_rhs ) {
94  if ( *i != *i_vector_of_double_rhs ) return false;
95  }
96 
97  std::vector< std::vector< double > >::const_iterator i_vector_of_vector_of_double_rhs = rhs.m_vector_of_vector_of_double.begin();
98  for ( std::vector< std::vector< double > >::const_iterator i = m_vector_of_vector_of_double.begin();
99  i != m_vector_of_vector_of_double.end(); ++i, ++i_vector_of_vector_of_double_rhs ) {
100  if ( i->size() != i_vector_of_vector_of_double_rhs->size() ) return false;
101 
102  std::vector< double >::const_iterator j_vector_of_vector_of_double_rhs = i_vector_of_vector_of_double_rhs->begin();
103  for ( std::vector< double >::const_iterator j = i->begin();
104  j != i->end(); ++j, ++j_vector_of_vector_of_double_rhs ) {
105  if ( *j != *j_vector_of_vector_of_double_rhs ) return false;
106  }
107  }
108 
109  return true;
110 }

◆ setNonZero()

void TestClassVectors::setNonZero ( )
inline

Definition at line 64 of file TestClassVectors.h.

65 {
66  m_vector_of_string.clear();
67  m_vector_of_string.push_back( "lcg" );
68  m_vector_of_string.push_back( "app" );
69  m_vector_of_string.push_back( "pool" );
70  m_vector_of_double.clear();
71  m_vector_of_double.push_back( 1 );
72  m_vector_of_double.push_back( 2 );
75  m_vector_of_double.push_back( 3 );
76 }

◆ streamOut()

std::ostream & TestClassVectors::streamOut ( std::ostream &  os) const
inline

Definition at line 36 of file TestClassVectors.h.

37 {
38  os << "m_vector_of_string( " << m_vector_of_string.size() << " ) :";
39  for ( std::vector< std::string >::const_iterator i = m_vector_of_string.begin();
40  i != m_vector_of_string.end(); ++i ) {
41  os << " " << *i;
42  }
43  os << std::endl;
44  os << "m_vector_of_double( " << m_vector_of_double.size() << " ) :";
45  for ( std::vector< double >::const_iterator i = m_vector_of_double.begin();
46  i != m_vector_of_double.end(); ++i ) {
47  os << " " << *i;
48  }
49  os << std::endl;
50  os << "m_vector_of_vector_of_double( " << m_vector_of_vector_of_double.size() << " ) :";
51  for ( std::vector< std::vector< double > >::const_iterator i = m_vector_of_vector_of_double.begin();
52  i != m_vector_of_vector_of_double.end(); ++i ) {
53  os << std::endl << " (" << i->size() << ") :";
54  for ( std::vector< double >::const_iterator j = i->begin();
55  j != i->end(); ++j ) {
56  os << " " << *j;
57  }
58  }
59 
60  return os;
61 }

Member Data Documentation

◆ m_vector_of_double

std::vector< double > TestClassVectors::m_vector_of_double

Definition at line 23 of file TestClassVectors.h.

◆ m_vector_of_string

std::vector< std::string > TestClassVectors::m_vector_of_string

Definition at line 22 of file TestClassVectors.h.

◆ m_vector_of_vector_of_double

std::vector< std::vector< double > > TestClassVectors::m_vector_of_vector_of_double

Definition at line 24 of file TestClassVectors.h.


The documentation for this class was generated from the following file:
TestClassVectors::m_vector_of_vector_of_double
std::vector< std::vector< double > > m_vector_of_vector_of_double
Definition: TestClassVectors.h:24
lumiFormat.i
int i
Definition: lumiFormat.py:92
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TestClassVectors::m_vector_of_string
std::vector< std::string > m_vector_of_string
Definition: TestClassVectors.h:22
TestClassVectors::m_vector_of_double
std::vector< double > m_vector_of_double
Definition: TestClassVectors.h:23