FlashGraph-ng
A new frontier in large-scale graph analysis and data mining
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
matrix_ops.h
1 #ifndef __MATRIX_OPS_H__
2 #define __MATRIX_OPS_H__
3 
4 /*
5  * Copyright 2015 Open Connectome Project (http://openconnecto.me)
6  * Written by Da Zheng (zhengda1936@gmail.com)
7  *
8  * This file is part of FlashMatrix.
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 #include <vector>
23 
24 #include <Rcpp.h>
25 
26 #include "bulk_operate.h"
27 #include "bulk_operate_ext.h"
28 
29 namespace fmr
30 {
31 
32 /*
33  * Register a binary UDF.
34  * A user has to provide UDFs for all different types.
35  */
36 void register_udf(const std::vector<fm::bulk_operate::const_ptr> &ops,
37  const std::string &name);
38 /*
39  * Register a unary UDF.
40  * A user has to provide UDFs for all different types.
41  */
42 void register_udf(const std::vector<fm::bulk_uoperate::const_ptr> &ops,
43  const std::string &name);
44 /*
45  * This registers more UDFs provided by FlashMatrix, which aren't basic UDFs.
46  */
47 void init_udf_ext();
48 
49 /* Get a binary operator. */
50 fm::bulk_operate::const_ptr get_op(SEXP pfun, fm::prim_type type1,
51  fm::prim_type type2);
52 /* Get a unary operator. */
53 fm::bulk_uoperate::const_ptr get_uop(SEXP pfun, fm::prim_type type);
54 
55 typedef int op_id_t;
56 
57 /* Get the binary operator Id given a name. */
58 op_id_t get_op_id(const std::string &name);
59 /* Get the unary operator Id given a name. */
60 op_id_t get_uop_id(const std::string &name);
61 
62 /* This construct an aggregation operator from binary operators. */
63 fm::agg_operate::const_ptr get_agg_op(SEXP pfun, const fm::scalar_type &mat_type);
64 
65 }
66 
67 #endif
prim_type
Definition: generic_type.h:37
Definition: generic_type.h:138