2.1.18.15 ocmath_renka_cline_eval
Description
This subroutine computes the value at given points using the method of renka and cline.
Syntax
int ocmath_renka_cline_eval( ocmath_RenkaCline_Struct * comm, int n, double * px, double * py, double * pf )
Parameters
- comm
- [input] the structure computed from ocmath_renka_cline_interpolation()
- n
- [input] number of nodes and data values defining q.
- px
- [input] x cartesian coordinates of the points at which q are to be evaluated.
- py
- [input] y cartesian coordinates of the points at which q are to be evaluated.
- pf
- [output] value of q at (PX,PY)
Return
Err_Intp_No_Error: No error occur;
Err_Intp_Mem_Fail: Fails to allocate memory;
OR error from ocmath_renka_cline_interpolation().
Examples
EX1
#include <wks2mat.h>
void ocmath_renka_cline_eval_ex1()
{
vector vX = { 1.7, 2.1, 3.9, 7.2, 8.6, 8.5, 7.3, 5.1, 2.8, 1.8, 1.7 };
vector vY = { 3.2, 3.9, 4.9, 5.3, 5.5, 6.2, 6.5, 6.9, 7.5, 8.3, 9.4 };
vector vZ = { 3.2, 3.9, 4.9, 5.3, 5.5, 6.2, 6.5, 6.9, 7.5, 8.3, 9.4 };
double dXMin, dXMax, dYMin, dYMax;
vX.GetMinMax(dXMin, dXMax);
vY.GetMinMax(dYMin, dYMax);
int rows = 20, cols = 20;
MatrixPage mp;
mp.Create("Origin");
MatrixLayer ml = mp.Layers();
MatrixObject mo = ml.MatrixObjects(0);
Matrix& mat = mo.GetDataObject();
mat.SetSize(rows, cols);
mo.SetXY(dXMin, dYMin, dXMax, dYMax);
vector vXGrid(rows*cols), vYGrid(rows*cols);
int iRet = ocmath_mat_to_regular_xyz(NULL, rows, cols, dXMin, dXMax, dYMin, dYMax, vXGrid, vYGrid, NULL);
ocmath_RenkaCline_Struct comm;
ocmath_renka_cline_interpolation(vX.GetSize(), vX, vY, vZ, &comm);//Get comm from ocmath_renka_cline_interpolation
iRet = ocmath_renka_cline_eval(&comm, rows*cols, vXGrid, vYGrid, mat);
out_int("iRet=", iRet);
ocmath_renka_cline_struct_free(&comm);
}
Remark
See Also
ocmath_renka_cline_struct_free, ocmath_renka_cline_interpolation
Header to Included
wks2mat.h
Reference
|