Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
d7cb9925
Commit
d7cb9925
authored
Mar 24, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3858 from MSOpenTech:fix-ml-test
parents
70ff4480
91bd7df8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
tree.cpp
modules/ml/src/tree.cpp
+8
-1
No files found.
modules/ml/src/tree.cpp
View file @
d7cb9925
...
...
@@ -286,7 +286,14 @@ int DTreesImpl::addTree(const vector<int>& sidx )
int
ssize
=
getSubsetSize
(
split
.
varIdx
);
split
.
subsetOfs
=
(
int
)
subsets
.
size
();
subsets
.
resize
(
split
.
subsetOfs
+
ssize
);
memcpy
(
&
subsets
[
split
.
subsetOfs
],
&
w
->
wsubsets
[
wsplit
.
subsetOfs
],
ssize
*
sizeof
(
int
));
// This check verifies that subsets index is in the correct range
// as in case ssize == 0 no real resize performed.
// Thus memory kept safe.
// Also this skips useless memcpy call when size parameter is zero
if
(
ssize
>
0
)
{
memcpy
(
&
subsets
[
split
.
subsetOfs
],
&
w
->
wsubsets
[
wsplit
.
subsetOfs
],
ssize
*
sizeof
(
int
));
}
}
node
.
split
=
(
int
)
splits
.
size
();
splits
.
push_back
(
split
);
...
...
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