-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added help/usage messages with -h ; dsyevd falls back to dsyev if con…
…vergence fails ; use smart pointers in diag.h
- Loading branch information
Showing
21 changed files
with
195 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,12 @@ | |
# initialisation script | ||
# Rok Zitko, [email protected], 2009-2018 | ||
|
||
if [ "$1" = "-h" ] | ||
then | ||
echo Usage: nrginit | ||
exit 0 | ||
fi | ||
|
||
NRGDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" | ||
NRG_INITSCRIPT=${NRGDIR}/nrginit.m | ||
${1:-math} -batchinput -batchoutput <<EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -338,7 +338,18 @@ double rhs_F(double x, double y) { | |
|
||
void about(ostream &F = cout) { | ||
F << "# Discretization ODE solver" << endl; | ||
F << "# Rok Zitko, [email protected], 2008-2019" << endl; | ||
F << "# Rok Zitko, [email protected], 2008-2020" << endl; | ||
} | ||
|
||
const std::string usage{"Usage: adapt [-h] [P|N] [param_filename]"}; | ||
|
||
inline void help(int argc, char **argv, std::string help_message) | ||
{ | ||
std::vector<std::string> args(argv+1, argv+argc); // NOLINT | ||
if (args.size() >= 1 && args[0] == "-h") { | ||
std::cout << help_message << std::endl; | ||
exit(EXIT_SUCCESS); | ||
} | ||
} | ||
|
||
void cmd_line(int argc, char *argv[]) { | ||
|
@@ -347,7 +358,7 @@ void cmd_line(int argc, char *argv[]) { | |
switch (first) { | ||
case 'P': sign = POS; break; | ||
case 'N': sign = NEG; break; | ||
default: cerr << "Usage: adapt [P|N] [param_filename]" << endl; exit(1); | ||
default: cerr << usage << endl; exit(1); | ||
} | ||
} | ||
|
||
|
@@ -370,7 +381,7 @@ void load_init_rho() { | |
string rhofn = Pstr("dos", "Delta.dat"); | ||
vecrho = load_rho(rhofn, sign); | ||
add_zero_point(vecrho); | ||
|
||
rescalevecxy(vecrho, 1.0 / bandrescale, bandrescale); | ||
minmaxvec(vecrho, "rho"); | ||
rho = LinInt(vecrho); | ||
|
@@ -484,6 +495,7 @@ int main(int argc, char *argv[]) { | |
clock_t start_clock = clock(); | ||
|
||
about(); | ||
help(argc, argv, usage); | ||
cmd_line(argc, argv); | ||
parser(param_fn); | ||
set_parameters(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.