Skip to content

Commit

Permalink
Merge pull request #2 from ralna/single
Browse files Browse the repository at this point in the history
Add flag to decode a problem in single precision
  • Loading branch information
nimgould authored Mar 19, 2019
2 parents 351844b + 6eacbb8 commit eb4acb8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ notifications:
email: false

env:
- ARCHDEFS_VERSION=2.0.2
- ARCHDEFS_VERSION=2.0.3
- ARCHDEFS_VERSION=master

before_install:
Expand All @@ -36,7 +36,7 @@ before_install:

install:
- cd $TRAVIS_BUILD_DIR
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then printf "6\n2\n4\n" > sifdecode.input; fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then printf "6\n2\n5\n" > sifdecode.input; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then printf "13\n2\n" > sifdecode.input; fi
- printf "nny" >> sifdecode.input
- ./install_sifdecode < sifdecode.input
Expand All @@ -45,3 +45,6 @@ install:

script:
- ./bin/sifdecoder ROSENBR.SIF
- grep DOUBLE ELFUN.f || false
- ./bin/sifdecoder -sp ROSENBR.SIF
- grep REAL ELFUN.f || false
11 changes: 9 additions & 2 deletions bin/sifdecoder
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ display_long_help() {
echo " differences (default: do not check)"
echo " -s : rough size of problem for array initialization"
echo " 0=debug, 1=small, 2=medium, 3=large (default)"
echo " -sp : decode problem in single precision (default: double)"
echo " -st : starting point vector to be used"
echo " (Default: -st 1)"
echo " -show : displays possible parameter settings for"
Expand Down Expand Up @@ -140,6 +141,10 @@ let PACKAGE=3

let size=2

# specify the precision of the output files (single = 0, double = 1)

let double=1

# starting point vector to be used; if st > # starting vectors, st = 1

let st=1
Expand Down Expand Up @@ -173,6 +178,9 @@ while (( i <= last )); do
elif [[ "$opt" == '-s' ]]; then
(( i++ ))
let size=${!i}
elif [[ "$opt" == '-sp' ]]; then
(( i++ ))
let double=0
elif [[ "$opt" == '-st' ]]; then
(( i++ ))
let st=${!i}
Expand Down Expand Up @@ -430,7 +438,7 @@ echo $OUTPUT >> $sdinput
echo $PROBNAME >> $sdinput
echo $automatic >> $sdinput
echo $ad0 >> $sdinput
echo '1' >> $sdinput # Double precision.
echo $double >> $sdinput
echo $size >> $sdinput
echo $st >> $sdinput

Expand Down Expand Up @@ -531,4 +539,3 @@ if [[ $DERIVCHECK == "1" ]]; then
fi

exit 0

5 changes: 5 additions & 0 deletions man/man1/sifdecoder.1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sifdecoder \- SIF-decoding script.
[\-f] [\-b] [\-a \fI1|2\fP]
[\-p \fI1|2|3\fP]
[\-s \fI0|1|2|3\fP]
[\-sp]
[\-st \fI1|2|3\fP]
[\-show] [\-param
\fIname=value\fP[\fI,name=value...\fP]] [\-force]
Expand Down Expand Up @@ -77,6 +78,10 @@ of up to approximately 10000 variables and constraints, and
allocation errors on modest computers.
The default is for meedium-sized problems.
.TP
.BI \-sp
Decode the problem for use with the single precision tools. The default is to
decode the problem for use with the double precision tools.
.TP
.BI \-st " 1|2|3"
Specifies the starting point vector to be used if there is more than one.
Any value outside the actual number of starting vectors will be interpreted
Expand Down

0 comments on commit eb4acb8

Please sign in to comment.