Jpp  pmt_effective_area_update
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
JTOOLS::JArray< N, T > Class Template Reference

One dimensional array of template objects with fixed length. More...

#include <JArray.hh>

Inheritance diagram for JTOOLS::JArray< N, T >:
JMATH::JMath< JFirst_t, JSecond_t > JLANG::JEquals< JFirst_t, JSecond_t >

Public Types

typedef const Tconst_pointer
 
typedef Tpointer
 
typedef const Tconst_iterator
 
typedef Titerator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef Treference
 
typedef const Tconst_reference
 
typedef unsigned int size_type
 
typedef JLANG::JClass< T >
::argument_type 
argument_type
 

Public Member Functions

 JArray ()
 Default constructor. More...
 
template<unsigned int M>
 JArray (const JArray< M, T > &array)
 Copy constructor. More...
 
template<unsigned int M>
 JArray (const JArray< M, const T > &array)
 Copy constructor. More...
 
 JArray (const T *p)
 Copy constructor. More...
 
 JArray (const JMultiKey< N, T > &key)
 Copy constructor. More...
 
 JArray (const JMultiKey< N, const T > &key)
 Copy constructor. More...
 
 JArray (const JArray< N-1, T > &array, argument_type value)
 Append constructor. More...
 
 JArray (const JArray< N-1, const T > &array, argument_type value)
 Append constructor. More...
 
 JArray (const JMultiKey< N-1, T > &key, argument_type value)
 Append constructor. More...
 
 JArray (const JMultiKey< N-1, const T > &key, argument_type value)
 Append constructor. More...
 
template<class... Args>
 JArray (argument_type value, const Args &...args)
 Initialise constructor. More...
 
template<class... Args>
JArrayset (const Args &...args)
 Set array. More...
 
const_iterator begin () const
 get iterator to begin of data More...
 
const_iterator end () const
 get iterator to end of data More...
 
iterator begin ()
 get iterator to begin of data More...
 
iterator end ()
 get iterator to end of data More...
 
const_reverse_iterator rbegin () const
 get reverse iterator to begin of data More...
 
const_reverse_iterator rend () const
 get reverse iterator to begin of data More...
 
reverse_iterator rbegin ()
 get reverse iterator to begin of data More...
 
reverse_iterator rend ()
 get reverse iterator to end of data More...
 
const_reference operator[] (int index) const
 Get element at given index. More...
 
reference operator[] (int index)
 Get element at given index. More...
 
const_reference at (int index) const
 Get element at given index. More...
 
reference at (int index)
 Get element at given index. More...
 
const_pointer data () const
 Get pointer to data. More...
 
pointer data ()
 Get pointer to data. More...
 
JArray< N-1, Tpop_front () const
 Make a copy in which the first element is removed. More...
 
JArray< N-1, Tpop_back () const
 Make a copy in which the last element is removed. More...
 
JArraynegate ()
 Negate array. More...
 
JArrayadd (const JArray &array)
 Add array. More...
 
JArraysub (const JArray &array)
 Subtract array. More...
 
JArraymul (const double factor)
 Scale array. More...
 
JArraydiv (const double factor)
 Scale array. More...
 
bool equals (const JArray< N, T > &array) const
 Check equality. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 

Static Public Member Functions

static size_type size ()
 Get size of data. More...
 

Protected Member Functions

template<class... Args>
void __set__ (const int i, const argument_type x, const Args &...args)
 Recursive method for setting array. More...
 
void __set__ (const int i) const
 Termination method for setting array. More...
 
template<unsigned int M>
void assign (const JMultiKey< M, T > &key)
 Recursive method for setting array. More...
 
template<unsigned int M>
void assign (const JMultiKey< M, const T > &key)
 Recursive method for setting array. More...
 
void assign (const JMultiKey< 1, T > &key)
 Termination method for setting array. More...
 
void assign (const JMultiKey< 1, const T > &key)
 Termination method for setting array. More...
 
template<unsigned int M>
void assign (const JMultiKey< M, T > &key, argument_type value)
 Recursive method for setting array. More...
 
template<unsigned int M>
void assign (const JMultiKey< M, const T > &key, argument_type value)
 Recursive method for setting array. More...
 
void assign (const JMultiKey< 1, T > &key, argument_type value)
 Termination method for setting array. More...
 
void assign (const JMultiKey< 1, const T > &key, argument_type value)
 Termination method for setting array. More...
 

Protected Attributes

T buffer [N]
 

Friends

