Jpp
 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 (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

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 37 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 43 of file JArray.hh.

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

Definition at line 44 of file JArray.hh.

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

Definition at line 45 of file JArray.hh.

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

Definition at line 46 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 47 of file JArray.hh.

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

Definition at line 48 of file JArray.hh.

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

Definition at line 49 of file JArray.hh.

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

Definition at line 50 of file JArray.hh.

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

Definition at line 51 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 52 of file JArray.hh.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 58 of file JArray.hh.

59  {}
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 68 of file JArray.hh.

69  {
70  STATIC_CHECK(M >= N);
71 
72  std::copy_n(array.data(), N, this->data());
73  }
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:37
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:278
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 82 of file JArray.hh.

83  {
84  STATIC_CHECK(M >= N);
85 
86  std::copy_n(array.data(), N, this->data());
87  }
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:37
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:278
template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( const T p)
inline

Copy constructor.

Parameters
ppointer to data

Definition at line 95 of file JArray.hh.

96  {
97  std::copy_n(p, N, this->data());
98  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:278
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 106 of file JArray.hh.

107  {
108  assign(key);
109  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:494
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 117 of file JArray.hh.

118  {
119  assign(key);
120  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:494
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 129 of file JArray.hh.

130  {
131  std::copy_n(array.data(), N-1, this->data());
132 
133  this->buffer[N-1] = value;
134  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:278
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 143 of file JArray.hh.

144  {
145  std::copy_n(array.data(), N-1, this->data());
146 
147  this->buffer[N-1] = value;
148  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:278
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 157 of file JArray.hh.

158  {
159  assign(key, value);
160  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:494
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 169 of file JArray.hh.

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

Initialise constructor.

Parameters
argsvalues

Definition at line 181 of file JArray.hh.

182  {
183  set(args...);
184  }
JArray & set(const Args &...args)
Set array.
Definition: JArray.hh:193

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 193 of file JArray.hh.

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

get iterator to begin of data

Definition at line 203 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 204 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 207 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 208 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 211 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 212 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 215 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 216 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 225 of file JArray.hh.

226  {
227  return buffer[index];
228  }
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 237 of file JArray.hh.

238  {
239  return buffer[index];
240  }
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 249 of file JArray.hh.

250  {
251  if (index >= 0 && index < N)
252  return buffer[index];
253  else
254  throw JIndexOutOfRange("JArray<>::at()");
255  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 264 of file JArray.hh.

265  {
266  if (index >= 0 && index < N)
267  return buffer[index];
268  else
269  throw JIndexOutOfRange("JArray<>::at()");
270  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 278 of file JArray.hh.

279  {
280  return buffer;
281  }
template<unsigned int N, class T>
pointer JTOOLS::JArray< N, T >::data ( )
inline

Get pointer to data.

Returns
pointer to data

Definition at line 289 of file JArray.hh.

290  {
291  return buffer;
292  }
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 300 of file JArray.hh.

301  {
302  return N;
303  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 311 of file JArray.hh.

312  {
313  return JArray<N-1, T>(&buffer[1]);
314  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
One dimensional array of template objects with fixed length.
Definition: JArray.hh:37
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 322 of file JArray.hh.

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

Negate array.

Returns
this array

Definition at line 333 of file JArray.hh.

334  {
335  for (int i = 0; i != N; ++i) {
336  buffer[i] = -buffer[i];
337  }
338 
339  return *this;
340  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 349 of file JArray.hh.

350  {
351  for (int i = 0; i != N; ++i) {
352  buffer[i] += array[i];
353  }
354 
355  return *this;
356  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 365 of file JArray.hh.

366  {
367  for (int i = 0; i != N; ++i) {
368  buffer[i] -= array[i];
369  }
370 
371  return *this;
372  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 381 of file JArray.hh.

382  {
383  for (int i = 0; i != N; ++i) {
384  buffer[i] *= factor;
385  }
386 
387  return *this;
388  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 397 of file JArray.hh.

398  {
399  for (int i = 0; i != N; ++i) {
400  buffer[i] /= factor;
401  }
402 
403  return *this;
404  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 413 of file JArray.hh.

414  {
415  for (int i = 0; i != N; ++i) {
416  if (buffer[i] != array[i]) {
417  return false;
418  }
419  }
420 
421  return true;
422  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 471 of file JArray.hh.

472  {
473  this->buffer[i] = x;
474 
475  __set__(i + 1, args...);
476  }
void __set__(const int i, const argument_type x, const Args &...args)
Recursive method for setting array.
Definition: JArray.hh:471
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 484 of file JArray.hh.

485  {}
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 494 of file JArray.hh.

495  {
496  buffer[N-M] = key.first;
497 
498  assign(key.second);
499  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:494
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 508 of file JArray.hh.

509  {
510  buffer[N-M] = key.first;
511 
512  assign(key.second);
513  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:494
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 521 of file JArray.hh.

522  {
523  buffer[N-1] = key.first;
524  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 532 of file JArray.hh.

533  {
534  buffer[N-1] = key.first;
535  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 545 of file JArray.hh.

546  {
547  buffer[N-M-1] = key.first;
548 
549  assign(key.second, value);
550  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:494
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 560 of file JArray.hh.

561  {
562  buffer[N-M-1] = key.first;
563 
564  assign(key.second, value);
565  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:494
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 574 of file JArray.hh.

575  {
576  buffer[N-2] = key.first;
577  buffer[N-1] = value;
578  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 587 of file JArray.hh.

588  {
589  buffer[N-2] = key.first;
590  buffer[N-1] = value;
591  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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>
JReader& operator>> ( JReader in,
JArray< N, T > &  buffer 
)
friend

Read array from input.

Parameters
inreader
bufferarray
Returns
reader

Definition at line 432 of file JArray.hh.

433  {
434  for (iterator i = buffer.begin(); i != buffer.end(); ++i) {
435  in >> *i;
436  }
437 
438  return in;
439  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:203
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:204
T * iterator
Definition: JArray.hh:46
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 typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:36
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 449 of file JArray.hh.

450  {
451  for (const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
452  out << *i;
453  }
454 
455  return out;
456  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:203
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:204
const T * const_iterator
Definition: JArray.hh:45

Member Data Documentation

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

Definition at line 460 of file JArray.hh.


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