Skip to content

Commit 1508ece

Browse files
committed
Merge data.h and reduce.h into algorithm.h
1 parent 4d20d56 commit 1508ece

16 files changed

Lines changed: 49 additions & 49 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ namespace af
1515
{
1616
class array;
1717

18+
// Add all the elements along a dimension
19+
AFAPI array sum(const array &in, const int dim = 0);
20+
21+
// Get the minimum of all elements along a dimension
22+
AFAPI array min(const array &in, const int dim = 0);
23+
24+
// Get the maximum of all elements along a dimension
25+
AFAPI array max(const array &in, const int dim = 0);
26+
27+
// Check if all elements along a dimension are true
28+
AFAPI array alltrue(const array &in, const int dim = 0);
29+
30+
// Check if any elements along a dimension are true
31+
AFAPI array anytrue(const array &in, const int dim = 0);
32+
33+
// Count number of non zero elements along a dimension
34+
AFAPI array count(const array &in, const int dim = 0);
35+
1836
AFAPI array diff1(const array &in, const int dim = 0);
1937

2038
AFAPI array diff2(const array &in, const int dim = 0);
@@ -42,6 +60,23 @@ namespace af
4260
#ifdef __cplusplus
4361
extern "C" {
4462
#endif
63+
// Add all the elements along a dimension
64+
AFAPI af_err af_sum(af_array *out, const af_array in, const int dim);
65+
66+
// Get the minimum of all elements along a dimension
67+
AFAPI af_err af_min(af_array *out, const af_array in, const int dim);
68+
69+
// Get the maximum of all elements along a dimension
70+
AFAPI af_err af_max(af_array *out, const af_array in, const int dim);
71+
72+
// Check if all elements along a dimension are true
73+
AFAPI af_err af_alltrue(af_array *out, const af_array in, const int dim);
74+
75+
// Check if any elements along a dimension are true
76+
AFAPI af_err af_anytrue(af_array *out, const af_array in, const int dim);
77+
78+
// Count number of non zero elements along a dimension
79+
AFAPI af_err af_count(af_array *out, const af_array in, const int dim);
4580

4681
// Compute first order difference along a given dimension.
4782
AFAPI af_err af_diff1(af_array *out, const af_array in, const int dim);

include/af/reduce.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,12 @@
1616
#ifdef __cplusplus
1717
namespace af
1818
{
19-
// Add all the elements along a dimension
20-
AFAPI array sum(const array &in, const int dim = 0);
21-
22-
// Get the minimum of all elements along a dimension
23-
AFAPI array min(const array &in, const int dim = 0);
24-
25-
// Get the maximum of all elements along a dimension
26-
AFAPI array max(const array &in, const int dim = 0);
27-
28-
// Check if all elements along a dimension are true
29-
AFAPI array alltrue(const array &in, const int dim = 0);
30-
31-
// Check if any elements along a dimension are true
32-
AFAPI array anytrue(const array &in, const int dim = 0);
33-
34-
// Count number of non zero elements along a dimension
35-
AFAPI array count(const array &in, const int dim = 0);
3619
}
3720
#endif
3821

3922
#ifdef __cplusplus
4023
extern "C" {
4124
#endif
42-
// Add all the elements along a dimension
43-
AFAPI af_err af_sum(af_array *out, const af_array in, const int dim);
44-
45-
// Get the minimum of all elements along a dimension
46-
AFAPI af_err af_min(af_array *out, const af_array in, const int dim);
47-
48-
// Get the maximum of all elements along a dimension
49-
AFAPI af_err af_max(af_array *out, const af_array in, const int dim);
50-
51-
// Check if all elements along a dimension are true
52-
AFAPI af_err af_alltrue(af_array *out, const af_array in, const int dim);
53-
54-
// Check if any elements along a dimension are true
55-
AFAPI af_err af_anytrue(af_array *out, const af_array in, const int dim);
56-
57-
// Count number of non zero elements along a dimension
58-
AFAPI af_err af_count(af_array *out, const af_array in, const int dim);
5925

6026
#ifdef __cplusplus
6127
}

include/arrayfire.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
********************************************************/
99

1010
#pragma once
11+
#include "af/algorithm.h"
1112
#include "af/arith.h"
1213
#include "af/array.h"
1314
#include "af/blas.h"
14-
#include "af/data.h"
1515
#include "af/device.h"
1616
#include "af/exception.h"
1717
#include "af/image.h"
1818
#include "af/index.h"
19-
#include "af/reduce.h"
2019
#include "af/signal.h"
2120
#include "af/util.h"

src/array/approx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
********************************************************/
99

1010
#include <af/array.h>
11-
#include <af/data.h>
11+
#include <af/algorithm.h>
1212
#include "error.hpp"
1313

1414
namespace af

src/array/diff.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
********************************************************/
99

1010
#include <af/array.h>
11-
#include <af/data.h>
11+
#include <af/algorithm.h>
1212
#include "error.hpp"
1313

1414
namespace af

src/array/reduce.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
********************************************************/
99

1010
#include <af/array.h>
11-
#include <af/reduce.h>
11+
#include <af/algorithm.h>
1212
#include "error.hpp"
1313

1414
namespace af

src/array/scan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
********************************************************/
99

1010
#include <af/array.h>
11-
#include <af/data.h>
11+
#include <af/algorithm.h>
1212
#include "error.hpp"
1313

1414
namespace af

src/array/sort.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
********************************************************/
99

1010
#include <af/array.h>
11-
#include <af/data.h>
11+
#include <af/algorithm.h>
1212
#include "error.hpp"
1313

1414
namespace af

src/array/where.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
********************************************************/
99

1010
#include <af/array.h>
11-
#include <af/data.h>
11+
#include <af/algorithm.h>
1212
#include "error.hpp"
1313

1414
namespace af

src/backend/approx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
********************************************************/
99

1010
#include <af/array.h>
11-
#include <af/data.h>
11+
#include <af/algorithm.h>
1212
#include <af/defines.h>
1313
#include <err_common.hpp>
1414
#include <handle.hpp>

0 commit comments

Comments
 (0)