Turi Create  4.0
ec_permute.hpp
1 /* Copyright © 2017 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
5  */
6 #ifndef SFRAME_ALGORITHM_EC_PERMUTE_HPP
7 #define SFRAME_ALGORITHM_EC_PERMUTE_HPP
8 
9 
10 #include <vector>
11 #include <memory>
12 /*
13  * See ec_sort.hpp for details
14  */
15 namespace turi {
16 class sframe;
17 
18 template <typename T>
19 class sarray;
20 
21 namespace query_eval {
22 
23 /**
24  * \ingroup sframe_query_engine
25  * \addtogroup Algorithms Algorithms
26  * \{
27  */
28 /**
29  * Permutes an sframe by a forward map.
30  * forward_map has the same length as the sframe and must be a permutation
31  * of all the integers [0, len-1].
32  *
33  * The input sframe is then permuted so that sframe row i is written to row
34  * forward_map[i] of the returned sframe.
35  *
36  * \note The forward_map is not checked that it is a valid permutation
37  * If the constraints is not met, either an exception will be thrown, or
38  * the result is ill-defined.
39  */
40 sframe permute_sframe(sframe &values_sframe,
41  std::shared_ptr<sarray<flexible_type> > forward_map);
42 
43 /// \}
44 } // query_eval
45 } // turicreate
46 
47 #endif
sframe permute_sframe(sframe &values_sframe, std::shared_ptr< sarray< flexible_type > > forward_map)