Commit 2327f871 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Fix spline library version changes

parent bb0dd053
......@@ -86,6 +86,14 @@ file (DOWNLOAD https://people.sc.fsu.edu/~jburkardt/c_src/spline/spline.c
if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/_external/spline/include/spline.h
AND EXISTS ${CMAKE_CURRENT_BINARY_DIR}/_external/spline/src/spline.c
)
file(READ ${CMAKE_CURRENT_BINARY_DIR}/_external/spline/include/spline.h spline_code)
string(REPLACE double float spline_code "${spline_code}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/_external/spline/include/spline.h "${spline_code}")
file(READ ${CMAKE_CURRENT_BINARY_DIR}/_external/spline/src/spline.c spline_code)
string(REPLACE double float spline_code "${spline_code}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/_external/spline/src/spline.c "${spline_code}")
add_library (
spline STATIC ${CMAKE_CURRENT_BINARY_DIR}/_external/spline/include/spline.h
${CMAKE_CURRENT_BINARY_DIR}/_external/spline/src/spline.c
......
......@@ -404,11 +404,11 @@ void Interpolation(
// bersprechen an den Grenzen zu vermeiden.
float *ypp = NULL;
// determine needed matrix for spline interpolation and store it in ypp
ypp = spline_cubic_set( ySize, &yDomainScale[ 0 ], &y[ 0 ], 0, y[ 0 ], 0, y[ ySize - 1 ] );
ypp = spline_cubic_set ( ySize, const_cast<float*> ( &yDomainScale[0] ), const_cast<float*> ( &y[0] ), 0, y[0], 0, y[ySize - 1] );
// interpolate all required nodes
for( unsigned int i = 0; i < xSize; i++ )
x[ i ] = spline_cubic_val( ySize, &yDomainScale[ 0 ], xDomainScale[ i ], &y[ 0 ], ypp );
for ( unsigned int i = 0; i < xSize; i++ )
x[i] = spline_cubic_val ( ySize, const_cast<float*> ( &yDomainScale[0] ), const_cast<float*> ( &y[0] ), ypp, xDomainScale[i], nullptr, nullptr );
delete[] ypp;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment