95 if idx > this.
Splits || idx < 0
96 error(
" Max %d functions (starting at 0) for %d splits ",this.
Splits+1,this.
Splits);
100 str = sprintf(
" (1-@@varname@@/%g).*(@@varname@@<%g) ",ilen,ilen);
102 str = sprintf(
" ((@@varname@@-%g)/%g).*(@@varname@@>=%g) ",(idx-1)*ilen,ilen,(idx-1)*ilen);
105 zto = sprintf(
" (@@varname@@>=%g).*(@@varname@@<%g).*((@@varname@@-%g)/%g) ",...
106 (idx-1)*ilen,idx*ilen,(idx-1)*ilen,ilen);
108 otz = sprintf(
" (@@varname@@>=%g).*(@@varname@@<%g).*(1-(@@varname@@-%g)/%g) ",...
109 idx*ilen,(idx+1)*ilen,idx*ilen,ilen);
110 str = [zto
" + " otz];
112 str = strrep(str,
" @@varname@@ ",this.
VarName);
141 str = [
" @( " this.
VarName " )[ "];
143 str = [str funs[idx]
" ; "];
159 #if 0 //mtoc++: 'set.Splits'
162 error(
" Minimum of one split necessary. ");
179 f = lso.getAllFunctionsParsed;
181 pos = linspace(0,
l(
k),200);
184 res = res && sum(f(pos(i))) == 1;
186 fprintf(
" Splits: %d, len: %g, diff at end: %g\n ",s(
k),
l(
k),sum(f(pos(i)))-1);
LinearSplitOfOne: Computes a sequence of hat functions at equidistant nodes from [0,len] to enable an efficient, easy way of division of unity.
integer Splits
The number of splits to do. Results in +1 functions, indexed starting at 0.
function cell funs = getAllFunctions()
Returns all functions in a cell array.
A MatLab cell array or matrix.
LinearSplitOfOne(char varname,integer splits,double len)
Creates a new instance.
Matlab's base handle class (documentation generation substitute)
static function res = test_LinearSplitOfOne()
function handle = getAllFunctionsParsed()
Returns a function handle for a vector function, where each component idx evaluates the (idx-1)-th fu...
function str = getFunStr(idx)
Returns the idx-th function string.
char VarName
The variable name in the function strings.
double IntervalLength
The length of the interval over which to split unity.
A MatLab character array.