-
Notifications
You must be signed in to change notification settings - Fork 549
Expand file tree
/
Copy pathapprox.cpp
More file actions
48 lines (43 loc) · 1.74 KB
/
approx.cpp
File metadata and controls
48 lines (43 loc) · 1.74 KB
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
40
41
42
43
44
45
46
47
48
/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <af/array.h>
#include <af/signal.h>
#include "error.hpp"
namespace af {
array approx1(const array &yi, const array &xo, const interpType method,
const float offGrid) {
af_array yo = 0;
AF_THROW(af_approx1(&yo, yi.get(), xo.get(), method, offGrid));
return array(yo);
}
array approx2(const array &zi, const array &xo, const array &yo,
const interpType method, const float offGrid) {
af_array zo = 0;
AF_THROW(af_approx2(&zo, zi.get(), xo.get(), yo.get(), method, offGrid));
return array(zo);
}
array approx1(const array &yi, const array &xo, const int xdim,
const double xi_beg, const double xi_step,
const interpType method, const float offGrid) {
af_array yo = 0;
AF_THROW(af_approx1_uniform(&yo, yi.get(), xo.get(), xdim, xi_beg, xi_step,
method, offGrid));
return array(yo);
}
array approx2(const array &zi, const array &xo, const int xdim,
const double xi_beg, const double xi_step, const array &yo,
const int ydim, const double yi_beg, const double yi_step,
const interpType method, const float offGrid) {
af_array zo = 0;
AF_THROW(af_approx2_uniform(&zo, zi.get(), xo.get(), xdim, xi_beg, xi_step,
yo.get(), ydim, yi_beg, yi_step, method,
offGrid));
return array(zo);
}
} // namespace af