Rheolef  7.1
an efficient C++ finite element environment
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
3 namespace rheolef {
24 /*F:
25 NAME: msg_both_permutation_apply -- sequentail apply (@PACKAGE@ @VERSION@)
26 DESCRIPTION:
27  Applies permutations when copying an array.
28 ALGORITHM:
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
40 COMPLEXITY:
41  Time and memory complexity is O(n).
42 METHODS: @msg_both_permutation_apply
43 AUTHORS:
44  LMC-IMAG, 38041 Grenoble cedex 9, France
45  | Pierre.Saramito@imag.fr
46 DATE: 6 january 1999
47 END:
48 */
49 
50 //<msg_both_permutation_apply:
51 template <
52  class InputIterator1,
53  class InputIterator2,
54  class InputRandomIterator,
55  class SetOp,
56  class OutputRandomIterator>
57 void
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
rheolef::msg_both_permutation_apply
void msg_both_permutation_apply(InputIterator1 px, InputIterator1 last_px, InputRandomIterator x, SetOp set_op, InputIterator2 py, OutputRandomIterator y)
Definition: msg_both_permutation_apply.h:58
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::set_op
Definition: msg_util.h:56