Skip to content

Commit 2d846f1

Browse files
committed
Moving non index functions from index.h to data.h
1 parent 139e1e3 commit 2d846f1

File tree

17 files changed

+281
-273
lines changed

17 files changed

+281
-273
lines changed

include/af/data.h

Lines changed: 185 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,157 @@ namespace af
172172
AFAPI array diag(const array &in, const int num = 0, const bool extract = true);
173173

174174
/**
175-
@}
175+
@}
176+
*/
177+
178+
/**
179+
\defgroup manip_func_join join
180+
@{
181+
Join two arrays along specified dimension
182+
183+
\param[in] dim is the dimension along which join occurs
184+
\param[in] first is the first input array
185+
\param[in] second is the first second array
186+
\return the array that joins \p first and \p second along \p dim
187+
188+
\ingroup manip_mat
189+
\ingroup arrayfire_func
190+
*/
191+
AFAPI array join(const int dim, const array &first, const array &second);
192+
193+
AFAPI array join(const int dim, const array &first, const array &second, const array &third);
194+
195+
AFAPI array join(const int dim, const array &first, const array &second,
196+
const array &third, const array &fourth);
197+
/**
198+
@}
199+
*/
200+
201+
/**
202+
\defgroup manip_func_tile tile
203+
@{
204+
Tile the input array along specified dimensions
205+
206+
\param[in] in is the input matrix
207+
\param[in] x is the number of times \p in is tiled along first dimension
208+
\param[in] y is the number of times \p in is tiled along second dimension
209+
\param[in] z is the number of times \p in is tiled along third dimension
210+
\param[in] w is the number of times \p in is tiled along fourth dimension
211+
\return the tiled output
212+
213+
\ingroup manip_mat
214+
\ingroup arrayfire_func
215+
*/
216+
AFAPI array tile(const array &in, const unsigned x, const unsigned y=1,
217+
const unsigned z=1, const unsigned w=1);
218+
/**
219+
@}
220+
*/
221+
222+
/**
223+
\defgroup manip_func_tile tile
224+
@{
225+
Tile the input array along specified dimensions
226+
227+
\param[in] in is the input matrix
228+
\param[in] dims dim4 of tile dimensions
229+
\return the tiled output
230+
231+
\ingroup manip_mat
232+
\ingroup arrayfire_func
233+
*/
234+
AFAPI array tile(const array &in, const dim4 &dims);
235+
/**
236+
@}
237+
*/
238+
239+
/**
240+
\defgroup manip_func_reorder reorder
241+
@{
242+
Reorder the input by in the specified order
243+
244+
\param[in] in is the input matrix
245+
\param[in] x specifies which dimension should be first
246+
\param[in] y specifies which dimension should be second
247+
\param[in] z specifies which dimension should be third
248+
\param[in] w specifies which dimension should be fourth
249+
\return the reordered output
250+
251+
\ingroup manip_mat
252+
\ingroup arrayfire_func
176253
*/
254+
AFAPI array reorder(const array& in, const unsigned x,
255+
const unsigned y=1, const unsigned z=2, const unsigned w=3);
256+
/**
257+
@}
258+
*/
259+
260+
/**
261+
\defgroup manip_func_shift shift
262+
@{
263+
Circular shift slong specified dimensions
264+
265+
\param[in] in is the input matrix
266+
\param[in] x specifies the shift along first dimension
267+
\param[in] y specifies the shift along second dimension
268+
\param[in] z specifies the shift along third dimension
269+
\param[in] w specifies the shift along fourth dimension
270+
\return the shifted output
271+
272+
\ingroup manip_mat
273+
\ingroup arrayfire_func
274+
*/
275+
AFAPI array shift(const array& in, const int x, const int y=0, const int z=0, const int w=0);
276+
/**
277+
@}
278+
*/
279+
280+
/**
281+
\defgroup manip_func_moddims moddims
282+
@{
283+
284+
Modify the input dimensions without changing the data order
285+
286+
\ingroup manip_mat
287+
\ingroup arrayfire_func
288+
*/
289+
AFAPI array moddims(const array& in, const unsigned ndims, const dim_type * const dims);
290+
291+
AFAPI array moddims(const array& in, const dim4& dims);
292+
293+
AFAPI array moddims(const array& in, dim_type d0, dim_type d1=1, dim_type d2=1, dim_type d3=1);
294+
/**
295+
@}
296+
*/
297+
298+
/**
299+
\defgroup manip_func_flat flat
300+
@{
301+
302+
Flatten the input to a single dimension
303+
304+
\ingroup manip_mat
305+
\ingroup arrayfire_func
306+
*/
307+
AFAPI array flat(const array &in);
308+
/**
309+
@}
310+
*/
311+
312+
/**
313+
\defgroup manip_func_flip flip
314+
@{
315+
316+
Flip the input along sepcified dimension
317+
318+
\ingroup manip_mat
319+
\ingroup arrayfire_func
320+
*/
321+
AFAPI array flip(const array &in, const unsigned dim);
322+
/**
323+
@}
324+
*/
325+
177326
}
178327
#endif
179328

