43 template <
typename TValue>
57 template <
typename TValue>
61 (
unsigned int s,
int z,
bool p,
const Value & def )
63 if ( data != 0 )
delete[] data;
64 size = s; zero = z; periodic = p;
65 data =
new TValue[ size + 1 ];
78 template <
typename TValue>
82 (
const Value* t,
unsigned int s,
int z,
bool p,
const Value& def )
84 if ( data != 0 )
delete[] data;
85 size = s; zero = z; periodic = p;
86 data =
new TValue[ size + 1 ];
87 for (
unsigned int i = 0; i < size; ++i, ++t )
101 template <
typename TValue>
104 (
unsigned int s,
int z,
bool p,
const Value & def )
105 : size( s ), zero( z ), periodic( p )
107 data =
new TValue[ size + 1 ];
120 template <
typename TValue>
123 (
const TValue* t,
unsigned int s,
int z,
bool p,
const Value & def )
124 : size( s ), zero( z ), periodic( p )
126 data =
new TValue[ size + 1 ];
127 for (
unsigned int i = 0; i < size; ++i )
136 template <
typename TValue>
140 if ( data != 0 )
delete[] data;
147 template <
typename TValue>
153 if ( other.
data != 0 )
155 data =
new TValue[ size + 1 ];
156 for (
unsigned int i = 0; i <= size; ++i )
157 data[ i ] = other.
data[ i ];
168 template <
typename TValue>
174 if (
this != &other )
176 if ( other.
data == 0 )
184 if ( size < other.
size )
187 data =
new TValue[ other.
size + 1 ];
192 for (
unsigned int i = 0; i <= size; ++i )
193 data[ i ] = other.
data[ i ];
204 template <
typename TValue>
229 template <
typename TValue>
243 template <
typename TValue>
246 (
unsigned int asize,
int z,
bool periodic,
const TValue & def )
249 m_data->
init( asize, z, periodic, def );
261 template <
typename TValue>
264 (
const TValue* t,
unsigned int asize,
int z,
bool periodic,
268 m_data->
init( t, asize, z, periodic, def );
276 template <
typename TValue>
287 template <
typename TValue>
290 : m_data( other.m_data )
300 template <
typename TValue>
305 if (
this != & other )
319 template <
typename TValue>
323 (
unsigned int aSize,
int z,
bool periodic,
const TValue & def )
326 m_data->init( aSize, z, periodic, def );
338 template <
typename TValue>
342 (
const TValue* t,
unsigned int aSize,
int z,
bool periodic,
346 m_data->init( t, aSize, z, periodic, def );
354 template <
typename TValue>
374 template <
typename TValue>
379 int idx = i + sd.
zero;
380 if ( ( idx >= 0 ) && ( idx < (
int) sd.
size ) )
381 return sd.
data[ idx ];
384 idx = idx - ( idx / (int) sd.
size ) * sd.
size;
399 template <
typename TValue>
404 int idx = i + sd.
zero;
405 if ( ( idx >= 0 ) && ( idx < (
int) sd.
size ) )
406 return sd.
data[ idx ];
409 idx = idx - ( idx / (int) sd.
size ) * sd.
size;
422 template <
typename TValue>
427 for (
unsigned int i = 0; i <= sd.
size; ++i )
439 template <
typename TValue>
444 for (
unsigned int i = 0; i <= sd.
size; ++i )
457 template <
typename TValue>
472 for (
int a = 0; a < (int) FGd.
size; ++a )
474 TValue sum = TValue( 0 );
475 for (
unsigned int i = 0; i < Gd.
size; ++i )
477 sum += this->operator[]( a - ( i - Gd.
zero ) )
485 for (
unsigned int a = 0; a < FGd.
size; ++a )
487 TValue sum = TValue( 0 );
488 for (
unsigned int i = 0; i < Gd.
size; ++i )
490 sum += this->operator[]( a - ( Fd.
zero + Gd.
zero )
502 template <
typename TValue>
514 template <
typename TValue>
528 template <
typename TValue>
538 template <
typename TValue>
542 if ( n <= 1 )
return G2();
543 else return G2n( n - 1 ) * G2();
549 template <
typename TValue>
553 if ( n <= 1 )
return H2();
554 else return H2n( n - 1 ) * H2();
560 template <
typename TValue>
564 return H2n( n ) * Delta();
575 template <
typename TValue>
580 out <<
"[Signal" << std::fixed << std::setprecision( 5 );
581 for (
unsigned int i = 0; i < size(); ++i )
582 out <<
" " << ( ( i == (
unsigned int) m_data->zero ) ?
"*" :
"" )
583 << m_data->data[ i ];
591 template <
typename TValue>
604 template <
typename TValue>
610 object.selfDisplay( out );