File tree Expand file tree Collapse file tree 5 files changed +17
-22
lines changed Expand file tree Collapse file tree 5 files changed +17
-22
lines changed Original file line number Diff line number Diff line change @@ -39,18 +39,4 @@ mxArray *dataset_read_all(const nix::DataSet &da) {
39
39
return data;
40
40
}
41
41
42
- nix::LinkType get_link_type (uint8_t ltype)
43
- {
44
- nix::LinkType link_type;
45
-
46
- switch (ltype) {
47
- case 0 : link_type = nix::LinkType::Tagged; break ;
48
- case 1 : link_type = nix::LinkType::Untagged; break ;
49
- case 2 : link_type = nix::LinkType::Indexed; break ;
50
- default : throw std::invalid_argument (" unkown link type" );
51
- }
52
-
53
- return link_type;
54
- }
55
-
56
42
} // namespace nixgen
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ namespace nixgen {
8
8
9
9
mxArray *dataset_read_all (const nix::DataSet &da);
10
10
11
- nix::LinkType get_link_type (uint8_t ltype);
12
-
13
11
} // namespace nixgen
14
12
15
13
#endif
Original file line number Diff line number Diff line change @@ -40,9 +40,7 @@ namespace nixmultitag {
40
40
{
41
41
nix::MultiTag currObj = input.entity <nix::MultiTag>(1 );
42
42
43
- nix::LinkType link_type = nixgen::get_link_type (input.num <uint8_t >(3 ));
44
-
45
- nix::Feature newFeat = currObj.createFeature (input.str (2 ), link_type);
43
+ nix::Feature newFeat = currObj.createFeature (input.str (2 ), input.ltype (3 ));
46
44
output.set (0 , handle (newFeat));
47
45
}
48
46
Original file line number Diff line number Diff line change @@ -42,9 +42,7 @@ namespace nixtag {
42
42
{
43
43
nix::Tag currObj = input.entity <nix::Tag>(1 );
44
44
45
- nix::LinkType link_type = nixgen::get_link_type (input.num <uint8_t >(3 ));
46
-
47
- nix::Feature newFeat = currObj.createFeature (input.str (2 ), link_type);
45
+ nix::Feature newFeat = currObj.createFeature (input.str (2 ), input.ltype (3 ));
48
46
output.set (0 , handle (newFeat));
49
47
}
50
48
Original file line number Diff line number Diff line change @@ -106,6 +106,21 @@ class extractor : public argument_helper<const mxArray> {
106
106
return dtype_mex2nix (array[pos]);
107
107
}
108
108
109
+ nix::LinkType ltype (size_t pos) const
110
+ {
111
+ const uint8_t link_type = num<uint8_t >(pos);
112
+ nix::LinkType retLinkType;
113
+
114
+ switch (link_type) {
115
+ case 0 : retLinkType = nix::LinkType::Tagged; break ;
116
+ case 1 : retLinkType = nix::LinkType::Untagged; break ;
117
+ case 2 : retLinkType = nix::LinkType::Indexed; break ;
118
+ default : throw std::invalid_argument (" unkown link type" );
119
+ }
120
+
121
+ return retLinkType;
122
+ }
123
+
109
124
bool logical (size_t pos) const {
110
125
check_arg_type (pos, nix::DataType::Bool);
111
126
You can’t perform that action at this time.
0 commit comments