@@ -293,6 +442,41 @@ extern "C" {
293442
@}
294443
*/
295444

445+
/**
446+
\ingroup manip_func_join
447+
*/
448+
AFAPI af_err af_join(af_array *out, const int dim, const af_array first, const af_array second);
449+
450+
AFAPI af_err af_join_many(af_array *out, const int dim, const unsigned n_arrays, const af_array *inputs);
451+
452+
/**
453+
\ingroup manip_func_tile
454+
*/
455+
AFAPI af_err af_tile(af_array *out, const af_array in,
456+
const unsigned x, const unsigned y, const unsigned z, const unsigned w);
457+
458+
/**
459+
\ingroup manip_func_reorder
460+
*/
461+
AFAPI af_err af_reorder(af_array *out, const af_array in,
462+
const unsigned x, const unsigned y, const unsigned z, const unsigned w);
463+
464+
/**
465+
\ingroup manip_func_shift
466+
*/
467+
AFAPI af_err af_shift(af_array *out, const af_array in, const int x, const int y, const int z, const int w);
468+
469+
/**
470+
\ingroup manip_func_moddims
471+
*/
472+
AFAPI af_err af_moddims(af_array *out, const af_array in, const unsigned ndims, const dim_type * const dims);
473+
474+
/**
475+
\ingroup manip_func_flat
476+
*/
477+
AFAPI af_err af_flat(af_array *out, const af_array in);
478+
479+
296480
#ifdef __cplusplus
297481
}
298482
#endif

include/af/index.h

Lines changed: 0 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -51,152 +51,6 @@ class AFAPI index {
5151
const af_index_t& get() const;
5252
};
5353

