qse  0.5.4
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
QseColumn Class Reference

#include <qsecolumn.h>

Inheritance diagram for QseColumn:
Inheritance graph

Public Member Functions

 QseColumn (const QString nm)
 
 ~QseColumn ()
 
QString name () const
 
int rowCount () const
 
void setRowCount (int n)
 
void clear ()
 
const double * data () const
 
double data (int n) const
 
void setData (int n, double v)
 
void appendData (double v)
 
void addition (const QseColumn *col)
 
void subtraction (const QseColumn *col)
 
void multiplication (const QseColumn *col)
 
void division (const QseColumn *col)
 
void assignment (const QseColumn *col)
 
void addition (const double val)
 
void subtraction (const double val)
 
void multiplication (const double val)
 
void division (const double val)
 
void assignment (const double val)
 

Private Attributes

QString m_Name
 
QVector< double > m_Data
 

Static Private Attributes

static QMutex m_Mutex
 

Detailed Description

Definition at line 11 of file qsecolumn.h.

Constructor & Destructor Documentation

QseColumn::QseColumn ( const QString  nm)

Definition at line 10 of file qsecolumn.cpp.

11  : QObject(NULL),
12 // m_Role(UnspecifiedRole),
13  m_Name(nm)
14 {}
QString m_Name
Definition: qsecolumn.h:45
QseColumn::~QseColumn ( )

Definition at line 16 of file qsecolumn.cpp.

17 {}

Member Function Documentation

void QseColumn::addition ( const QseColumn col)

Definition at line 86 of file qsecolumn.cpp.

References data(), m_Data, m_Mutex, and rowCount().

87 {
88  if (col) {
89  int nr0 = rowCount(), nr1 = col -> rowCount();
90  int nr = (nr0 < nr1 ? nr0 : nr1);
91 
92  QMutexLocker lock(&m_Mutex);
93 
94  for (int i = 0; i < nr; i++) {
95  m_Data[i] += col -> data(i);
96  }
97  }
98 }
const double * data() const
Definition: qsecolumn.cpp:62
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::addition ( const double  val)

Definition at line 156 of file qsecolumn.cpp.

References m_Data, m_Mutex, and rowCount().

