Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
msg_both_permutation_apply.h
Go to the documentation of this file.
1#ifndef _RHEO_MSG_BOTH_PERMUTATION_APPLY_H
2#define _RHEO_MSG_BOTH_PERMUTATION_APPLY_H
23namespace rheolef {
24/*F:
25NAME: msg_both_permutation_apply -- sequentail apply (@PACKAGE@ @VERSION@)
26DESCRIPTION:
27 Applies permutations when copying an array.
28ALGORITHM:
29 msg_both_permutation_apply
30
31 "input": the length array
32 | px(0:n-1), x(0:nx-1), py(0:n-1)
33 "output": the pointer array and the total size
34 | y(0:ny)
35 begin
36 | for i := 0 to n-1 do
37 | y(py(i)) := x(px(i))
38 | endfor
39 end
40COMPLEXITY:
41 Time and memory complexity is O(n).
42METHODS: @msg_both_permutation_apply
43AUTHORS:
44 LMC-IMAG, 38041 Grenoble cedex 9, France
45 | Pierre.Saramito@imag.fr
46DATE: 6 january 1999
47END:
48*/
49
50//<msg_both_permutation_apply:
51template <
52 class InputIterator1,
53 class InputIterator2,
54 class InputRandomIterator,
55 class SetOp,
56 class OutputRandomIterator>
57void
59 InputIterator1 px,
60 InputIterator1 last_px,
61 InputRandomIterator x,
62 SetOp set_op,
63 InputIterator2 py,
64 OutputRandomIterator y)
65{
66 while (px != last_px)
67 set_op(y[*py++], x[*px++]);
68}
69} // namespace rheolef
70//>msg_both_permutation_apply:
71#endif // _RHEO_MSG_BOTH_PERMUTATION_APPLY_H
This file is part of Rheolef.
void msg_both_permutation_apply(InputIterator1 px, InputIterator1 last_px, InputRandomIterator x, SetOp set_op, InputIterator2 py, OutputRandomIterator y)