42 template <
typename TConstIteratorOnPo
ints,
typename TValue>
48 template <
typename TConstIteratorOnPo
ints,
typename TValue>
56 template <
typename TConstIteratorOnPo
ints,
typename TValue>
65 template <
typename TConstIteratorOnPo
ints,
typename TValue>
74 template <
typename TConstIteratorOnPo
ints,
typename TValue>
80 typename std::map<ConstIteratorOnPoints,int>::const_iterator
81 map_it = myMapIt2Idx.find( it );
82 if ( map_it != myMapIt2Idx.end() )
83 return map_it->second;
89 template <
typename TConstIteratorOnPo
ints,
typename TValue>
102 unsigned int aSize = 0;
105 myMapIt2Idx[ it ] = aSize;
108 myX.init( aSize, 0, isClosed, 0.0 );
109 myY.init( aSize, 0, isClosed, 0.0 );
124 myDY = myY * Signal<double>::Delta();
125 myDDX = myDX * Signal<double>::Delta();
126 myDDY = myDY * Signal<double>::Delta();
130 template <
typename TConstIteratorOnPo
ints,
typename TValue>
132 std::pair<TValue,TValue>
136 return std::make_pair( myX[ i ], myY[ i ] );
139 template <
typename TConstIteratorOnPo
ints,
typename TValue>
141 std::pair<TValue,TValue>
145 return std::make_pair( myDX[ i ], myDY[ i ] );
148 template <
typename TConstIteratorOnPo
ints,
typename TValue>
150 std::pair<TValue,TValue>
154 return std::make_pair( myDDX[ i ], myDDY[ i ] );
157 template <
typename TConstIteratorOnPo
ints,
typename TValue>
159 std::pair<TValue,TValue>
163 Value n = sqrt( myDX[ i ] * myDX[ i ] +
164 myDY[ i ] * myDY[ i ] );
165 return std::make_pair( -myDX[ i ] / n, -myDY[ i ] / n );
168 template <
typename TConstIteratorOnPo
ints,
typename TValue>
174 Value denom = pow( myDX[ i ] * myDX[ i ] + myDY[ i ] * myDY[ i ], 1.5 );
175 return ( denom != TValue( 0.0 ) )
176 ? ( myDDX[ i ] * myDY[ i ] - myDDY[ i ] * myDX[ i ] ) / denom / myH
186 template <
typename TConstIteratorOnPo
ints,
typename TValue>
195 TValue xmin = p[ 0 ];
196 TValue ymin = p[ 1 ];
197 TValue xmax = p[ 0 ];
198 TValue ymax = p[ 1 ];
207 if ( x < xmin ) xmin = x;
208 if ( x > xmax ) xmax = x;
209 if ( y < ymin ) ymin = y;
210 if ( y > ymax ) ymax = y;
212 TValue diameter = ( xmax - xmin ) > ( ymax - ymin )
217 return (
unsigned int) ceil( diameter / pow( h, 1.0/3.0 ) );
227 template <
typename TConstIteratorOnPo
ints,
typename TValue>
232 out <<
"[BinomialConvolver]";
239 template <
typename TConstIteratorOnPo
ints,
typename TValue>
250 template <
typename TBinomialConvolver,
typename TRealPo
int>
257 int index = bc.index( it );
258 std::pair<SignalValue,SignalValue> v = bc.tangent( index );
265 template <
typename TBinomialConvolver,
typename TReal>
272 int index = bc.index( it );
273 Value v = bc.curvature( index );
280 template <
typename TBinomialConvolver,
typename TBinomialConvolverFunctor>
285 : myBC( n ), myFunctor( f )
289 template <
typename TBinomialConvolver,
typename TBinomialConvolverFunctor>
296 const bool isClosed )
298 if ( myBC.size() == 0 )
299 myBC.setSize( myBC.suggestedSize( h, itb, ite ) );
300 myBC.
init( h, itb, ite, isClosed );
304 template <
typename TBinomialConvolver,
typename TBinomialConvolverFunctor>
310 return myFunctor( myBC, it );
313 template <
typename TBinomialConvolver,
typename TBinomialConvolverFunctor>
314 template <
typename OutputIterator>
320 OutputIterator result )
323 *result++ = eval( it );
331 template <
typename TConstIteratorOnPo
ints,
typename TValue>
335 ( std::ostream & out,
338 object.selfDisplay( out );