Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
54b04405
Commit
54b04405
authored
Sep 10, 2017
by
Guolin Ke
Browse files
fix #886
parent
3cce5ee1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
src/treelearner/split_info.hpp
src/treelearner/split_info.hpp
+6
-8
No files found.
src/treelearner/split_info.hpp
View file @
54b04405
...
@@ -72,10 +72,9 @@ public:
...
@@ -72,10 +72,9 @@ public:
buffer
+=
sizeof
(
right_sum_hessian
);
buffer
+=
sizeof
(
right_sum_hessian
);
std
::
memcpy
(
buffer
,
&
default_left
,
sizeof
(
default_left
));
std
::
memcpy
(
buffer
,
&
default_left
,
sizeof
(
default_left
));
buffer
+=
sizeof
(
default_left
);
buffer
+=
sizeof
(
default_left
);
for
(
int
i
=
0
;
i
<
num_cat_threshold
;
++
i
)
{
std
::
memcpy
(
buffer
,
&
num_cat_threshold
,
sizeof
(
num_cat_threshold
));
std
::
memcpy
(
buffer
,
&
cat_threshold
[
i
],
sizeof
(
uint32_t
));
buffer
+=
sizeof
(
num_cat_threshold
);
buffer
+=
sizeof
(
uint32_t
);
std
::
memcpy
(
buffer
,
cat_threshold
.
data
(),
sizeof
(
uint32_t
)
*
num_cat_threshold
);
}
}
}
void
CopyFrom
(
const
char
*
buffer
)
{
void
CopyFrom
(
const
char
*
buffer
)
{
...
@@ -103,11 +102,10 @@ public:
...
@@ -103,11 +102,10 @@ public:
buffer
+=
sizeof
(
right_sum_hessian
);
buffer
+=
sizeof
(
right_sum_hessian
);
std
::
memcpy
(
&
default_left
,
buffer
,
sizeof
(
default_left
));
std
::
memcpy
(
&
default_left
,
buffer
,
sizeof
(
default_left
));
buffer
+=
sizeof
(
default_left
);
buffer
+=
sizeof
(
default_left
);
std
::
memcpy
(
&
num_cat_threshold
,
buffer
,
sizeof
(
num_cat_threshold
));
buffer
+=
sizeof
(
num_cat_threshold
);
cat_threshold
.
resize
(
num_cat_threshold
);
cat_threshold
.
resize
(
num_cat_threshold
);
for
(
int
i
=
0
;
i
<
num_cat_threshold
;
++
i
)
{
std
::
memcpy
(
cat_threshold
.
data
(),
buffer
,
sizeof
(
uint32_t
)
*
num_cat_threshold
);
std
::
memcpy
(
&
cat_threshold
[
i
],
buffer
,
sizeof
(
uint32_t
));
buffer
+=
sizeof
(
uint32_t
);
}
}
}
inline
void
Reset
()
{
inline
void
Reset
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment