mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
fix a few warnings
This commit is contained in:
parent
37d367a231
commit
c858fb353f
@ -106,6 +106,7 @@ Index cs_tdfs(Index j, Index k, Index *head, const Index *next, Index *post, Ind
|
|||||||
template<typename Scalar, typename Index>
|
template<typename Scalar, typename Index>
|
||||||
void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, PermutationMatrix<Dynamic,Dynamic,Index>& perm)
|
void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, PermutationMatrix<Dynamic,Dynamic,Index>& perm)
|
||||||
{
|
{
|
||||||
|
using std::sqrt;
|
||||||
typedef SparseMatrix<Scalar,ColMajor,Index> CCS;
|
typedef SparseMatrix<Scalar,ColMajor,Index> CCS;
|
||||||
|
|
||||||
int d, dk, dext, lemax = 0, e, elenk, eln, i, j, k, k1,
|
int d, dk, dext, lemax = 0, e, elenk, eln, i, j, k, k1,
|
||||||
@ -114,7 +115,7 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation
|
|||||||
unsigned int h;
|
unsigned int h;
|
||||||
|
|
||||||
Index n = C.cols();
|
Index n = C.cols();
|
||||||
dense = std::max<Index> (16, 10 * sqrt ((double) n)); /* find dense threshold */
|
dense = std::max<Index> (16, Index(10 * sqrt(double(n)))); /* find dense threshold */
|
||||||
dense = std::min<Index> (n-2, dense);
|
dense = std::min<Index> (n-2, dense);
|
||||||
|
|
||||||
Index cnz = C.nonZeros();
|
Index cnz = C.nonZeros();
|
||||||
|
@ -79,7 +79,7 @@ initSparse(double density,
|
|||||||
enum { IsRowMajor = SparseMatrix<Scalar,Opt2,Index>::IsRowMajor };
|
enum { IsRowMajor = SparseMatrix<Scalar,Opt2,Index>::IsRowMajor };
|
||||||
sparseMat.setZero();
|
sparseMat.setZero();
|
||||||
//sparseMat.reserve(int(refMat.rows()*refMat.cols()*density));
|
//sparseMat.reserve(int(refMat.rows()*refMat.cols()*density));
|
||||||
sparseMat.reserve(VectorXi::Constant(IsRowMajor ? refMat.rows() : refMat.cols(), (1.5*density)*(IsRowMajor?refMat.cols():refMat.rows())));
|
sparseMat.reserve(VectorXi::Constant(IsRowMajor ? refMat.rows() : refMat.cols(), int((1.5*density)*(IsRowMajor?refMat.cols():refMat.rows()))));
|
||||||
|
|
||||||
for(int j=0; j<sparseMat.outerSize(); j++)
|
for(int j=0; j<sparseMat.outerSize(); j++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user