Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
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 T * const_pointer
 
typedef T * pointer
 
typedef const T * const_iterator
 
typedef T * iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef T & reference
 
typedef const T & const_reference
 
typedef unsigned int size_type
 
typedef JLANG::JClass< T >::argument_type argument_type
 

Public Member Functions

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

Static Public Member Functions

static size_type size ()
 Get size of data.
 

Protected Member Functions

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

Protected Attributes

buffer [N]
 

Friends

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

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

◆ const_pointer

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

Definition at line 46 of file JArray.hh.

◆ pointer

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

Definition at line 47 of file JArray.hh.

◆ const_iterator

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

Definition at line 48 of file JArray.hh.

◆ iterator

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

Definition at line 49 of file JArray.hh.

◆ const_reverse_iterator

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

Definition at line 50 of file JArray.hh.

◆ reverse_iterator

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

Definition at line 51 of file JArray.hh.

◆ reference

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

Definition at line 52 of file JArray.hh.

◆ const_reference

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

Definition at line 53 of file JArray.hh.

◆ size_type

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

Definition at line 54 of file JArray.hh.

◆ argument_type

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

Definition at line 55 of file JArray.hh.

Constructor & Destructor Documentation

◆ JArray() [1/11]

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

◆ JArray() [2/11]

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 }
#define STATIC_CHECK(expr)
Definition JAssert.hh:31

◆ JArray() [3/11]

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 }

◆ JArray() [4/11]

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 }
const_pointer data() const
Get pointer to data.
Definition JArray.hh:284

◆ JArray() [5/11]

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

◆ JArray() [6/11]

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 }

◆ JArray() [7/11]

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 }

◆ JArray() [8/11]

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 }

◆ JArray() [9/11]

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 }

◆ JArray() [10/11]

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 }

◆ JArray() [11/11]

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

◆ set()

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

◆ begin() [1/2]

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.

◆ end() [1/2]

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.

◆ begin() [2/2]

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.

◆ end() [2/2]

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.

◆ rbegin() [1/2]

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.

◆ rend() [1/2]

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.

◆ rbegin() [2/2]

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.

◆ rend() [2/2]

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.

◆ operator[]() [1/2]

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 }

◆ operator[]() [2/2]

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 }

◆ at() [1/2]

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.

◆ at() [2/2]

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 }

◆ data() [1/2]

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 }

◆ data() [2/2]

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 }

◆ size()

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 }

◆ pop_front()

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 }
JArray()
Default constructor.
Definition JArray.hh:61

◆ pop_back()

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 }

◆ fill()

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 }

◆ negate()

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 }

◆ add()

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 }

◆ sub()

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 }

◆ mul() [1/2]

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 }

◆ div()

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 }

◆ equals()

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 }

◆ __set__() [1/2]

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 }

◆ __set__() [2/2]

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 {}

◆ assign() [1/8]

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 }

◆ assign() [2/8]

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 }

◆ assign() [3/8]

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 }

◆ assign() [4/8]

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 }

◆ assign() [5/8]

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 }

◆ assign() [6/8]

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 }

◆ assign() [7/8]

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 }

◆ assign() [8/8]

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 }

◆ mul() [2/2]

template<class JFirst_t , class JSecond_t >
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 Symbol Documentation

◆ operator>> [1/2]

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 }

◆ operator<< [1/2]

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 T * const_iterator
Definition JArray.hh:48
Auxiliary data structure for floating point format specification.
Definition JManip.hh:488

◆ operator>> [2/2]

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 }

◆ operator<< [2/2]

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 }

Member Data Documentation

◆ buffer

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: