Skip to content

Commit c24dfb0

Browse files
committed
fix(osqp): fix the osqp m and n
1 parent c3e760b commit c24dfb0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

internal/pkg/binding/c.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ import (
1313
)
1414

1515
type Data struct {
16-
N int
17-
M int
16+
N int64
17+
M int64
1818
P_x []float64
1919
P_i []int
2020
P_p []int
21-
P_nnz int
21+
P_nnz int64
2222
A_x []float64
2323
A_i []int
2424
A_p []int
25-
A_nnz int
25+
A_nnz int64
2626
Q []float64
2727
L []float64
2828
U []float64

osqp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ func NewOSQP() *OSQPConfig {
3030

3131
func (o OSQPConfig) Setup(p SparseMatrix, q []float64, a SparseMatrix, l []float64, u []float64) {
3232
currData := binding.Data{
33-
M: p.r,
34-
N: a.c,
33+
M: int64(a.r),
34+
N: int64(p.r),
3535
P_x: p.Data(),
3636
P_i: p.Ind(),
3737
P_p: p.IndPtr(),

sparse.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
type SparseMatrix struct {
1010
r, c int
11-
nnz int
11+
nnz int64
1212
indPtr []int
1313
ind []int
1414
data []float64
@@ -26,7 +26,7 @@ func (s SparseMatrix) Ind() []int {
2626
return s.ind
2727
}
2828

29-
func (s SparseMatrix) NNZ() int {
29+
func (s SparseMatrix) NNZ() int64 {
3030
return s.nnz
3131
}
3232

0 commit comments

Comments
 (0)