Loading...
Searching...
No Matches
msg_both_permutation_apply.h
Go to the documentation of this file.
#ifndef _RHEO_MSG_BOTH_PERMUTATION_APPLY_H
#define _RHEO_MSG_BOTH_PERMUTATION_APPLY_H
namespace rheolef {
/*F:
NAME: msg_both_permutation_apply -- sequentail apply (@PACKAGE@ @VERSION@)
DESCRIPTION:
Applies permutations when copying an array.
ALGORITHM:
msg_both_permutation_apply
"input": the length array
| px(0:n-1), x(0:nx-1), py(0:n-1)
"output": the pointer array and the total size
| y(0:ny)
begin
| for i := 0 to n-1 do
| y(py(i)) := x(px(i))
| endfor
end
COMPLEXITY:
Time and memory complexity is O(n).
METHODS: @msg_both_permutation_apply
AUTHORS:
LMC-IMAG, 38041 Grenoble cedex 9, France
| Pierre.Saramito@imag.fr
DATE: 6 january 1999
END:
*/
//<msg_both_permutation_apply:
template <
class InputIterator1,
class InputIterator2,
class InputRandomIterator,
class SetOp,
class OutputRandomIterator>
void
msg_both_permutation_apply (
InputIterator1 px,
InputIterator1 last_px,
InputRandomIterator x,
SetOp set_op,
InputIterator2 py,
OutputRandomIterator y)
{
while (px != last_px)
set_op(y[*py++], x[*px++]);
}
} // namespace rheolef
//>msg_both_permutation_apply:
#endif // _RHEO_MSG_BOTH_PERMUTATION_APPLY_H
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
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