2021-10-09 15:16:34 -05:00
|
|
|
/*****************************************************************************
|
|
|
|
|
|
|
|
Array.hpp
|
|
|
|
By Laurent de Soras
|
|
|
|
|
|
|
|
--- Legal stuff ---
|
|
|
|
|
|
|
|
This program is free software. It comes without any warranty, to
|
|
|
|
the extent permitted by applicable law. You can redistribute it
|
|
|
|
and/or modify it under the terms of the Do What The Fuck You Want
|
|
|
|
To Public License, Version 2, as published by Sam Hocevar. See
|
|
|
|
http://sam.zoy.org/wtfpl/COPYING for more details.
|
|
|
|
|
|
|
|
*Tab=3***********************************************************************/
|
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
#if defined(ffft_Array_CURRENT_CODEHEADER)
|
|
|
|
# error Recursive inclusion of Array code header.
|
2021-10-09 15:16:34 -05:00
|
|
|
#endif
|
2024-05-05 00:20:10 -05:00
|
|
|
#define ffft_Array_CURRENT_CODEHEADER
|
2021-10-09 15:16:34 -05:00
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
#if !defined(ffft_Array_CODEHEADER_INCLUDED)
|
|
|
|
# define ffft_Array_CODEHEADER_INCLUDED
|
2021-10-09 15:16:34 -05:00
|
|
|
|
|
|
|
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
|
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
# include <cassert>
|
2021-10-09 15:16:34 -05:00
|
|
|
|
|
|
|
namespace ffft
|
|
|
|
{
|
|
|
|
|
|
|
|
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
|
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
template<class T, long LEN>
|
|
|
|
Array<T, LEN>::Array()
|
2021-10-09 15:16:34 -05:00
|
|
|
{
|
2024-05-05 00:20:10 -05:00
|
|
|
// Nothing
|
2021-10-09 15:16:34 -05:00
|
|
|
}
|
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
template<class T, long LEN>
|
|
|
|
const typename Array<T, LEN>::DataType &
|
|
|
|
Array<T, LEN>::operator[](long pos) const
|
2021-10-09 15:16:34 -05:00
|
|
|
{
|
2024-05-05 00:20:10 -05:00
|
|
|
assert(pos >= 0);
|
|
|
|
assert(pos < LEN);
|
2021-10-09 15:16:34 -05:00
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
return (_data_arr[pos]);
|
2021-10-09 15:16:34 -05:00
|
|
|
}
|
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
template<class T, long LEN>
|
|
|
|
typename Array<T, LEN>::DataType &Array<T, LEN>::operator[](long pos)
|
2021-10-09 15:16:34 -05:00
|
|
|
{
|
2024-05-05 00:20:10 -05:00
|
|
|
assert(pos >= 0);
|
|
|
|
assert(pos < LEN);
|
2021-10-09 15:16:34 -05:00
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
return (_data_arr[pos]);
|
2021-10-09 15:16:34 -05:00
|
|
|
}
|
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
template<class T, long LEN>
|
|
|
|
long Array<T, LEN>::size()
|
2021-10-09 15:16:34 -05:00
|
|
|
{
|
2024-05-05 00:20:10 -05:00
|
|
|
return (LEN);
|
2021-10-09 15:16:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
|
|
|
|
|
|
|
|
/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
|
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
} // namespace ffft
|
2021-10-09 15:16:34 -05:00
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
#endif // ffft_Array_CODEHEADER_INCLUDED
|
2021-10-09 15:16:34 -05:00
|
|
|
|
|
|
|
#undef ffft_Array_CURRENT_CODEHEADER
|
|
|
|
|
|
|
|
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
|