Skip to content

Commit b05869c

Browse files
committed
small fixes
1 parent b3df7d7 commit b05869c

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

highs/ipm/hipo/factorhighs/Analyse.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ Analyse::Analyse(const std::vector<Int>& rows, const std::vector<Int>& ptr,
6262
}
6363

6464
Int Analyse::getPermutation(bool metis_no2hop) {
65-
// Use Metis to compute a nested dissection permutation of the original matrix
65+
// Compute fill-reducing reodering using metis, amd or rcm.
6666

6767
perm_.resize(n_);
6868
iperm_.resize(n_);
6969

70-
// Build temporary full copy of the matrix, to be used for Metis.
71-
// NB: Metis adjacency list should not contain the vertex itself, so diagonal
70+
// Build temporary full copy of the matrix, to be used for reordering.
71+
// NB: adjacency list should not contain the vertex itself, so diagonal
7272
// element is skipped.
7373

7474
std::vector<Int> work(n_, 0);
@@ -93,7 +93,7 @@ Int Analyse::getPermutation(bool metis_no2hop) {
9393
}
9494

9595
if (total_nz > kHighsIInf) {
96-
if (log_) log_->printe("Integer overflow while preparing Metis\n");
96+
if (log_) log_->printe("Integer overflow while computing ordering.\n");
9797
return kRetIntOverflow;
9898
}
9999

@@ -141,7 +141,7 @@ Int Analyse::getPermutation(bool metis_no2hop) {
141141
if (log_) log_->printDevInfo("Metis done\n");
142142
if (status != METIS_OK) {
143143
if (log_) log_->printDevInfo("Error with Metis\n");
144-
return kRetMetisError;
144+
return kRetOrderingError;
145145
}
146146

147147
} else if (ordering_ == "amd") {
@@ -159,7 +159,7 @@ Int Analyse::getPermutation(bool metis_no2hop) {
159159

160160
if (status != AMD_OK) {
161161
if (log_) log_->printDevInfo("Error with AMD\n");
162-
return kRetMetisError;
162+
return kRetOrderingError;
163163
}
164164
inversePerm(perm_, iperm_);
165165
}
@@ -176,13 +176,13 @@ Int Analyse::getPermutation(bool metis_no2hop) {
176176

177177
if (status != 0) {
178178
if (log_) log_->printDevInfo("Error with RCM\n");
179-
return kRetMetisError;
179+
return kRetOrderingError;
180180
}
181181
inversePerm(perm_, iperm_);
182182

183183
} else {
184-
if (log_) log_->printe("Invalid reordering option\n");
185-
return kRetMetisError;
184+
if (log_) log_->printe("Invalid ordering option passed to Analyse\n");
185+
return kRetOrderingError;
186186
}
187187

188188
return kRetOk;
@@ -1302,7 +1302,7 @@ Int Analyse::run(Symbolic& S) {
13021302
#if HIPO_TIMING_LEVEL >= 2
13031303
Clock clock_items;
13041304
#endif
1305-
if (getPermutation(S.metisNo2hop())) return kRetMetisError;
1305+
if (getPermutation(S.metisNo2hop())) return kRetOrderingError;
13061306
#if HIPO_TIMING_LEVEL >= 2
13071307
data_.sumTime(kTimeAnalyseMetis, clock_items.stop());
13081308
#endif

highs/ipm/hipo/factorhighs/FactorHiGHS.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Then, the factorization is performed as follows.
3737
FH.factorise(S, rows, ptr, val);
3838
FH.solve(x);
3939
40+
The argument "ordering" passed to Analyse constructor can be used to select the
41+
fill-reducing ordering to use. Valid values are "metis", "amd", "rcm". By
42+
default, metis is used.
43+
4044
Printing to screen is achieved using the interface in auxiliary/Log.h. Pass an
4145
object of type Log for normal printing:
4246
...

highs/ipm/hipo/factorhighs/ReturnValues.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ enum RetValue {
88
kRetInvalidInput,
99
kRetOutOfMemory,
1010
kRetInvalidPivot,
11-
kRetMetisError,
11+
kRetOrderingError,
1212
kRetIntOverflow,
1313
kRetInvalidPointer,
1414
kRetGeneric

0 commit comments

Comments
 (0)