Skip to content

Commit

Permalink
Move parse_command_line() from EXAMPLE/ to utility file in SRC/; fix …
Browse files Browse the repository at this point in the history
…prototype errors.
  • Loading branch information
xiaoyeli committed Dec 5, 2024
1 parent 0bbd657 commit 7a05fcb
Show file tree
Hide file tree
Showing 30 changed files with 170 additions and 568 deletions.
37 changes: 1 addition & 36 deletions EXAMPLE/clinsolx.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ at the top-level directory.
#include <getopt.h>
#include "slu_cdefs.h"

void parse_command_line(int argc, char *argv[], int *lwork,
float *u, yes_no_t *equil, trans_t *trans);

int main(int argc, char *argv[])
{
char equed[1];
Expand Down Expand Up @@ -85,7 +82,7 @@ int main(int argc, char *argv[])
set_default_options(&options);

/* Can use command line input to modify the defaults. */
parse_command_line(argc, argv, &lwork, &u, &equil, &trans);
cparse_command_line(argc, argv, &lwork, &u, &equil, &trans);
options.Equil = equil;
options.DiagPivotThresh = u;
options.Trans = trans;
Expand Down Expand Up @@ -205,35 +202,3 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}


/*!
* \brief Parse command line inputs.
*/
void
parse_command_line(int argc, char *argv[], int_t *lwork,
float *u, yes_no_t *equil, trans_t *trans )
{
int c;
extern char *optarg;

while ( (c = getopt(argc, argv, "hl:w:r:u:f:t:p:e:")) != EOF ) {
switch (c) {
case 'h':
printf("Options:\n");
printf("\t-l <int> - length of work[*] array\n");
printf("\t-u <int> - pivoting threshold\n");
printf("\t-e <0 or 1> - equilibrate or not\n");
printf("\t-t <0 or 1> - solve transposed system or not\n");
exit(1);
break;
case 'l': *lwork = atoi(optarg);
break;
case 'u': *u = atof(optarg);
break;
case 'e': *equil = atoi(optarg);
break;
case 't': *trans = atoi(optarg);
break;
}
}
}
35 changes: 1 addition & 34 deletions EXAMPLE/clinsolx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ at the top-level directory.
#include <getopt.h>
#include "slu_cdefs.h"

void parse_command_line(int argc, char *argv[], int *lwork,
float *u, yes_no_t *equil, trans_t *trans);

int main(int argc, char *argv[])
{
/*!
Expand Down Expand Up @@ -96,7 +93,7 @@ int main(int argc, char *argv[])
set_default_options(&options);

/* Can use command line input to modify the defaults. */
parse_command_line(argc, argv, &lwork, &u, &equil, &trans);
cparse_command_line(argc, argv, &lwork, &u, &equil, &trans);
options.Equil = equil;
options.DiagPivotThresh = u;
options.Trans = trans;
Expand Down Expand Up @@ -232,34 +229,4 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}

/*!
* \brief Parse command line options to get relaxed snode size, panel size, etc.
*/
void
parse_command_line(int argc, char *argv[], int *lwork,
float *u, yes_no_t *equil, trans_t *trans )
{
int c;
extern char *optarg;

while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) {
switch (c) {
case 'h':
printf("Options:\n");
printf("\t-l <int> - length of work[*] array\n");
printf("\t-u <int> - pivoting threshold\n");
printf("\t-e <0 or 1> - equilibrate or not\n");
printf("\t-t <0 or 1> - solve transposed system or not\n");
exit(1);
break;
case 'l': *lwork = atoi(optarg);
break;
case 'u': *u = atof(optarg);
break;
case 'e': *equil = atoi(optarg);
break;
case 't': *trans = atoi(optarg);
break;
}
}
}
36 changes: 1 addition & 35 deletions EXAMPLE/clinsolx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ at the top-level directory.
#include <getopt.h>
#include "slu_cdefs.h"

void parse_command_line(int argc, char *argv[], int *lwork,
float *u, yes_no_t *equil, trans_t *trans);