std::istream & operator>> (std::istream &in, JArray &array)
 Read array from input stream. More...
 
std::ostream & operator<< (std::ostream &out, const JArray &array)
 Write array to output stream. More...
 
JReaderoperator>> (JReader &in, JArray &buffer)
 Read array from input. More...
 
JWriteroperator<< (JWriter &out, const JArray &buffer)
 Write array to output. More...
 

Detailed Description

template<unsigned int N, class T>
class JTOOLS::JArray< N, T >

One dimensional array of template objects with fixed length.


The internal data structure consists of a standard C-array.

Definition at line 40 of file JArray.hh.

Member Typedef Documentation

template<unsigned int N, class T>
typedef const T* JTOOLS::JArray< N, T >::const_pointer

Definition at line 46 of file JArray.hh.

template<unsigned int N, class T>
typedef T* JTOOLS::JArray< N, T >::pointer

Definition at line 47 of file JArray.hh.

template<unsigned int N, class T>
typedef const T* JTOOLS::JArray< N, T >::const_iterator

Definition at line 48 of file JArray.hh.

template<unsigned int N, class T>
typedef T* JTOOLS::JArray< N, T >::iterator

Definition at line 49 of file JArray.hh.

template<unsigned int N, class T>
typedef std::reverse_iterator<const_iterator> JTOOLS::JArray< N, T >::const_reverse_iterator

Definition at line 50 of file JArray.hh.

template<unsigned int N, class T>
typedef std::reverse_iterator<iterator> JTOOLS::JArray< N, T >::reverse_iterator

Definition at line 51 of file JArray.hh.

template<unsigned int N, class T>
typedef T& JTOOLS::JArray< N, T >::reference

Definition at line 52 of file JArray.hh.

template<unsigned int N, class T>
typedef const T& JTOOLS::JArray< N, T >::const_reference

Definition at line 53 of file JArray.hh.

template<unsigned int N, class T>
typedef unsigned int JTOOLS::JArray< N, T >::size_type

Definition at line 54 of file JArray.hh.

template<unsigned int N, class T>
typedef JLANG::JClass<T>::argument_type JTOOLS::JArray< N, T >::argument_type

Definition at line 55 of file JArray.hh.

Constructor & Destructor Documentation

template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( )
inline

Default constructor.

Definition at line 61 of file JArray.hh.

62  {}
template<unsigned int N, class T>
template<unsigned int M>
JTOOLS::JArray< N, T >::JArray ( const JArray< M, T > &  array)
inline

Copy constructor.

Parameters
arrayarray

Definition at line 71 of file JArray.hh.