54-
/**
55-
\defgroup manip_func_join join
56-
@{
57-
Join two arrays along specified dimension
58-
59-
\param[in] dim is the dimension along which join occurs
60-
\param[in] first is the first input array
61-
\param[in] second is the first second array
62-
\return the array that joins \p first and \p second along \p dim
63-
64-
\ingroup manip_mat
65-
\ingroup arrayfire_func
66-
*/
67-
AFAPI array join(const int dim, const array &first, const array &second);
68-
69-
AFAPI array join(const int dim, const array &first, const array &second, const array &third);
70-
71-
AFAPI array join(const int dim, const array &first, const array &second, const array &third, const array &fourth);
72-
/**
73-
@}
74-
*/
75-
76-
/**
77-
\defgroup manip_func_tile tile
78-
@{
79-
Tile the input array along specified dimensions
80-
81-
\param[in] in is the input matrix
82-
\param[in] x is the number of times \p in is tiled along first dimension
83-
\param[in] y is the number of times \p in is tiled along second dimension
84-
\param[in] z is the number of times \p in is tiled along third dimension
85-
\param[in] w is the number of times \p in is tiled along fourth dimension
86-
\return the tiled output
87-
88-
\ingroup manip_mat
89-
\ingroup arrayfire_func
90-
*/
91-
AFAPI array tile(const array &in, const unsigned x, const unsigned y=1, const unsigned z=1, const unsigned w=1);
92-
/**
93-
@}
94-
*/
95-
96-
/**
97-
\defgroup manip_func_tile tile
98-
@{
99-
Tile the input array along specified dimensions
100-
101-
\param[in] in is the input matrix
102-
\param[in] dims dim4 of tile dimensions
103-
\return the tiled output
104-
105-
\ingroup manip_mat
106-
\ingroup arrayfire_func
107-
*/
108-
AFAPI array tile(const array &in, const dim4 &dims);
109-
/**
110-
@}
111-
*/
112-
113-
/**
114-
\defgroup manip_func_reorder reorder
115-
@{
116-
Reorder the input by in the specified order
117-
118-
\param[in] in is the input matrix
119-
\param[in] x specifies which dimension should be first
120-
\param[in] y specifies which dimension should be second
121-
\param[in] z specifies which dimension should be third
122-
\param[in] w specifies which dimension should be fourth
123-
\return the reordered output
124-
125-
\ingroup manip_mat
126-
\ingroup arrayfire_func
127-
*/
128-
AFAPI array reorder(const array& in, const unsigned x, const unsigned y=1, const unsigned z=2, const unsigned w=3);
129-
/**
130-
@}
131-
*/
132-
133-
/**
134-
\defgroup manip_func_shift shift
135-
@{
136-
Circular shift slong specified dimensions
137-
138-
\param[in] in is the input matrix
139-
\param[in] x specifies the shift along first dimension
140-
\param[in] y specifies the shift along second dimension
141-
\param[in] z specifies the shift along third dimension
142-
\param[in] w specifies the shift along fourth dimension
143-
\return the shifted output
144-
145-
\ingroup manip_mat
146-
\ingroup arrayfire_func
147-
*/
148-
AFAPI array shift(const array& in, const int x, const int y=0, const int z=0, const int w=0);
149-
/**
150-
@}
151-
*/
152-
153-
/**
154-
\defgroup manip_func_moddims moddims
155-
@{
156-
157-
Modify the input dimensions without changing the data order
158-
159-
\ingroup manip_mat
160-
\ingroup arrayfire_func
161-
*/
162-
AFAPI array moddims(const array& in, const unsigned ndims, const dim_type * const dims);
163-
164-
AFAPI array moddims(const array& in, const dim4& dims);
165-
166-
AFAPI array moddims(const array& in, dim_type d0, dim_type d1=1, dim_type d2=1, dim_type d3=1);
167-
/**
168-
@}
169-
*/
170-
171-
/**
172-
\defgroup manip_func_flat flat
173-
@{
174-
175-
Flatten the input to a single dimension
176-
177-
\ingroup manip_mat
178-
\ingroup arrayfire_func
179-
*/
180-
AFAPI array flat(const array &in);
181-
/**
182-
@}
183-
*/
184-
185-
/**
186-
\defgroup manip_func_flip flip
187-
@{
188-
189-
Flip the input along sepcified dimension
190-
191-
\ingroup manip_mat
192-
\ingroup arrayfire_func
193-
*/
194-
AFAPI array flip(const array &in, const unsigned dim);
195-
/**
196-
@}
197-
*/
198-
199-
20054
/**
20155
Lookup the values of input array based on index
20256
@@ -256,40 +110,6 @@ extern "C" {
256110
*/
257111
AFAPI af_err af_assign_seq(af_array *out, const af_array lhs, unsigned ndims, const af_seq* const index, const af_array rhs);
258112

259-
/**
260-
\ingroup manip_func_join
261-
*/
262-
AFAPI af_err af_join(af_array *out, const int dim, const af_array first, const af_array second);
263-
264-
AFAPI af_err af_join_many(af_array *out, const int dim, const unsigned n_arrays, const af_array *inputs);
265-
266-
/**
267-
\ingroup manip_func_tile
268-
*/
269-
AFAPI af_err af_tile(af_array *out, const af_array in,
270-
const unsigned x, const unsigned y, const unsigned z, const unsigned w);
271-
272-
/**
273-
\ingroup manip_func_reorder
274-
*/
275-
AFAPI af_err af_reorder(af_array *out, const af_array in,
276-
const unsigned x, const unsigned y, const unsigned z, const unsigned w);
277-
278-
/**
279-
\ingroup manip_func_shift
280-
*/
281-
AFAPI af_err af_shift(af_array *out, const af_array in, const int x, const int y, const int z, const int w);
282-
283-
/**
284-
\ingroup manip_func_moddims
285-
*/
286-
AFAPI af_err af_moddims(af_array *out, const af_array in, const unsigned ndims, const dim_type * const dims);
287-
288-
/**
289-
\ingroup manip_func_flat
290-
*/
291-
AFAPI af_err af_flat(af_array *out, const af_array in);
292-
293113
/**
294114
\ingroup manip_func_flip
295115
*/

0 commit comments

Comments
 (0)