110#ifndef VSPLINE_BRACE_H
111#define VSPLINE_BRACE_H
130template <
unsigned int _dimension ,
typename _value_type >
135 typedef vigra::MultiArrayView < dimension , value_type >
view_type ;
154 int w = a.shape ( axis ) ;
155 int m = w - ( lsz + rsz ) ;
158 throw shape_mismatch (
"combined brace sizes must be at least one less than container size" ) ;
167 for (
int s = 0 ; s < w ; s++ )
170 a.bindAt ( axis , s ) = a.bindAt ( axis , lsz ) ;
175 if ( ( lsz > m + rsz )
176 || ( rsz > m + lsz ) )
180 throw std::out_of_range (
"each brace must be smaller than the sum of it's opposite brace and the core's width" ) ;
230 (
"boundary condition not supported by vspline::bracer" ) ;
235 for (
int i = max ( lsz , rsz ) ; i > 0 ; --i )
246 a.bindAt ( axis , lt ) = a.bindAt ( axis , ls ) ;
255 auto target = a.bindAt ( axis , lt ) ;
256 target = a.bindAt ( axis , lp ) ;
258 target -= a.bindAt ( axis , ls ) ;
264 a.bindAt ( axis , lt ) = a.bindAt ( axis , lp ) ;
290 a.bindAt ( axis , rt ) = a.bindAt ( axis , rs ) ;
299 auto target = a.bindAt ( axis , rt ) ;
300 target = a.bindAt ( axis , rp ) ;
302 target -= a.bindAt ( axis , rs ) ;
308 a.bindAt ( axis , rt ) = a.bindAt ( axis , rp ) ;
331 vigra::TinyVector < bc_code , dimension > bcv ,
335 for (
int dim = 0 ; dim <
dimension ; dim++ )
336 apply ( a , bcv[dim] , left_corner[dim] , right_corner[dim] , dim ) ;
definitions common to all files in this project, utility code
bc_code
This enumeration is used for codes connected to boundary conditions. There are two aspects to boundar...
class bracer encodes the entire bracing process. Note that contrary to my initial implementation,...
static void apply(view_type &a, vigra::TinyVector< bc_code, dimension > bcv, shape_type left_corner, shape_type right_corner)
This overload of 'apply' braces along all axes in one go.
view_type::difference_type shape_type
static void apply(view_type &a, bc_code bc, int lsz, int rsz, int axis)
apply the bracing to the array, performing the required copy/arithmetic operations to the 'frame' aro...
vigra::MultiArrayView< dimension, value_type > view_type
exception which is thrown if an opertion is requested which vspline does not support
shape mismatch is the exception which is thrown if the shapes of an input array and an output array d...