72  {
73  STATIC_CHECK(M >= N);
74 
75  std::copy_n(array.data(), N, this->data());
76  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
#define STATIC_CHECK(expr)
Definition: JAssert.hh:29
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:282
template<unsigned int N, class T>
template<unsigned int M>
JTOOLS::JArray< N, T >::JArray ( const JArray< M, const T > &  array)
inline

Copy constructor.

Parameters
arrayarray

Definition at line 85 of file JArray.hh.

86  {
87  STATIC_CHECK(M >= N);
88 
89  std::copy_n(array.data(), N, this->data());
90  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
#define STATIC_CHECK(expr)
Definition: JAssert.hh:29
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:282
template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( const T p)
inline

Copy constructor.

Parameters
ppointer to data

Definition at line 98 of file JArray.hh.

99  {
100  std::copy_n(p, N, this->data());
101  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:282
template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( const JMultiKey< N, T > &  key)
inline

Copy constructor.

Parameters
keymulti-dimensional key

Definition at line 109 of file JArray.hh.

110  {
111  assign(key);
112  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:532
template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( const JMultiKey< N, const T > &  key)
inline

Copy constructor.

Parameters
keymulti-dimensional key

Definition at line 120 of file JArray.hh.

121  {
122  assign(key);
123  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:532
template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( const JArray< N-1, T > &  array,
argument_type  value 
)
inline

Append constructor.

Parameters
arrayarray
valuevalue

Definition at line 132 of file JArray.hh.

133  {
134  std::copy_n(array.data(), N-1, this->data());
135 
136  this->buffer[N-1] = value;
137  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:282
template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( const JArray< N-1, const T > &  array,
argument_type  value 
)
inline

Append constructor.

Parameters
arrayarray
valuevalue

Definition at line 146 of file JArray.hh.

147  {
148  std::copy_n(array.data(), N-1, this->data());
149 
150  this->buffer[N-1] = value;
151  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:282
template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( const JMultiKey< N-1, T > &  key,
argument_type  value 
)
inline

Append constructor.

Parameters
keymulti-dimensional key
valuevalue

Definition at line 160 of file JArray.hh.

161  {
162  assign(key, value);
163  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:532
template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( const JMultiKey< N-1, const T > &  key,
argument_type  value 
)
inline

Append constructor.

Parameters
keymulti-dimensional key
valuevalue

Definition at line 172 of file JArray.hh.

173  {
174  assign(key, value);
175  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:532
template<unsigned int N, class T>
template<class... Args>
JTOOLS::JArray< N, T >::JArray ( argument_type  value,
const Args &...  args 
)
inline

Initialise constructor.

Parameters
valuefirst value
argsremaining values

Definition at line 185 of file JArray.hh.

186  {
187  set(value, args...);
188  }
JArray & set(const Args &...args)
Set array.
Definition: JArray.hh:197

Member Function Documentation

template<unsigned int N, class T>
template<class... Args>
JArray& JTOOLS::JArray< N, T >::set ( const Args &...  args)
inline

Set array.

Parameters
argsvalues

Definition at line 197 of file JArray.hh.

198  {
199  STATIC_CHECK(N == sizeof...(Args));
200 
201  __set__(0, args...);
202 
203  return *this;
204  }
void __set__(const int i, const argument_type x, const Args &...args)
Recursive method for setting array.
Definition: JArray.hh:509
#define STATIC_CHECK(expr)
Definition: JAssert.hh:29
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
const_iterator JTOOLS::JArray< N, T >::begin ( ) const
inline

get iterator to begin of data

Definition at line 207 of file JArray.hh.

template<unsigned int N, class T>
const_iterator JTOOLS::JArray< N, T >::end ( ) const
inline

get iterator to end of data

Definition at line 208 of file JArray.hh.

template<unsigned int N, class T>
iterator JTOOLS::JArray< N, T >::begin ( )
inline

get iterator to begin of data

Definition at line 211 of file JArray.hh.

template<unsigned int N, class T>
iterator JTOOLS::JArray< N, T >::end ( )
inline

get iterator to end of data

Definition at line 212 of file JArray.hh.

template<unsigned int N, class T>
const_reverse_iterator JTOOLS::JArray< N, T >::rbegin ( ) const
inline

get reverse iterator to begin of data

Definition at line 215 of file JArray.hh.

template<unsigned int N, class T>
const_reverse_iterator JTOOLS::JArray< N, T >::rend ( ) const
inline

get reverse iterator to begin of data

Definition at line 216 of file JArray.hh.

template<unsigned int N, class T>
reverse_iterator JTOOLS::JArray< N, T >::rbegin ( )
inline

get reverse iterator to begin of data

Definition at line 219 of file JArray.hh.

template<unsigned int N, class T>
reverse_iterator JTOOLS::JArray< N, T >::rend ( )
inline

get reverse iterator to end of data

Definition at line 220 of file JArray.hh.

template<unsigned int N, class T>
const_reference JTOOLS::JArray< N, T >::operator[] ( int  index) const
inline

Get element at given index.

Parameters
indexindex
Returns
element

Definition at line 229 of file JArray.hh.

230  {
231  return buffer[index];
232  }
template<unsigned int N, class T>
reference JTOOLS::JArray< N, T >::operator[] ( int  index)
inline

Get element at given index.

Parameters
indexindex
Returns
element

Definition at line 241 of file JArray.hh.

242  {
243  return buffer[index];
244  }
template<unsigned int N, class T>
const_reference JTOOLS::JArray< N, T >::at ( int  index) const
inline

Get element at given index.

Parameters
indexindex
Returns
element at index

Definition at line 253 of file JArray.hh.

254  {
255  if (index >= 0 && index < N)
256  return buffer[index];
257  else
258  throw JIndexOutOfRange("JArray<>::at()");
259  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
reference JTOOLS::JArray< N, T >::at ( int  index)
inline

Get element at given index.

Parameters
indexindex
Returns
element at index

Definition at line 268 of file JArray.hh.

269  {
270  if (index >= 0 && index < N)
271  return buffer[index];
272  else
273  throw JIndexOutOfRange("JArray<>::at()");
274  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
const_pointer JTOOLS::JArray< N, T >::data ( ) const
inline

Get pointer to data.

Returns
pointer to data

Definition at line 282 of file JArray.hh.

283  {
284  return buffer;
285  }
template<unsigned int N, class T>
pointer JTOOLS::JArray< N, T >::data ( )
inline

Get pointer to data.

Returns
pointer to data

Definition at line 293 of file JArray.hh.

294  {
295  return buffer;
296  }
template<unsigned int N, class T>
static size_type JTOOLS::JArray< N, T >::size ( )
inlinestatic

Get size of data.

Returns
size of data

Definition at line 304 of file JArray.hh.

305  {
306  return N;
307  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
JArray<N-1, T> JTOOLS::JArray< N, T >::pop_front ( ) const
inline

Make a copy in which the first element is removed.

Returns
array

Definition at line 315 of file JArray.hh.

316  {
317  return JArray<N-1, T>(&buffer[1]);
318  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
One dimensional array of template objects with fixed length.
Definition: JArray.hh:40
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
JArray<N-1, T> JTOOLS::JArray< N, T >::pop_back ( ) const
inline

Make a copy in which the last element is removed.

Returns
array

Definition at line 326 of file JArray.hh.

327  {
328  return JArray<N-1, T>(buffer);
329  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
One dimensional array of template objects with fixed length.
Definition: JArray.hh:40
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
JArray& JTOOLS::JArray< N, T >::negate ( )
inline

Negate array.

Returns
this array

Definition at line 337 of file JArray.hh.

338  {
339  for (int i = 0; i != N; ++i) {
340  buffer[i] = -buffer[i];
341  }
342 
343  return *this;
344  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
JArray& JTOOLS::JArray< N, T >::add ( const JArray< N, T > &  array)
inline

Add array.

Parameters
arrayarray
Returns
this array

Definition at line 353 of file JArray.hh.

354  {
355  for (int i = 0; i != N; ++i) {
356  buffer[i] += array[i];
357  }
358 
359  return *this;
360  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
JArray& JTOOLS::JArray< N, T >::sub ( const JArray< N, T > &  array)
inline

Subtract array.

Parameters
arrayarray
Returns
this array

Definition at line 369 of file JArray.hh.

370  {
371  for (int i = 0; i != N; ++i) {
372  buffer[i] -= array[i];
373  }
374 
375  return *this;
376  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
JArray& JTOOLS::JArray< N, T >::mul ( const double  factor)
inline

Scale array.

Parameters
factormultiplication factor
Returns
this array

Definition at line 385 of file JArray.hh.

386  {
387  for (int i = 0; i != N; ++i) {
388  buffer[i] *= factor;
389  }
390 
391  return *this;
392  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
JArray& JTOOLS::JArray< N, T >::div ( const double  factor)
inline

Scale array.

Parameters
factordivision factor
Returns
this array

Definition at line 401 of file JArray.hh.

402  {
403  for (int i = 0; i != N; ++i) {
404  buffer[i] /= factor;
405  }
406 
407  return *this;
408  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
bool JTOOLS::JArray< N, T >::equals ( const JArray< N, T > &  array) const
inline

Check equality.

Parameters
arrayarray
Returns
true if arrays are equal; else false

Definition at line 417 of file JArray.hh.

418  {
419  for (int i = 0; i != N; ++i) {
420  if (buffer[i] != array[i]) {
421  return false;
422  }
423  }
424 
425  return true;
426  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
template<class... Args>
void JTOOLS::JArray< N, T >::__set__ ( const int  i,
const argument_type  x,
const Args &...  args 
)
inlineprotected

Recursive method for setting array.

Parameters
iindex
xvalue at given index
argsremaining values

Definition at line 509 of file JArray.hh.

510  {
511  this->buffer[i] = x;
512 
513  __set__(i + 1, args...);
514  }
void __set__(const int i, const argument_type x, const Args &...args)
Recursive method for setting array.
Definition: JArray.hh:509
template<unsigned int N, class T>
void JTOOLS::JArray< N, T >::__set__ ( const int  i) const
inlineprotected

Termination method for setting array.

Parameters
iindex

Definition at line 522 of file JArray.hh.

523  {}
template<unsigned int N, class T>
template<unsigned int M>
void JTOOLS::JArray< N, T >::assign ( const JMultiKey< M, T > &  key)
inlineprotected

Recursive method for setting array.

Parameters
keymulti-dimensional key

Definition at line 532 of file JArray.hh.

533  {
534  buffer[N-M] = key.first;
535 
536  assign(key.second);
537  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:532
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
template<unsigned int M>
void JTOOLS::JArray< N, T >::assign ( const JMultiKey< M, const T > &  key)
inlineprotected

Recursive method for setting array.

Parameters
keymulti-dimensional key

Definition at line 546 of file JArray.hh.

547  {
548  buffer[N-M] = key.first;
549 
550  assign(key.second);
551  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:532
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
void JTOOLS::JArray< N, T >::assign ( const JMultiKey< 1, T > &  key)
inlineprotected

Termination method for setting array.

Parameters
keyone-dimensional key

Definition at line 559 of file JArray.hh.

560  {
561  buffer[N-1] = key.first;
562  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
void JTOOLS::JArray< N, T >::assign ( const JMultiKey< 1, const T > &  key)
inlineprotected

Termination method for setting array.

Parameters
keyone-dimensional key

Definition at line 570 of file JArray.hh.

571  {
572  buffer[N-1] = key.first;
573  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
template<unsigned int M>
void JTOOLS::JArray< N, T >::assign ( const JMultiKey< M, T > &  key,
argument_type  value 
)
inlineprotected

Recursive method for setting array.

Parameters
keymulti-dimensional key
valuevalue

Definition at line 583 of file JArray.hh.

584  {
585  buffer[N-M-1] = key.first;
586 
587  assign(key.second, value);
588  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:532
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
template<unsigned int M>
void JTOOLS::JArray< N, T >::assign ( const JMultiKey< M, const T > &  key,
argument_type  value 
)
inlineprotected

Recursive method for setting array.

Parameters
keymulti-dimensional key
valuevalue

Definition at line 598 of file JArray.hh.

599  {
600  buffer[N-M-1] = key.first;
601 
602  assign(key.second, value);
603  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:532
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
void JTOOLS::JArray< N, T >::assign ( const JMultiKey< 1, T > &  key,
argument_type  value 
)
inlineprotected

Termination method for setting array.

Parameters
keyone-dimensional key
valuevalue

Definition at line 612 of file JArray.hh.

613  {
614  buffer[N-2] = key.first;
615  buffer[N-1] = value;
616  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<unsigned int N, class T>
void JTOOLS::JArray< N, T >::assign ( const JMultiKey< 1, const T > &  key,
argument_type  value 
)
inlineprotected

Termination method for setting array.

Parameters
keyone-dimensional key
valuevalue

Definition at line 625 of file JArray.hh.

626  {
627  buffer[N-2] = key.first;
628  buffer[N-1] = value;
629  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18

Friends And Related Function Documentation

template<unsigned int N, class T>
std::istream& operator>> ( std::istream &  in,
JArray< N, T > &  array 
)
friend

Read array from input stream.

Parameters
ininput stream
arrayarray
Returns
input stream

Definition at line 436 of file JArray.hh.

437  {
438  for (iterator i = array.begin(); i != array.end(); ++i) {
439  in >> *i;
440  }
441 
442  return in;
443  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:207
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:208
T * iterator
Definition: JArray.hh:49
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:40
template<unsigned int N, class T>
std::ostream& operator<< ( std::ostream &  out,
const JArray< N, T > &  array 
)
friend

Write array to output stream.

Parameters
outoutput stream
arrayarray
Returns
output stream

Definition at line 453 of file JArray.hh.

454  {
455  for (const_iterator i = array.begin(); i != array.end(); ++i) {
456  out << ' ' << SCIENTIFIC(12,5) << *i;
457  }
458 
459  return out;
460  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:207
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:208
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:484
const T * const_iterator
Definition: JArray.hh:48
template<unsigned int N, class T>
JReader& operator>> ( JReader in,
JArray< N, T > &  buffer 
)
friend

Read array from input.

Parameters
inreader
bufferarray
Returns
reader

Definition at line 470 of file JArray.hh.

471  {
472  for (iterator i = buffer.begin(); i != buffer.end(); ++i) {
473  in >> *i;
474  }
475 
476  return in;
477  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:207
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:208
T * iterator
Definition: JArray.hh:49
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:40
template<unsigned int N, class T>
JWriter& operator<< ( JWriter out,
const JArray< N, T > &  buffer 
)
friend

Write array to output.

Parameters
outwriter
bufferarray
Returns
writer

Definition at line 487 of file JArray.hh.

488  {
489  for (const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
490  out << *i;
491  }
492 
493  return out;
494  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:207
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:208
const T * const_iterator
Definition: JArray.hh:48

Member Data Documentation

template<unsigned int N, class T>
T JTOOLS::JArray< N, T >::buffer[N]
protected

Definition at line 498 of file JArray.hh.


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