CMS 3D CMS Logo

List of all members | Public Member Functions
hitfit::Row_Vector Class Reference

Row-vector class. CLHEP doesn't have a row-vector class, so HitFit uses its own. This is only a simple wrapper around Matrix that tries to constrain the shape to a row vector. It will raise an assertion if you try to assign to it something that isn't a row vector. More...

#include <matutil.h>

Inheritance diagram for hitfit::Row_Vector:

Public Member Functions

const double & operator() (int col) const
 Direct element access, indexing starts from 1. More...
 
double & operator() (int col)
 Direct element access, indexing starts from 1. More...
 
const double & operator() (int row, int col) const override
 Direct element access, indexing starts from (1,1). More...
 
double & operator() (int row, int col) override
 Direct element access, indexing starts from (1,1). More...
 
Row_Vectoroperator= (const Matrix &m)
 Assignment operator, will raise an assertion if m doesn't have exactly one row. More...
 
 Row_Vector (int cols)
 Constructor, instantiate an unitialized $1 \times \mathrm{cols}$ matrix. More...
 
 Row_Vector (int cols, int init)
 Constructor, instantiate an unitialized $1 \times \mathrm{cols}$ matrix, and initialized it to zero. More...
 
 Row_Vector (const Matrix &m)
 Copy constructor, will raise an assertion if m doesn't have exactly one row. More...
 

Detailed Description

Row-vector class. CLHEP doesn't have a row-vector class, so HitFit uses its own. This is only a simple wrapper around Matrix that tries to constrain the shape to a row vector. It will raise an assertion if you try to assign to it something that isn't a row vector.

Definition at line 79 of file matutil.h.

Constructor & Destructor Documentation

◆ Row_Vector() [1/3]

hitfit::Row_Vector::Row_Vector ( int  cols)
explicit

Constructor, instantiate an unitialized $1 \times \mathrm{cols}$ matrix.

Parameters
colsThe number of columns (the length of the vector).

Definition at line 41 of file matutil.cc.

49  : Matrix(1, cols) {}
CLHEP::HepMatrix Matrix
Definition: matutil.h:62

◆ Row_Vector() [2/3]

hitfit::Row_Vector::Row_Vector ( int  cols,
int  init 
)
explicit

Constructor, instantiate an unitialized $1 \times \mathrm{cols}$ matrix, and initialized it to zero.

Parameters
colsThe number of columns (the length of the vector).
initA dummy argument, should always be zero.

Definition at line 51 of file matutil.cc.

60  : Matrix(1, cols, 0) {}
CLHEP::HepMatrix Matrix
Definition: matutil.h:62

◆ Row_Vector() [3/3]

hitfit::Row_Vector::Row_Vector ( const Matrix m)

Copy constructor, will raise an assertion if m doesn't have exactly one row.

Parameters
mThe matrix to copy, must have exactly one row.

Definition at line 62 of file matutil.cc.

References cms::cuda::assert(), and visualization-live-secondInstance_cfg::m.

71  : Matrix(m) {
72  assert(m.num_row() == 1);
73  }
assert(be >=bs)
CLHEP::HepMatrix Matrix
Definition: matutil.h:62

Member Function Documentation

◆ operator()() [1/4]

const double & hitfit::Row_Vector::operator() ( int  col) const

Direct element access, indexing starts from 1.

Parameters
colThe column to access.

Definition at line 75 of file matutil.cc.

References cuy::col.

85  {
86  return HepMatrix::operator()(1, col);
87  }
col
Definition: cuy.py:1009

◆ operator()() [2/4]

double & hitfit::Row_Vector::operator() ( int  col)

Direct element access, indexing starts from 1.

Parameters
colThe column to access.

Definition at line 89 of file matutil.cc.

References cuy::col.

99  {
100  return HepMatrix::operator()(1, col);
101  }
col
Definition: cuy.py:1009

◆ operator()() [3/4]

const double & hitfit::Row_Vector::operator() ( int  row,
int  col 
) const
override

Direct element access, indexing starts from (1,1).

Parameters
rowThe row to access.
colThe column to access.

Definition at line 103 of file matutil.cc.

References cuy::col.

114  {
115  return HepMatrix::operator()(row, col);
116  }
col
Definition: cuy.py:1009

◆ operator()() [4/4]

double & hitfit::Row_Vector::operator() ( int  row,
int  col 
)
override

Direct element access, indexing starts from (1,1).

Parameters
rowThe row to access.
colThe column to access.

Definition at line 118 of file matutil.cc.

References cuy::col.

129  {
130  return HepMatrix::operator()(row, col);
131  }
col
Definition: cuy.py:1009

◆ operator=()

Row_Vector & hitfit::Row_Vector::operator= ( const Matrix m)

Assignment operator, will raise an assertion if m doesn't have exactly one row.

Parameters
mThe matrix to copy, must have exactly one row.

Definition at line 133 of file matutil.cc.

References cms::cuda::assert(), and visualization-live-secondInstance_cfg::m.

145  {
146  assert(m.num_row() == 1);
147  *((Matrix*)this) = m;
148  return *this;
149  }
assert(be >=bs)
CLHEP::HepMatrix Matrix
Definition: matutil.h:62