int main(int argc, char *argv[])
{
/*!
Expand Down Expand Up @@ -95,7 +92,7 @@ int main(int argc, char *argv[])
set_default_options(&options);

/* Can use command line input to modify the defaults. */
parse_command_line(argc, argv, &lwork, &u, &equil, &trans);
cparse_command_line(argc, argv, &lwork, &u, &equil, &trans);
options.Equil = equil;
options.DiagPivotThresh = u;
options.Trans = trans;
Expand Down Expand Up @@ -268,34 +265,3 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}

/*!
* \brief Parse command line options to get relaxed snode size, panel size, etc.
*/
void
parse_command_line(int argc, char *argv[], int *lwork,
float *u, yes_no_t *equil, trans_t *trans )
{
int c;
extern char *optarg;

while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) {
switch (c) {
case 'h':
printf("Options:\n");
printf("\t-l <int> - length of work[*] array\n");
printf("\t-u <int> - pivoting threshold\n");
printf("\t-e <0 or 1> - equilibrate or not\n");
printf("\t-t <0 or 1> - solve transposed system or not\n");
exit(1);
break;
case 'l': *lwork = atoi(optarg);
break;
case 'u': *u = atof(optarg);
break;
case 'e': *equil = atoi(optarg);
break;
case 't': *trans = atoi(optarg);
break;
}
}
}
35 changes: 1 addition & 34 deletions EXAMPLE/clinsolx3.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ at the top-level directory.
#include <getopt.h>
#include "slu_cdefs.h"

void parse_command_line(int argc, char *argv[], int *lwork,
float *u, yes_no_t *equil, trans_t *trans);

/*!
* \brief The driver program CLINSOLX3.
*
Expand Down Expand Up @@ -95,7 +92,7 @@ int main(int argc, char *argv[])
set_default_options(&options);

/* Can use command line input to modify the defaults. */
parse_command_line(argc, argv, &lwork, &u, &equil, &trans);
cparse_command_line(argc, argv, &lwork, &u, &equil, &trans);
options.Equil = equil;
options.DiagPivotThresh = u;
options.Trans = trans;
Expand Down Expand Up @@ -265,34 +262,4 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}

/*
* Parse command line options to get relaxed snode size, panel size, etc.
*/
void
parse_command_line(int argc, char *argv[], int *lwork,
float *u, yes_no_t *equil, trans_t *trans )
{
int c;
extern char *optarg;

while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) {
switch (c) {
case 'h':
printf("Options:\n");
printf("\t-l <int> - length of work[*] array\n");
printf("\t-u <int> - pivoting threshold\n");
printf("\t-e <0 or 1> - equilibrate or not\n");
printf("\t-t <0 or 1> - solve transposed system or not\n");
exit(1);
break;
case 'l': *lwork = atoi(optarg);
break;
case 'u': *u = atof(optarg);
break;
case 'e': *equil = atoi(optarg);
break;
case 't': *trans = atoi(optarg);
break;
}
}
}
37 changes: 1 addition & 36 deletions EXAMPLE/dlinsolx.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ at the top-level directory.
#include <getopt.h>
#include "slu_ddefs.h"

void parse_command_line(int argc, char *argv[], int *lwork,
double *u, yes_no_t *equil, trans_t *trans);

int main(int argc, char *argv[])
{
char equed[1];
Expand Down Expand Up @@ -85,7 +82,7 @@ int main(int argc, char *argv[])
set_default_options(&options);

/* Can use command line input to modify the defaults. */
parse_command_line(argc, argv, &lwork, &u, &equil, &trans);
dparse_command_line(argc, argv, &lwork, &u, &equil, &trans);
options.Equil = equil;
options.DiagPivotThresh = u;
options.Trans = trans;
Expand Down Expand Up @@ -205,35 +202,3 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}


