Example #1
0
int main(int argc, char **argv)
{
  int opt;
  int N = 787;
  int M = 741;
  int LB = 36;
  int verbose = 1;

  while ((opt = getopt(argc, argv, "v")) != -1) {
    switch (opt) {
    case 'v':
      verbose += 1;
      break;
    default:
      fprintf(stderr, "usage: %s [-v] [M N LB]\n", NAME);
      exit(1);
    }
  }
    
  if (optind < argc-2) {
    M = atoi(argv[optind]);
    N = atoi(argv[optind+1]);
    LB = atoi(argv[optind+2]);
  } else if (optind < argc-1) {
    N = atoi(argv[optind]);
    M = N;
    LB = atoi(argv[optind+1]);
  } else if (optind < argc) {
    N = atoi(argv[optind]);
    M = N; LB = 0;
  }

  int fails = 0;

  if (! test_build(M, N, M, LB, verbose))
    fails += 1;
  if (! test_build(M, N, M/2, LB, verbose))
    fails += 1;

  if (! test_build_identity(M, N, M, 0, verbose))
    fails += 1;
  if (! test_build_identity(M, N, M/2, 0, verbose))
    fails += 1;

  if (! test_build_identity(M, N, M, LB, verbose))
    fails += 1;
  if (! test_build_identity(M, N, M/2, LB, verbose))
    fails += 1;

  exit(fails);
}
Example #2
0
int main(int argc, char **argv)
{
  int opt;
  //int M = 787;
  int N = 741;
  int LB = 64;
  int verbose = 1;

  while ((opt = getopt(argc, argv, "v")) != -1) {
    switch (opt) {
    case 'v':
      verbose += 1;
      break;
    default:
      fprintf(stderr, "usage: %s [-v] [M N LB]\n", NAME);
      exit(1);
    }
  }
    
  if (optind < argc-1) {
    N = atoi(argv[optind]);
    LB = atoi(argv[optind+1]);
  } else if (optind < argc) {
    N = atoi(argv[optind]);
    LB = 0;
  }

  int fails = 0;

  if (! test_reduce(N, N, LB, verbose, ARMAS_LOWER))
    fails++;
  if (! test_reduce(N, N, LB, verbose, ARMAS_UPPER))
    fails++;
  if (! test_mult_trd(N, N, LB, verbose, ARMAS_LOWER))
    fails++;
  if (! test_mult_trd(N, N, LB, verbose, ARMAS_UPPER))
    fails++;
  if (! test_mult_a(N, N, LB, verbose, ARMAS_LOWER))
    fails++;
  if (! test_mult_a(N, N, LB, verbose, ARMAS_UPPER))
    fails++;
  if (! test_build(N, N, LB, N/2, verbose, ARMAS_LOWER))
    fails++;
  if (! test_build(N, N, LB, N/2, verbose, ARMAS_UPPER))
    fails++;

  exit(fails);
}
Example #3
0
int main(int argc, char* argv[])
{
	int   ch;

	while ((ch = getopt(argc, argv, "h")) > 0)
	{
		switch (ch)
		{
		case 'h':
			usage(argv[0]);
			return 0;
		default:
			break;
		}
	}

	test_build();
	return 0;
}