ocmath_modshepard_struct_free

 

Description

This function free the memory allocated by ocmath_modified_shepard_interpolant().

Syntax

int ocmath_modshepard_struct_free( ocmath_ModShepard_Struct * comm )

Parameters

comm
[input] pointer refer to the buffer to be released

Return

If success, it returns 0 (OE_NOERROR) , otherwise -18 (OE_BAD_PARAM).

Examples

EX1

#include <wks2mat.h>
void ocmath_modshepard_struct_free_ex1()
{
    double x[9] = { 0.,1.,1.,0.,.25,.5,.75,.5, 1. };
    double y[9] = { 0.,0.,1.,1.,.5,.3,.5,.7 , 0.5};
    double z[9] = { 0, 1, 2, 1, 0.5, 0.59, 1, 0.99, 1.25};
    double px[5] = { .1,.3,.5,.7,.9 };
    double py[5] = { .2,.4,.6,.8, .4 };
 
    int n = 9;
 
    ocmath_ModShepard_Opt optional;
    ocmath_ModShepard_Struct comm;
 
    optional.nq = 5;
    optional.nw = 7;
 
    ocmath_modified_shepard_interpolant(n, x, y, z,&comm, &optional);
 
    int m = 5;
    double pf[5];
    ocmath_modified_shepard_eval(&comm, m, px, py, pf);
 
    for(int i=0; i<m; i++)
        printf("%g\t%g\t%g\n\n", px[i], py[i], pf[i]);
 
    ocmath_modshepard_struct_free(&comm);
}

Remark

See Also

ocmath_modified_shepard_interpolant

header to Include

wks2mat.h

Reference