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
88b84436
"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "ddda85b06061fe11ce42e1f636c101b651a7ef19"
Commit
88b84436
authored
Nov 20, 2016
by
Guolin Ke
Committed by
GitHub
Nov 20, 2016
Browse files
fix bug in CSR get row function
parent
f56699eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/c_api.cpp
src/c_api.cpp
+5
-5
No files found.
src/c_api.cpp
View file @
88b84436
...
@@ -660,7 +660,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
...
@@ -660,7 +660,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std
::
vector
<
std
::
pair
<
int
,
double
>>
ret
;
std
::
vector
<
std
::
pair
<
int
,
double
>>
ret
;
int64_t
start
=
ptr_indptr
[
idx
];
int64_t
start
=
ptr_indptr
[
idx
];
int64_t
end
=
ptr_indptr
[
idx
+
1
];
int64_t
end
=
ptr_indptr
[
idx
+
1
];
for
(
int64_t
i
=
start
;
i
<
=
end
;
++
i
)
{
for
(
int64_t
i
=
start
;
i
<
end
;
++
i
)
{
ret
.
emplace_back
(
indices
[
i
],
data_ptr
[
i
]);
ret
.
emplace_back
(
indices
[
i
],
data_ptr
[
i
]);
}
}
return
ret
;
return
ret
;
...
@@ -671,7 +671,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
...
@@ -671,7 +671,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std
::
vector
<
std
::
pair
<
int
,
double
>>
ret
;
std
::
vector
<
std
::
pair
<
int
,
double
>>
ret
;
int64_t
start
=
ptr_indptr
[
idx
];
int64_t
start
=
ptr_indptr
[
idx
];
int64_t
end
=
ptr_indptr
[
idx
+
1
];
int64_t
end
=
ptr_indptr
[
idx
+
1
];
for
(
int64_t
i
=
start
;
i
<
=
end
;
++
i
)
{
for
(
int64_t
i
=
start
;
i
<
end
;
++
i
)
{
ret
.
emplace_back
(
indices
[
i
],
data_ptr
[
i
]);
ret
.
emplace_back
(
indices
[
i
],
data_ptr
[
i
]);
}
}
return
ret
;
return
ret
;
...
@@ -685,7 +685,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
...
@@ -685,7 +685,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std
::
vector
<
std
::
pair
<
int
,
double
>>
ret
;
std
::
vector
<
std
::
pair
<
int
,
double
>>
ret
;
int64_t
start
=
ptr_indptr
[
idx
];
int64_t
start
=
ptr_indptr
[
idx
];
int64_t
end
=
ptr_indptr
[
idx
+
1
];
int64_t
end
=
ptr_indptr
[
idx
+
1
];
for
(
int64_t
i
=
start
;
i
<
=
end
;
++
i
)
{
for
(
int64_t
i
=
start
;
i
<
end
;
++
i
)
{
ret
.
emplace_back
(
indices
[
i
],
data_ptr
[
i
]);
ret
.
emplace_back
(
indices
[
i
],
data_ptr
[
i
]);
}
}
return
ret
;
return
ret
;
...
@@ -696,7 +696,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
...
@@ -696,7 +696,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std
::
vector
<
std
::
pair
<
int
,
double
>>
ret
;
std
::
vector
<
std
::
pair
<
int
,
double
>>
ret
;
int64_t
start
=
ptr_indptr
[
idx
];
int64_t
start
=
ptr_indptr
[
idx
];
int64_t
end
=
ptr_indptr
[
idx
+
1
];
int64_t
end
=
ptr_indptr
[
idx
+
1
];
for
(
int64_t
i
=
start
;
i
<
=
end
;
++
i
)
{
for
(
int64_t
i
=
start
;
i
<
end
;
++
i
)
{
ret
.
emplace_back
(
indices
[
i
],
data_ptr
[
i
]);
ret
.
emplace_back
(
indices
[
i
],
data_ptr
[
i
]);
}
}
return
ret
;
return
ret
;
...
@@ -774,4 +774,4 @@ std::vector<double> SampleFromOneColumn(const std::vector<std::pair<int, double>
...
@@ -774,4 +774,4 @@ std::vector<double> SampleFromOneColumn(const std::vector<std::pair<int, double>
}
}
}
}
return
ret
;
return
ret
;
}
}
\ No newline at end of file
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