Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CoMISo
CoMISo
Commits
54dc54db
Commit
54dc54db
authored
Dec 02, 2016
by
Max Lyon
Browse files
Merge branch 'Fix_warnings-GF' into warning_fixes
parents
d4bbe377
cf02a697
Changes
3
Hide whitespace changes
Inline
Side-by-side
NSolver/CBCSolver.cc
View file @
54dc54db
...
...
@@ -150,7 +150,7 @@ bool solve_impl(
DEB_warning_if
(
!
_problem
->
constant_gradient
(),
1
,
"CBCSolver received a problem with non-constant gradient!"
);
const
in
t
n_rows
=
_constraints
.
size
();
// Constraints #
const
size_
t
n_rows
=
_constraints
.
size
();
// Constraints #
const
int
n_cols
=
_problem
->
n_unknowns
();
// Unknowns #
// expand the variable types from discrete mtrx array
...
...
Solver/Eigen_ToolsT.cc
View file @
54dc54db
...
...
@@ -340,7 +340,7 @@ void cholmod_to_eigen( const cholmod_sparse& _AC, MatrixT& _A)
typedef
Eigen
::
Triplet
<
Scalar
>
Triplet
;
size_t
nzmax
(
_AC
.
nzmax
);
std
::
cerr
<<
__FUNCTION__
<<
" row "
<<
_AC
.
nrow
<<
" col "
<<
_AC
.
ncol
<<
" stype "
<<
_AC
.
stype
<<
std
::
endl
;
_A
=
MatrixT
(
_AC
.
nrow
,
_AC
.
ncol
);
_A
=
MatrixT
(
(
int
)
_AC
.
nrow
,
(
int
)
_AC
.
ncol
);
std
::
vector
<
Triplet
>
triplets
;
triplets
.
reserve
(
nzmax
);
...
...
@@ -365,7 +365,7 @@ void cholmod_to_eigen( const cholmod_sparse& _AC, MatrixT& _A)
for
(
SuiteSparse_long
i
=
0
;
i
<
(
SuiteSparse_long
)
_AC
.
ncol
;
++
i
)
for
(
SuiteSparse_long
j
=
P
[
i
];
j
<
P
[
i
+
1
];
++
j
)
//_A( I[j], i) += X[j]; // += really needed?
triplets
.
push_back
(
Triplet
(
I
[
j
],
i
,
X
[
j
]));
triplets
.
push_back
(
Triplet
(
(
int
)
I
[
j
],
(
int
)
i
,
X
[
j
]));
}
else
{
...
...
@@ -374,7 +374,7 @@ void cholmod_to_eigen( const cholmod_sparse& _AC, MatrixT& _A)
for
(
int
i
=
0
;
i
<
(
int
)
_AC
.
ncol
;
++
i
)
for
(
int
j
=
P
[
i
];
j
<
P
[
i
+
1
];
++
j
)
triplets
.
push_back
(
Triplet
(
I
[
j
],
i
,
X
[
j
]));
triplets
.
push_back
(
Triplet
(
(
int
)
I
[
j
],
(
int
)
i
,
X
[
j
]));
//_A( I[j], i) += X[j];
}
...
...
@@ -391,11 +391,11 @@ void cholmod_to_eigen( const cholmod_sparse& _AC, MatrixT& _A)
for
(
SuiteSparse_long
j
=
P
[
i
];
j
<
P
[
i
+
1
];
++
j
)
{
//_A(I[j], i) += X[j];
triplets
.
push_back
(
Triplet
(
I
[
j
],
i
,
X
[
j
]));
triplets
.
push_back
(
Triplet
(
(
int
)
I
[
j
],
(
int
)
i
,
X
[
j
]));
// add up symmetric part
if
(
I
[
j
]
!=
i
)
triplets
.
push_back
(
Triplet
(
i
,
I
[
j
],
X
[
j
]));
triplets
.
push_back
(
Triplet
(
(
int
)
i
,
(
int
)
I
[
j
],
X
[
j
]));
//_A(i,I[j]) += X[j];
}
}
...
...
Solver/SparseQRSolverT.cc
View file @
54dc54db
...
...
@@ -211,7 +211,7 @@ factorize_system_eigen( const Eigen_MatrixT& _A, Eigen_MatrixT& _Q, Eigen_Matrix
cholmod_sparse
*
Q
,
*
R
;
// SuiteSparse_long *P = new SuiteSparse_long[n];
SuiteSparse_long
*
P
;
double
rank
=
SuiteSparseQR
<
double
>
(
ordering_
,
tolerance_
,
econ
,
AC
,
&
Q
,
&
R
,
&
P
,
mp_cholmodCommon
);
int
rank
=
(
int
)
SuiteSparseQR
<
double
>
(
ordering_
,
tolerance_
,
econ
,
AC
,
&
Q
,
&
R
,
&
P
,
mp_cholmodCommon
);
std
::
cerr
<<
"factorization finished"
<<
std
::
endl
;
std
::
cerr
<<
"rank: "
<<
rank
<<
std
::
endl
;
cholmod_print_sparse
(
Q
,
"Q"
,
mp_cholmodCommon
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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