Jpp  18.0.1-rc.1
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...
 
void fill (argument_type value)
 Fill array. 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  {
63  fill(T());
64  }
void fill(argument_type value)
Fill array.
Definition: JArray.hh:339
do set_variable OUTPUT_DIRECTORY $WORKDIR T
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 73 of file JArray.hh.

74  {
75  STATIC_CHECK(M >= N);
76 
77  std::copy_n(array.data(), N, this->data());
78  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
#define STATIC_CHECK(expr)
Definition: JAssert.hh:31
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:284
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 87 of file JArray.hh.

88  {
89  STATIC_CHECK(M >= N);
90 
91  std::copy_n(array.data(), N, this->data());
92  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
#define STATIC_CHECK(expr)
Definition: JAssert.hh:31
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:284
template<unsigned int N, class T>
JTOOLS::JArray< N, T >::JArray ( const T p)
inline

Copy constructor.

Parameters
ppointer to data

Definition at line 100 of file JArray.hh.

101  {
102  std::copy_n(p, N, this->data());
103  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:284
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 111 of file JArray.hh.

112  {
113  assign(key);
114  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:547
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 122 of file JArray.hh.

123  {
124  assign(key);
125  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:547
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 134 of file JArray.hh.

135  {
136  std::copy_n(array.data(), N-1, this->data());
137 
138  this->buffer[N-1] = value;
139  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:284
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 148 of file JArray.hh.

149  {
150  std::copy_n(array.data(), N-1, this->data());
151 
152  this->buffer[N-1] = value;
153  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:284
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 162 of file JArray.hh.

163  {
164  assign(key, value);
165  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:547
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 174 of file JArray.hh.

175  {
176  assign(key, value);
177  }
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:547
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 187 of file JArray.hh.

188  {
189  set(value, args...);
190  }
JArray & set(const Args &...args)
Set array.
Definition: JArray.hh:199

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

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

get iterator to begin of data

Definition at line 209 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 210 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 213 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 214 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 217 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 218 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 221 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 222 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 231 of file JArray.hh.

232  {
233  return buffer[index];
234  }
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 243 of file JArray.hh.

244  {
245  return buffer[index];
246  }
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 255 of file JArray.hh.

256  {
257  if (index >= 0 && index < N)
258  return buffer[index];
259  else
260  THROW(JIndexOutOfRange, "invalid index " << 0 << " <= " << index << " < " << N);
261  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 270 of file JArray.hh.

271  {
272  if (index >= 0 && index < N)
273  return buffer[index];
274  else
275  THROW(JIndexOutOfRange, "invalid index " << 0 << " <= " << index << " < " << N);
276  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 284 of file JArray.hh.

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

Get pointer to data.

Returns
pointer to data

Definition at line 295 of file JArray.hh.

296  {
297  return buffer;
298  }
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 306 of file JArray.hh.

307  {
308  return N;
309  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 317 of file JArray.hh.

318  {
319  return JArray<N-1, T>(&buffer[1]);
320  }
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 >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 328 of file JArray.hh.

329  {
330  return JArray<N-1, T>(buffer);
331  }
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 >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
template<unsigned int N, class T>
void JTOOLS::JArray< N, T >::fill ( argument_type  value)
inline

Fill array.

Parameters
valuevalue

Definition at line 339 of file JArray.hh.

340  {
341  for (int i = 0; i != N; ++i) {
342  buffer[i] = value;
343  }
344  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
template<unsigned int N, class T>
JArray& JTOOLS::JArray< N, T >::negate ( )
inline

Negate array.

Returns
this array

Definition at line 352 of file JArray.hh.

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

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

385  {
386  for (int i = 0; i != N; ++i) {
387  buffer[i] -= array[i];
388  }
389 
390  return *this;
391  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 400 of file JArray.hh.

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

417  {
418  for (int i = 0; i != N; ++i) {
419  buffer[i] /= factor;
420  }
421 
422  return *this;
423  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 432 of file JArray.hh.

433  {
434  for (int i = 0; i != N; ++i) {
435  if (buffer[i] != array[i]) {
436  return false;
437  }
438  }
439 
440  return true;
441  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 524 of file JArray.hh.

525  {
526  this->buffer[i] = x;
527 
528  __set__(i + 1, args...);
529  }
void __set__(const int i, const argument_type x, const Args &...args)
Recursive method for setting array.
Definition: JArray.hh:524
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 537 of file JArray.hh.

538  {}
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 547 of file JArray.hh.

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

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

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

586  {
587  buffer[N-1] = key.first;
588  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 598 of file JArray.hh.

599  {
600  buffer[N-M-1] = key.first;
601 
602  assign(key.second, value);
603  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:547
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 613 of file JArray.hh.

614  {
615  buffer[N-M-1] = key.first;
616 
617  assign(key.second, value);
618  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
void assign(const JMultiKey< M, T > &key)
Recursive method for setting array.
Definition: JArray.hh:547
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 627 of file JArray.hh.

628  {
629  buffer[N-2] = key.first;
630  buffer[N-1] = value;
631  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 640 of file JArray.hh.

641  {
642  buffer[N-2] = key.first;
643  buffer[N-1] = value;
644  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
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 354 of file JMath.hh.

355  {
356  return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357  }

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

452  {
453  for (iterator i = array.begin(); i != array.end(); ++i) {
454  in >> *i;
455  }
456 
457  return in;
458  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:209
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:210
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
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 468 of file JArray.hh.

469  {
470  for (const_iterator i = array.begin(); i != array.end(); ++i) {
471  out << ' ' << SCIENTIFIC(12,5) << *i;
472  }
473 
474  return out;
475  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:209
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:210
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 485 of file JArray.hh.

486  {
487  for (iterator i = buffer.begin(); i != buffer.end(); ++i) {
488  in >> *i;
489  }
490 
491  return in;
492  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:209
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:210
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
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 502 of file JArray.hh.

503  {
504  for (const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
505  out << *i;
506  }
507 
508  return out;
509  }
const_iterator begin() const
get iterator to begin of data
Definition: JArray.hh:209
const_iterator end() const
get iterator to end of data
Definition: JArray.hh:210
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 513 of file JArray.hh.


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