1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#include <algorithm>
#include "xtensor/xarray.hpp"
#include "xtensor/xtensor.hpp"
#include "xtensor/xmath.hpp"
#include "test_common_macros.hpp"
namespace xt
{
using namespace xt::placeholders;
/*py
xp = np.sort(np.random.random(20) - 0.5)
fp = np.random.random(20) - 0.5
x = np.linspace(-1,1,50)
f = np.interp(x, xp, fp)
*/
TEST(xtest_extended_xmath, interp)
{
// py_xp
// py_fp
// py_x
// py_f
auto f = xt::interp(py_x, py_xp, py_fp);
EXPECT_TRUE(xt::allclose(f, py_f));
}
}
|