mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-14 00:51:52 +08:00
MSVC needs parentheses around min and max
This commit is contained in:
parent
87074d97e5
commit
b68102d9a2
@ -38,10 +38,10 @@ struct SparseLUBase
|
|||||||
static int LU_snode_dfs(const int jcol, const int kcol,const MatrixType& mat, IndexVector& xprune, IndexVector& marker, LU_GlobalLU_t<IndexVector, ScalarVector>& glu);
|
static int LU_snode_dfs(const int jcol, const int kcol,const MatrixType& mat, IndexVector& xprune, IndexVector& marker, LU_GlobalLU_t<IndexVector, ScalarVector>& glu);
|
||||||
static int LU_snode_bmod (const int jcol, const int fsupc, ScalarVector& dense, GlobalLU_t& glu);
|
static int LU_snode_bmod (const int jcol, const int fsupc, ScalarVector& dense, GlobalLU_t& glu);
|
||||||
static int LU_pivotL(const int jcol, const RealScalar diagpivotthresh, IndexVector& perm_r, IndexVector& iperm_c, int& pivrow, GlobalLU_t& glu);
|
static int LU_pivotL(const int jcol, const RealScalar diagpivotthresh, IndexVector& perm_r, IndexVector& iperm_c, int& pivrow, GlobalLU_t& glu);
|
||||||
template <typename RepfnzType, typename MarkerType,typename Traits>
|
template <typename Traits>
|
||||||
static void LU_dfs_kernel(const int jj, IndexVector& perm_r,
|
static void LU_dfs_kernel(const int jj, IndexVector& perm_r,
|
||||||
int& nseg, IndexVector& panel_lsub, IndexVector& segrep,
|
int& nseg, IndexVector& panel_lsub, IndexVector& segrep,
|
||||||
RepfnzType& repfnz_col, IndexVector& xprune, MarkerType& marker, IndexVector& parent,
|
Ref<IndexVector> repfnz_col, IndexVector& xprune, Ref<IndexVector> marker, IndexVector& parent,
|
||||||
IndexVector& xplore, GlobalLU_t& glu, int& nextl_col, int krow, Traits& traits);
|
IndexVector& xplore, GlobalLU_t& glu, int& nextl_col, int krow, Traits& traits);
|
||||||
static void LU_panel_dfs(const int m, const int w, const int jcol, MatrixType& A, IndexVector& perm_r, int& nseg, ScalarVector& dense, IndexVector& panel_lsub, IndexVector& segrep, IndexVector& repfnz, IndexVector& xprune, IndexVector& marker, IndexVector& parent, IndexVector& xplore, GlobalLU_t& glu);
|
static void LU_panel_dfs(const int m, const int w, const int jcol, MatrixType& A, IndexVector& perm_r, int& nseg, ScalarVector& dense, IndexVector& panel_lsub, IndexVector& segrep, IndexVector& repfnz, IndexVector& xprune, IndexVector& marker, IndexVector& parent, IndexVector& xplore, GlobalLU_t& glu);
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ int SparseLUBase<Scalar,Index>::LU_sp_coletree(const MatrixType& mat, IndexVecto
|
|||||||
for (typename MatrixType::InnerIterator it(mat, col); it; ++it)
|
for (typename MatrixType::InnerIterator it(mat, col); it; ++it)
|
||||||
{ // Is it necessary to browse the whole matrix, the lower part should do the job ??
|
{ // Is it necessary to browse the whole matrix, the lower part should do the job ??
|
||||||
row = it.row();
|
row = it.row();
|
||||||
firstcol(row) = std::min(firstcol(row), col);
|
firstcol(row) = (std::min)(firstcol(row), col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Compute etree by Liu's algorithm for symmetric matrices,
|
/* Compute etree by Liu's algorithm for symmetric matrices,
|
||||||
|
@ -128,8 +128,8 @@ int SparseLUBase<Scalar,Index>::LUMemInit(int m, int n, int annz, int lwork, int
|
|||||||
{
|
{
|
||||||
int& num_expansions = glu.num_expansions; //No memory expansions so far
|
int& num_expansions = glu.num_expansions; //No memory expansions so far
|
||||||
num_expansions = 0;
|
num_expansions = 0;
|
||||||
glu.nzumax = glu.nzlumax = std::max(fillratio * annz, m*n); // estimated number of nonzeros in U
|
glu.nzumax = glu.nzlumax = (std::max)(fillratio * annz, m*n); // estimated number of nonzeros in U
|
||||||
glu.nzlmax = std::max(1., fillratio/4.) * annz; // estimated nnz in L factor
|
glu.nzlmax = (std::max)(1., fillratio/4.) * annz; // estimated nnz in L factor
|
||||||
|
|
||||||
// Return the estimated size to the user if necessary
|
// Return the estimated size to the user if necessary
|
||||||
if (lwork == IND_EMPTY)
|
if (lwork == IND_EMPTY)
|
||||||
|
@ -76,7 +76,7 @@ int SparseLUBase<Scalar,Index>::LU_column_bmod(const int jcol, const int nseg, B
|
|||||||
{
|
{
|
||||||
// outside the rectangular supernode
|
// outside the rectangular supernode
|
||||||
fsupc = glu.xsup(ksupno);
|
fsupc = glu.xsup(ksupno);
|
||||||
fst_col = std::max(fsupc, fpanelc);
|
fst_col = (std::max)(fsupc, fpanelc);
|
||||||
|
|
||||||
// Distance from the current supernode to the current panel;
|
// Distance from the current supernode to the current panel;
|
||||||
// d_fsupc = 0 if fsupc > fpanelc
|
// d_fsupc = 0 if fsupc > fpanelc
|
||||||
@ -86,7 +86,7 @@ int SparseLUBase<Scalar,Index>::LU_column_bmod(const int jcol, const int nseg, B
|
|||||||
lptr = glu.xlsub(fsupc) + d_fsupc;
|
lptr = glu.xlsub(fsupc) + d_fsupc;
|
||||||
|
|
||||||
kfnz = repfnz(krep);
|
kfnz = repfnz(krep);
|
||||||
kfnz = std::max(kfnz, fpanelc);
|
kfnz = (std::max)(kfnz, fpanelc);
|
||||||
|
|
||||||
segsize = krep - kfnz + 1;
|
segsize = krep - kfnz + 1;
|
||||||
nsupc = krep - fst_col + 1;
|
nsupc = krep - fst_col + 1;
|
||||||
@ -132,7 +132,7 @@ int SparseLUBase<Scalar,Index>::LU_column_bmod(const int jcol, const int nseg, B
|
|||||||
* 1) fsupc < fpanelc, then fst_col <-- fpanelc
|
* 1) fsupc < fpanelc, then fst_col <-- fpanelc
|
||||||
* 2) fsupc >= fpanelc, then fst_col <-- fsupc
|
* 2) fsupc >= fpanelc, then fst_col <-- fsupc
|
||||||
*/
|
*/
|
||||||
fst_col = std::max(fsupc, fpanelc);
|
fst_col = (std::max)(fsupc, fpanelc);
|
||||||
|
|
||||||
if (fst_col < jcol)
|
if (fst_col < jcol)
|
||||||
{
|
{
|
||||||
|
@ -88,7 +88,7 @@ void SparseLUBase<Scalar,Index>::LU_heap_relax_snode (const int n, IndexVector&
|
|||||||
++nsuper_et_post;
|
++nsuper_et_post;
|
||||||
k = n;
|
k = n;
|
||||||
for (i = snode_start; i <= j; ++i)
|
for (i = snode_start; i <= j; ++i)
|
||||||
k = std::min(k, inv_post(i));
|
k = (std::min)(k, inv_post(i));
|
||||||
l = inv_post(j);
|
l = inv_post(j);
|
||||||
if ( (l - k) == (j - snode_start) ) // Same number of columns in the snode
|
if ( (l - k) == (j - snode_start) ) // Same number of columns in the snode
|
||||||
{
|
{
|
||||||
|
@ -89,7 +89,7 @@ void SparseLUBase<Scalar,Index>::LU_panel_bmod(const int m, const int w, const i
|
|||||||
|
|
||||||
segsize = krep - kfnz + 1;
|
segsize = krep - kfnz + 1;
|
||||||
u_cols++;
|
u_cols++;
|
||||||
u_rows = std::max(segsize,u_rows);
|
u_rows = (std::max)(segsize,u_rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the blocks are large enough, use level 3
|
// if the blocks are large enough, use level 3
|
||||||
|
@ -30,10 +30,10 @@
|
|||||||
#ifndef SPARSELU_PANEL_DFS_H
|
#ifndef SPARSELU_PANEL_DFS_H
|
||||||
#define SPARSELU_PANEL_DFS_H
|
#define SPARSELU_PANEL_DFS_H
|
||||||
template <typename Scalar, typename Index>
|
template <typename Scalar, typename Index>
|
||||||
template <typename RepfnzType, typename MarkerType,typename Traits>
|
template <typename Traits>
|
||||||
void SparseLUBase<Scalar,Index>::LU_dfs_kernel(const int jj, IndexVector& perm_r,
|
void SparseLUBase<Scalar,Index>::LU_dfs_kernel(const int jj, IndexVector& perm_r,
|
||||||
int& nseg, IndexVector& panel_lsub, IndexVector& segrep,
|
int& nseg, IndexVector& panel_lsub, IndexVector& segrep,
|
||||||
RepfnzType& repfnz_col, IndexVector& xprune, MarkerType& marker, IndexVector& parent,
|
Ref<IndexVector> repfnz_col, IndexVector& xprune, Ref<IndexVector> marker, IndexVector& parent,
|
||||||
IndexVector& xplore, GlobalLU_t& glu,
|
IndexVector& xplore, GlobalLU_t& glu,
|
||||||
int& nextl_col, int krow, Traits& traits
|
int& nextl_col, int krow, Traits& traits
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user