Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alta
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alta
alta
Commits
4a5bfb30
Commit
4a5bfb30
authored
Nov 06, 2013
by
PACANOWSKI Romain
Browse files
Options
Browse Files
Download
Plain Diff
Merging
parents
df6b8a59
b0fb81b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
253 additions
and
15 deletions
+253
-15
LICENSE.txt
LICENSE.txt
+20
-0
documents/alta_logo.svg
documents/alta_logo.svg
+211
-0
sources/plugins/data_interpolant_matlab/data.cpp
sources/plugins/data_interpolant_matlab/data.cpp
+22
-15
No files found.
LICENSE.txt
0 → 100644
View file @
4a5bfb30
This file is part of the ALTA library.
ALTA is free software: you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
ALTA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
We however require that you contact us for any use or modification of ALTA.
You should have received a copy of the GNU Lesser General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
Contacts:
- Laurent Belcour <laurent.belcour@inria.fr>
- Romain Pacanowski <romain.pacanowski@inria.fr>
- Xavier Granier <xavier.granier@inria.fr>
documents/alta_logo.svg
0 → 100644
View file @
4a5bfb30
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:sodipodi=
"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape=
"http://www.inkscape.org/namespaces/inkscape"
width=
"293.85605"
height=
"261.828"
id=
"svg2"
version=
"1.1"
inkscape:version=
"0.48.3.1 r9886"
sodipodi:docname=
"alta_logo.svg"
>
<defs
id=
"defs4"
/>
<sodipodi:namedview
id=
"base"
pagecolor=
"#ffffff"
bordercolor=
"#666666"
borderopacity=
"1.0"
inkscape:pageopacity=
"0.0"
inkscape:pageshadow=
"2"
inkscape:zoom=
"1.979899"
inkscape:cx=
"173.41891"
inkscape:cy=
"194.35337"
inkscape:document-units=
"px"
inkscape:current-layer=
"layer1"
showgrid=
"false"
fit-margin-top=
"0"
fit-margin-left=
"0"
fit-margin-right=
"0"
fit-margin-bottom=
"0"
inkscape:window-width=
"1200"
inkscape:window-height=
"1888"
inkscape:window-x=
"0"
inkscape:window-y=
"0"
inkscape:window-maximized=
"1"
/>
<metadata
id=
"metadata7"
>
<rdf:RDF>
<cc:Work
rdf:about=
""
>
<dc:format>
image/svg+xml
</dc:format>
<dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/>
<dc:title
/>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label=
"Layer 1"
inkscape:groupmode=
"layer"
id=
"layer1"
transform=
"translate(-218.71772,-239.02595)"
>
<path
style=
"fill:none;stroke:#ff0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d=
"m 224.12391,254.21248 c 13.75014,-24.3849 62.57976,-16.29367 92.34189,16.27477 29.76214,32.56845 41.1261,57.06917 49.22092,57.06917 8.09481,0 17.17249,-24.19853 45.31129,-54.32841 26.28078,-28.14042 71.92956,-44.49114 92.03679,-23.6903 22.68832,23.47096 -2.73331,74.43857 -42.23404,105.40769 -39.50073,30.96911 -94.75983,42.27522 -94.75983,42.27522 0,0 -46.47766,-5.96811 -85.35167,-34.05434 -38.87401,-28.08623 -73.46513,-78.9832 -56.56535,-108.9538 z"
id=
"path3913-2"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssssscss"
/>
<path
style=
"fill:none;stroke:#ff4545;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d=
"m 236.62391,264.21248 c 14.17834,-20.33759 44.92431,-11.01902 78.41332,17.70334 32.97641,28.28274 41.84037,66.71203 49.93519,66.71203 8.09481,0 20.62643,-41.92398 51.73987,-68.97127 29.49506,-25.64042 57.46035,-35.7403 75.25107,-18.33316 15.56867,15.233 8.69527,49.43857 -31.8769,88.26484 -36.26388,34.70337 -94.86629,48.01117 -94.86629,48.01117 0,0 -41.01405,-7.77549 -79.88805,-35.86172 -38.87401,-28.08623 -66.12206,-72.54659 -48.70821,-97.52523 z"
id=
"path3913-2-2"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssssscss"
/>
<path
style=
"fill:none;stroke:#ffa5a5;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d=
"m 252.14286,281.6479 c 11.22313,-19.90344 48.45526,-7.76059 72.74769,18.82241 24.29244,26.58301 33.85944,65.82044 40.46659,65.82044 6.60714,0 14.59953,-36.36721 37.56697,-60.95981 21.45089,-22.96876 56.37826,-44.76824 72.79018,-27.79019 18.51865,19.15746 -4.27153,57.26013 -36.5128,82.53773 -32.24127,25.2776 -73.93364,37.73013 -73.93364,37.73013 0,0 -34.6425,-9.8446 -66.37223,-32.76913 -31.72973,-22.92453 -60.54669,-58.92899 -46.75276,-83.39158 z"
id=
"path3913"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssssscss"
/>
<path
style=
"fill:none;stroke:#ffcece;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d=
"m 281.25,307.18361 c 9.89568,-9.23073 28.95137,-3.81082 42.92626,11.67956 15.01774,16.64632 37.2523,68.67758 41.53802,68.67758 4.64286,0 11.68203,-37.64965 36.85269,-63.63838 10.82971,-11.18168 34.18545,-27.81335 46.71875,-17.61162 4.52996,3.68725 8.40704,28.6887 -26.15566,57.00202 -31.69261,25.96217 -57.86221,34.51584 -57.86221,34.51584 0,0 -34.10679,-16.45174 -56.37223,-34.91199 C 278.76114,337.91217 276.12533,311.96393 281.25,307.18361 z"
id=
"path3913-4"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssssscss"
/>
<g
id=
"g4237"
>
<path
sodipodi:nodetypes=
"sssss"
inkscape:connector-curvature=
"0"
id=
"path3061-7"
d=
"m 325.98812,385.48016 c 21.68777,0.7741 38.93997,10.62505 38.91432,11.34364 -0.0275,0.76991 -17.93627,9.31448 -39.62404,8.54038 -21.68778,-0.7741 -39.11031,-5.85283 -38.91432,-11.34365 0.19598,-5.49081 17.93626,-9.31447 39.62404,-8.54037 z"
style=
"fill:none;stroke:#4eeb48;stroke-width:1.04782414;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
/>
<path
sodipodi:nodetypes=
"sssss"
inkscape:connector-curvature=
"0"
id=
"path3061-3-9"
d=
"m 338.96826,389.15328 c 14.68619,0.5242 26.36877,7.19491 26.35141,7.68152 -0.0186,0.52136 -12.14581,6.30744 -26.83201,5.78324 -14.6862,-0.52419 -26.48411,-3.96333 -26.3514,-7.68152 0.13271,-3.71818 12.1458,-6.30743 26.832,-5.78324 z"
style=
"fill:none;stroke:#82d178;stroke-width:0.70954955;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
/>
<path
sodipodi:nodetypes=
"sssss"
inkscape:connector-curvature=
"0"
id=
"path3061-3-5-0"
d=
"m 344.16366,391.3942 c 11.721,0.41836 21.06766,5.10295 21.05557,5.4415 -0.0129,0.36274 -9.66894,4.34485 -21.38994,3.92649 -11.72101,-0.41836 -21.1479,-2.8546 -21.05557,-5.4415 0.0923,-2.58689 9.66893,-4.34485 21.38994,-3.92649 z"
style=
"fill:none;stroke:#d0eacf;stroke-width:0.52873039;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
/>
<path
sodipodi:nodetypes=
"sssss"
inkscape:connector-curvature=
"0"
id=
"path3061-3-5-9-3"
d=
"m 349.19349,393.42965 c 8.86126,0.31628 15.95115,3.19438 15.94386,3.39864 -0.008,0.21884 -7.28434,2.56957 -16.1456,2.25328 -8.86125,-0.31628 -15.99955,-1.83791 -15.94385,-3.39865 0.0557,-1.56073 7.28433,-2.56956 16.14559,-2.25327 z"
style=
"fill:none;stroke:#cfe9cf;stroke-width:0.35708708;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
/>
</g>
<path
style=
"fill:none;stroke:#0014ff;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d=
"m 338.17413,466.67792 c 26.23203,-27.2526 28.51432,-67.74954 27.03189,-69.17645 -1.58831,-1.52883 -41.81995,2.43989 -68.05199,29.6925 -26.23204,27.25261 -38.31464,58.18399 -26.98725,69.08719 11.32737,10.90318 41.7753,-2.35062 68.00735,-29.60324 z"
id=
"path3061-2-9"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<g
transform=
"matrix(-1,0,0,1,731.52215,0.17647029)"
id=
"g4237-4"
>
<path
sodipodi:nodetypes=
"sssss"
inkscape:connector-curvature=
"0"
id=
"path3061-7-7"
d=
"m 325.98812,385.48016 c 21.68777,0.7741 38.93997,10.62505 38.91432,11.34364 -0.0275,0.76991 -17.93627,9.31448 -39.62404,8.54038 -21.68778,-0.7741 -39.11031,-5.85283 -38.91432,-11.34365 0.19598,-5.49081 17.93626,-9.31447 39.62404,-8.54037 z"
style=
"fill:none;stroke:#4eeb48;stroke-width:1.04782414;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
/>
<path
sodipodi:nodetypes=
"sssss"
inkscape:connector-curvature=
"0"
id=
"path3061-3-9-6"
d=
"m 338.96826,389.15328 c 14.68619,0.5242 26.36877,7.19491 26.35141,7.68152 -0.0186,0.52136 -12.14581,6.30744 -26.83201,5.78324 -14.6862,-0.52419 -26.48411,-3.96333 -26.3514,-7.68152 0.13271,-3.71818 12.1458,-6.30743 26.832,-5.78324 z"
style=
"fill:none;stroke:#82d178;stroke-width:0.70954955;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
/>
<path
sodipodi:nodetypes=
"sssss"
inkscape:connector-curvature=
"0"
id=
"path3061-3-5-0-8"
d=
"m 344.16366,391.3942 c 11.721,0.41836 21.06766,5.10295 21.05557,5.4415 -0.0129,0.36274 -9.66894,4.34485 -21.38994,3.92649 -11.72101,-0.41836 -21.1479,-2.8546 -21.05557,-5.4415 0.0923,-2.58689 9.66893,-4.34485 21.38994,-3.92649 z"
style=
"fill:none;stroke:#d0eacf;stroke-width:0.52873039;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
/>
<path
sodipodi:nodetypes=
"sssss"
inkscape:connector-curvature=
"0"
id=
"path3061-3-5-9-3-1"
d=
"m 349.19349,393.42965 c 8.86126,0.31628 15.95115,3.19438 15.94386,3.39864 -0.008,0.21884 -7.28434,2.56957 -16.1456,2.25328 -8.86125,-0.31628 -15.99955,-1.83791 -15.94385,-3.39865 0.0557,-1.56073 7.28433,-2.56956 16.14559,-2.25327 z"
style=
"fill:none;stroke:#cfe9cf;stroke-width:0.35708708;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
/>
</g>
<path
style=
"fill:none;stroke:#737eff;stroke-width:1.5846529;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 347.2917,443.9146 c 17.76341,-18.4545 19.27866,-45.81714 18.27482,-46.7834 -1.07555,-1.03527 -28.28878,1.59175 -46.05219,20.04625 -17.76342,18.45451 -25.94531,39.40016 -18.2748,46.78341 7.67048,7.38324 28.28875,-1.59175 46.05217,-20.04626 z"
id=
"path3061-3-2-0"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#0014ff;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d=
"m 393.58256,466.56803 c -26.23203,-27.2526 -28.46968,-67.66025 -26.98725,-69.08716 1.58831,-1.52883 41.77531,2.3506 68.00735,29.60321 26.23204,27.25261 38.31464,58.18399 26.98725,69.08719 -11.32737,10.90318 -41.7753,-2.35062 -68.00735,-29.60324 z"
id=
"path3061-2"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#737eff;stroke-width:1.5846529;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 384.39803,444.05025 c -17.76341,-18.4545 -19.27866,-45.81714 -18.27482,-46.7834 1.07555,-1.03527 28.28878,1.59175 46.05219,20.04625 17.76342,18.45451 25.94531,39.40016 18.2748,46.78341 -7.67048,7.38324 -28.28875,-1.59175 -46.05217,-20.04626 z"
id=
"path3061-3-2"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#0014ff;stroke-width:1.51787508;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 381.30553,343.48876 c 0,29.20938 -14.38907,52.88825 -15.51011,52.88825 -1.20111,0 -15.51012,-23.67887 -15.51012,-52.88825 0,-29.20939 6.94412,-52.88826 15.51012,-52.88826 8.56599,0 15.51011,23.67887 15.51011,52.88826 z"
id=
"path3061"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#737eff;stroke-width:1.02785146;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 376.30439,361.12469 c 0,19.77956 -9.74377,35.81406 -10.5029,35.81406 -0.81335,0 -10.50291,-16.0345 -10.50291,-35.81406 0,-19.77957 4.70232,-35.81406 10.50291,-35.81406 5.80058,0 10.5029,16.03449 10.5029,35.81406 z"
id=
"path3061-3"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#afb5ff;stroke-width:1.18082547;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 349.47045,433.04801 c 14.17692,-14.72848 16.70508,-35.29707 16.00666,-35.96933 -0.74831,-0.7203 -21.1556,2.63872 -35.33252,17.36719 -14.17693,14.72849 -21.34333,30.83251 -16.00665,35.96935 5.33667,5.13682 21.15559,-2.63873 35.33251,-17.36721 z"
id=
"path3061-3-5-7-2"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#afb5ff;stroke-width:1.18082547;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 382.28625,433.25062 c -14.17692,-14.72848 -16.70508,-35.29707 -16.00666,-35.96933 0.74831,-0.7203 21.1556,2.63872 35.33252,17.36719 14.17693,14.72849 21.34333,30.83251 16.00665,35.96935 -5.33667,5.13682 -21.15559,-2.63873 -35.33251,-17.36721 z"
id=
"path3061-3-5-7"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#afb5ff;stroke-width:0.76591736;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 373.1018,368.22061 c 0,15.786 -6.77914,28.58309 -7.3073,28.58309 -0.56589,0 -7.30731,-12.79709 -7.30731,-28.58309 0,-15.78601 3.2716,-28.58309 7.30731,-28.58309 4.0357,0 7.3073,12.79708 7.3073,28.58309 z"
id=
"path3061-3-5"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#cdd1ff;stroke-width:0.79749054;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 379.89815,423.17982 c -10.71797,-11.13495 -13.99811,-25.36757 -13.57674,-25.77316 0.45147,-0.43456 14.51851,3.41511 25.23648,14.55007 10.71796,11.13495 16.79646,22.67398 13.57671,25.77316 -3.21974,3.09916 -14.51848,-3.41511 -25.23645,-14.55007 z"
id=
"path3061-3-5-9-0"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#cdd1ff;stroke-width:0.51727533;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 370.21015,375.08395 c 0,11.93446 -4.09001,21.60925 -4.40866,21.60925 -0.34141,0 -4.40867,-9.67479 -4.40867,-21.60925 0,-11.93446 1.97383,-21.60924 4.40867,-21.60924 2.43483,0 4.40866,9.67478 4.40866,21.60924 z"
id=
"path3061-3-5-9"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
<path
style=
"fill:none;stroke:#cdd1ff;stroke-width:0.79749054;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
d=
"m 351.76926,423.13346 c 10.71797,-11.13495 13.99811,-25.36757 13.57674,-25.77316 -0.45147,-0.43456 -14.51851,3.41511 -25.23648,14.55007 -10.71796,11.13495 -16.79646,22.67398 -13.57671,25.77316 3.21974,3.09916 14.51848,-3.41511 25.23645,-14.55007 z"
id=
"path3061-3-5-9-0-5"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"sssss"
/>
</g>
</svg>
sources/plugins/data_interpolant_matlab/data.cpp
View file @
4a5bfb30
...
...
@@ -25,11 +25,15 @@ data_interpolant::data_interpolant()
{
std
::
cerr
<<
"<ERROR>> can't start MATLAB engine"
<<
std
::
endl
;
}
output
[
BUFFER_SIZE
]
=
'\0'
;
engOutputBuffer
(
ep
,
output
,
BUFFER_SIZE
)
;
}
data_interpolant
::~
data_interpolant
()
{
delete
_data
;
delete
[]
output
;
mxDestroyArray
(
x
);
mxDestroyArray
(
y
);
...
...
@@ -74,17 +78,8 @@ void data_interpolant::load(const std::string& filename)
Y
=
mxCreateDoubleMatrix
(
_data
->
size
(),
dimY
(),
mxREAL
);
memcpy
((
void
*
)
mxGetPr
(
Y
),
(
void
*
)
eY
.
data
(),
_data
->
size
()
*
dimY
()
*
sizeof
(
double
));
engPutVariable
(
ep
,
"Y"
,
Y
);
output
[
BUFFER_SIZE
]
=
'\0'
;
engOutputBuffer
(
ep
,
output
,
BUFFER_SIZE
)
;
engEvalString
(
ep
,
"display(X)"
);
std
::
cout
<<
output
<<
std
::
endl
;
engEvalString
(
ep
,
"display(Y)"
);
std
::
cout
<<
output
<<
std
::
endl
;
x
=
mxCreateDoubleMatrix
(
1
,
dimX
(),
mxREAL
);
engPutVariable
(
ep
,
"x"
,
x
);
}
void
data_interpolant
::
load
(
const
std
::
string
&
filename
,
const
arguments
&
)
{
...
...
@@ -124,21 +119,33 @@ vec data_interpolant::value(vec ax) const
// Copy the input vector to matlab code
memcpy
((
void
*
)
mxGetPr
(
x
),
(
void
*
)
&
ax
[
0
],
dimX
()
*
sizeof
(
double
));
engPutVariable
(
ep
,
"x"
,
x
);
// Evaluate the matlab routine
std
::
stringstream
cmd
;
cmd
<<
"y = griddatan(X(:, 1:"
<<
dimX
()
<<
"), Y(:, 1), x
)
"
;
cmd
<<
"y = griddatan(X(:, 1:"
<<
dimX
()
<<
"), Y(:, 1), x
, 'linear');
"
;
engEvalString
(
ep
,
cmd
.
str
().
c_str
());
std
::
cout
<<
output
<<
std
::
endl
;
engEvalString
(
ep
,
"display(y)"
);
std
::
cout
<<
output
<<
std
::
endl
;
// Get results and copy it
y
=
engGetVariable
(
ep
,
"y"
)
;
double
*
y_val
=
(
double
*
)
mxGetData
(
y
);
memcpy
(
&
res
[
0
],
y_val
,
dimY
()
*
sizeof
(
double
));
// Fail safe: if the query point is outside of the convex hull of the
// data, rerun the algorithm using a nearest option.
if
(
isnan
(
res
[
0
]))
{
cmd
.
str
(
std
::
string
());
cmd
<<
"y = griddatan(X(:, 1:"
<<
dimX
()
<<
"), Y(:, 1), x, 'nearest');"
;
engEvalString
(
ep
,
cmd
.
str
().
c_str
());
// Get results and copy it
y
=
engGetVariable
(
ep
,
"y"
)
;
double
*
y_val
=
(
double
*
)
mxGetData
(
y
);
memcpy
(
&
res
[
0
],
y_val
,
dimY
()
*
sizeof
(
double
));
}
return
res
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment