Skip to content

Commit

Permalink
arapckmm: suppress --genPb option from command line.
Browse files Browse the repository at this point in the history
  • Loading branch information
fghoussen committed Sep 18, 2024
1 parent 86ee1d5 commit 3317075
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
6 changes: 1 addition & 5 deletions EXAMPLES/MATRIX_MARKET/arpackmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ class options {
}
nbCV = 2 * nbEV + 1;
}
if (clo == "--genPb") {
stdPb = false;
}
if (clo == "--nonSymPb") symPb = false;
if (clo == "--cpxPb") {
symPb = false;
Expand Down Expand Up @@ -353,6 +350,7 @@ class options {
return usage();
}
fileB = clo;
stdPb = false; // Generalized problem.
}
}

Expand Down Expand Up @@ -404,8 +402,6 @@ class options {
cout << " default: 1" << endl;
cout << " --nbCV: number of columns of the matrix V." << endl;
cout << " default: 2*nbEV+1" << endl;
cout << " --genPb: generalized problem." << endl;
cout << " default: standard problem" << endl;
cout << " --nonSymPb: non symmetric problem (<=> use dn[ae]upd)."
<< endl;
cout << " default: symmetric problem (<=> use ds[ae]upd)"
Expand Down
18 changes: 9 additions & 9 deletions EXAMPLES/MATRIX_MARKET/arpackmm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ catch() {

# For all these eigen problems, the first eigen value is about 382 or (382, 0.).

for eigPb in "--A As.mtx" "--nonSymPb --A An.mtx" "--nonSymPb --cpxPb --A Az.mtx"
for stdPb in "--A As.mtx" "--nonSymPb --A An.mtx" "--nonSymPb --cpxPb --A Az.mtx"
do
# Choose B matrix according to A.
export fileB=""
if [[ "$eigPb" == *cpxPb* ]]; then
if [[ "$stdPb" == *cpxPb* ]]; then
export fileB="--B Bz.mtx"
else
export fileB="--B B.mtx"
fi

for genPb in "" "--genPb $fileB"
for genPb in "" "$fileB"
do
# SM may not converge so we can not apply checks.
# LM + invert is equivalent to SM and does converge.
Expand All @@ -30,15 +30,15 @@ do

# Shift slightly to avoid the zero-vector starting problem.
export shiftZV=""
if [[ "$eigPb" == *cpxPb* ]]; then
if [[ "$stdPb" == *cpxPb* ]]; then
export shiftZV="--shiftReal 1.0 --shiftImag 1.0"
else
export shiftZV="--shiftReal 1.0"
fi

# Shift according to the estimation of the eigen value we may have.
export shiftEV=""
if [[ "$eigPb" == *cpxPb* ]]; then
if [[ "$stdPb" == *cpxPb* ]]; then
export shiftEV="--shiftReal 380.0 --shiftImag 1.0"
else
export shiftEV="--shiftReal 380.0"
Expand All @@ -50,7 +50,7 @@ do
do
# Choose solver according to the sym/non-sym type of the problem.
export cgSlv=""
if [[ "$eigPb" == *nonSymPb* ]]; then
if [[ "$stdPb" == *nonSymPb* ]]; then
export cgSlv="BiCG"
else
export cgSlv="CG"
Expand All @@ -72,18 +72,18 @@ do
fi

export easeCV="--nbCV 6 --maxIt 200" # Use --nbCV 6 and --maxIt 200 to ease convergence.
echo "CLI: ./arpackmm $eigPb $genPb $magOpt $mrn $shiftRI $invert $slv $rs $dsPrec $dsMat $easeCV"
echo "CLI: ./arpackmm $stdPb $genPb $magOpt $mrn $shiftRI $invert $slv $rs $dsPrec $dsMat $easeCV"
echo "----------------------------------------------------------------------------------------"

# Run arpackmm.
./arpackmm "$eigPb" "$genPb" "$magOpt" "$mrn" "$shiftRI" "$invert" "$slv" "$rs" "$dsPrec" "$dsMat" \
./arpackmm "$stdPb" "$genPb" "$magOpt" "$mrn" "$shiftRI" "$invert" "$slv" "$rs" "$dsPrec" "$dsMat" \
"$easeCV" --verbose 3 &> arpackmm.run.log
grep OPT arpackmm.run.log
grep OUT arpackmm.run.log
echo "----------------------------------------------------------------------------------------"

# Run arpackmm: re-run with restart always with small shift to avoid the zero-starting vector problem.
./arpackmm "$eigPb" "$genPb" "$magOpt" "$mrn" "$shiftZV" "$invert" "$slv" "$rs" "$dsPrec" "$dsMat" \
./arpackmm "$stdPb" "$genPb" "$magOpt" "$mrn" "$shiftZV" "$invert" "$slv" "$rs" "$dsPrec" "$dsMat" \
--restart \
"$easeCV" --verbose 3 &> arpackmm.run.log
grep OPT arpackmm.run.log
Expand Down

0 comments on commit 3317075

Please sign in to comment.