157 {
158  int nr = rowCount();
159 
160  QMutexLocker lock(&m_Mutex);
161 
162  for (int i = 0; i < nr; i++) {
163  m_Data[i] += val;
164  }
165 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::appendData ( double  v)

Definition at line 41 of file qsecolumn.cpp.

References m_Data, and m_Mutex.

42 {
43  QMutexLocker lock(&m_Mutex);
44 
45  m_Data.push_back(v);
46 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::assignment ( const QseColumn col)

Definition at line 142 of file qsecolumn.cpp.

References data(), m_Data, m_Mutex, and rowCount().

143 {
144  if (col) {
145  int nr0 = rowCount(), nr1 = col -> rowCount();
146  int nr = (nr0 < nr1 ? nr0 : nr1);
147 
148  QMutexLocker lock(&m_Mutex);
149 
150  for (int i = 0; i < nr; i++) {
151  m_Data[i] = col -> data(i);
152  }
153  }
154 }
const double * data() const
Definition: qsecolumn.cpp:62
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::assignment ( const double  val)

Definition at line 200 of file qsecolumn.cpp.

References m_Data, m_Mutex, and rowCount().

201 {
202  int nr = rowCount();
203 
204  QMutexLocker lock(&m_Mutex);
205 
206  for (int i = 0; i < nr; i++) {
207  m_Data[i] = val;
208  }
209 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::clear ( )

Definition at line 33 of file qsecolumn.cpp.

References m_Data, m_Mutex, and m_Name.

34 {
35  QMutexLocker lock(&m_Mutex);
36 
37  m_Name="";
38  m_Data.clear();
39 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
QString m_Name
Definition: qsecolumn.h:45
QVector< double > m_Data
Definition: qsecolumn.h:46
const double * QseColumn::data ( ) const

Definition at line 62 of file qsecolumn.cpp.

References m_Data, and m_Mutex.

Referenced by addition(), QseScanAverager::addScanToAverage(), assignment(), division(), multiplication(), subtraction(), QseDataExport::updatePreview(), QseScan::writeScan(), QseDataReference::x(), and QseDataReference::y().

63 {
64  QMutexLocker lock(&m_Mutex);
65 
66  return m_Data.begin();
67 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
QVector< double > m_Data
Definition: qsecolumn.h:46
double QseColumn::data ( int  n) const

Definition at line 69 of file qsecolumn.cpp.

References m_Data, m_Mutex, and rowCount().

70 {
71  if ((0 <= n) && (n < rowCount())) {
72  QMutexLocker lock(&m_Mutex);
73  return m_Data.at(n);
74  } else {
75  return 0;
76  }
77 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::division ( const QseColumn col)

Definition at line 128 of file qsecolumn.cpp.

References data(), m_Data, m_Mutex, and rowCount().

Referenced by QseScanAverager::finishAveraging(), and QseNormalizer::normalizeScan().

129 {
130  if (col) {
131  int nr0 = rowCount(), nr1 = col -> rowCount();
132  int nr = (nr0 < nr1 ? nr0 : nr1);
133 
134  QMutexLocker lock(&m_Mutex);
135 
136  for (int i = 0; i < nr; i++) {
137  m_Data[i] /= col -> data(i);
138  }
139  }
140 }
const double * data() const
Definition: qsecolumn.cpp:62
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::division ( const double  val)

Definition at line 189 of file qsecolumn.cpp.

References m_Data, m_Mutex, and rowCount().

190 {
191  int nr = rowCount();
192 
193  QMutexLocker lock(&m_Mutex);
194 
195  for (int i = 0; i < nr; i++) {
196  m_Data[i] /= val;
197  }
198 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::multiplication ( const QseColumn col)

Definition at line 114 of file qsecolumn.cpp.

References data(), m_Data, m_Mutex, and rowCount().

Referenced by QseNormalizer::normalizeScan().

115 {
116  if (col) {
117  int nr0 = rowCount(), nr1 = col -> rowCount();
118  int nr = (nr0 < nr1 ? nr0 : nr1);
119 
120  QMutexLocker lock(&m_Mutex);
121 
122  for (int i = 0; i < nr; i++) {
123  m_Data[i] *= col -> data(i);
124  }
125  }
126 }
const double * data() const
Definition: qsecolumn.cpp:62
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::multiplication ( const double  val)

Definition at line 178 of file qsecolumn.cpp.

References m_Data, m_Mutex, and rowCount().

179 {
180  int nr = rowCount();
181 
182  QMutexLocker lock(&m_Mutex);
183 
184  for (int i = 0; i < nr; i++) {
185  m_Data[i] *= val;
186  }
187 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
QString QseColumn::name ( ) const
int QseColumn::rowCount ( ) const

Definition at line 48 of file qsecolumn.cpp.

References m_Data, and m_Mutex.

Referenced by addition(), assignment(), data(), division(), QseScan::maxRowCount(), multiplication(), QseDataReference::size(), and subtraction().

49 {
50  QMutexLocker lock(&m_Mutex);
51 
52  return m_Data.size();
53 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::setData ( int  n,
double  v 
)

Definition at line 79 of file qsecolumn.cpp.

References m_Data, and m_Mutex.

Referenced by QseScanAverager::addScanToAverage().

80 {
81  QMutexLocker lock(&m_Mutex);
82 
83  m_Data[n] = v;
84 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::setRowCount ( int  n)

Definition at line 55 of file qsecolumn.cpp.

References m_Data, and m_Mutex.

56 {
57  QMutexLocker lock(&m_Mutex);
58 
59  m_Data.resize(n);
60 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::subtraction ( const QseColumn col)

Definition at line 100 of file qsecolumn.cpp.

References data(), m_Data, m_Mutex, and rowCount().

101 {
102  if (col) {
103  int nr0 = rowCount(), nr1 = col -> rowCount();
104  int nr = (nr0 < nr1 ? nr0 : nr1);
105 
106  QMutexLocker lock(&m_Mutex);
107 
108  for (int i = 0; i < nr; i++) {
109  m_Data[i] -= col -> data(i);
110  }
111  }
112 }
const double * data() const
Definition: qsecolumn.cpp:62
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46
void QseColumn::subtraction ( const double  val)

Definition at line 167 of file qsecolumn.cpp.

References m_Data, m_Mutex, and rowCount().

168 {
169  int nr = rowCount();
170 
171  QMutexLocker lock(&m_Mutex);
172 
173  for (int i = 0; i < nr; i++) {
174  m_Data[i] -= val;
175  }
176 }
static QMutex m_Mutex
Definition: qsecolumn.h:47
int rowCount() const
Definition: qsecolumn.cpp:48
QVector< double > m_Data
Definition: qsecolumn.h:46

Member Data Documentation

QVector<double> QseColumn::m_Data
private
QMutex QseColumn::m_Mutex
staticprivate
QString QseColumn::m_Name
private

Definition at line 45 of file qsecolumn.h.

Referenced by clear(), and name().


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