/*!
* \brief Parse command line inputs.
*/
void
parse_command_line(int argc, char *argv[], int_t *lwork,
double *u, yes_no_t *equil, trans_t *trans )
{
int c;
extern char *optarg;

while ( (c = getopt(argc, argv, "hl:w:r:u:f:t:p:e:")) != EOF ) {
switch (c) {
case 'h':
printf("Options:\n");
printf("\t-l <int> - length of work[*] array\n");
printf("\t-u <int> - pivoting threshold\n");
printf("\t-e <0 or 1> - equilibrate or not\n");
printf("\t-t <0 or 1> - solve transposed system or not\n");
exit(1);
break;
case 'l': *lwork = atoi(optarg);
break;
case 'u': *u = atof(optarg);
break;
case 'e': *equil = atoi(optarg);
break;
case 't': *trans = atoi(optarg);
break;
}
}
}
35 changes: 1 addition & 34 deletions EXAMPLE/dlinsolx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ at the top-level directory.
#include <getopt.h>
#include "slu_ddefs.h"

void parse_command_line(int argc, char *argv[], int *lwork,
double *u, yes_no_t *equil, trans_t *trans);

int main(int argc, char *argv[])
{
/*!
Expand Down Expand Up @@ -96,7 +93,7 @@ int main(int argc, char *argv[])
set_default_options(&options);

/* Can use command line input to modify the defaults. */
parse_command_line(argc, argv, &lwork, &u, &equil, &trans);
dparse_command_line(argc, argv, &lwork, &u, &equil, &trans);
options.Equil = equil;
options.DiagPivotThresh = u;
options.Trans = trans;
Expand Down Expand Up @@ -232,34 +229,4 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}

/*!
* \brief Parse command line options to get relaxed snode size, panel size, etc.
*/
void
parse_command_line(int argc, char *argv[], int *lwork,
double *u, yes_no_t *equil, trans_t *trans )
{
int c;
extern char *optarg;

while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) {
switch (c) {
case 'h':
printf("Options:\n");
printf("\t-l <int> - length of work[*] array\n");
printf("\t-u <int> - pivoting threshold\n");
printf("\t-e <0 or 1> - equilibrate or not\n");
printf("\t-t <0 or 1> - solve transposed system or not\n");
exit(1);
break;
case 'l': *lwork = atoi(optarg);
break;
case 'u': *u = atof(optarg);
break;
case 'e': *equil = atoi(optarg);
break;
case 't': *trans = atoi(optarg);
break;
}
}
}
36 changes: 1 addition & 35 deletions EXAMPLE/dlinsolx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ at the top-level directory.
#include <getopt.h>
#include "slu_ddefs.h"

void parse_command_line(int argc, char *argv[], int *lwork,
double *u, yes_no_t *equil, trans_t *trans);

int main(int argc, char *argv[])
{
/*!
Expand Down Expand Up @@ -95,7 +92,7 @@ int main(int argc, char *argv[])
set_default_options(&options);

/* Can use command line input to modify the defaults. */
parse_command_line(argc, argv, &lwork, &u, &equil, &trans);
dparse_command_line(argc, argv, &lwork, &u, &equil, &trans);
options.Equil = equil;
options.DiagPivotThresh = u;
options.Trans = trans;
Expand Down Expand Up @@ -268,34 +265,3 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}

/*!
* \brief Parse command line options to get relaxed snode size, panel size, etc.
*/
void
parse_command_line(int argc, char *argv[], int *lwork,
double *u, yes_no_t *equil, trans_t *trans )
{
int c;
extern char *optarg;

while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) {
switch (c) {
case 'h':
printf("Options:\n");
printf("\t-l <int> - length of work[*] array\n");
printf("\t-u <int> - pivoting threshold\n");
printf("\t-e <0 or 1> - equilibrate or not\n");
printf("\t-t <0 or 1> - solve transposed system or not\n");
exit(1);
break;
case 'l': *lwork = atoi(optarg);
break;
case 'u': *u = atof(optarg);
break;
case 'e': *equil = atoi(optarg);
break;
case 't': *trans = atoi(optarg);
break;
}
}
}
Loading

0 comments on commit 7a05fcb

Please sign in to comment.