Ejemplo n.º 1
0
/*--------------- main routine ---------------*/
int main( int argc, char *argv[] )
{
   options_t * opts = &g_opts;
   int         rv;

   if( argc < 2 ) { show_help();  return 0; }

   mainENTRY("3dTto1D main"); machdep(); AFNI_logger("3dTto1D",argc,argv);

   /* process command line arguments (and read dataset and mask) */
   rv = process_opts(opts, argc, argv);
   if( rv ) RETURN(rv < 0); /* only a negative return is considered failure */

   if( check_dims(opts) ) RETURN(1);

   /* evaluation of rv now depends on the method, usually non-zero is bad */
   rv = compute_results(opts);

   /* for 4095_warn, return now, regardless */
   if( opts->method == T21_METH_4095_WARN ) RETURN(rv);

   /* otherwise, any non-zero return is a failure */
   if ( rv ) RETURN(1);

   if( write_results(opts) ) RETURN(1);

   RETURN(0);
}
Ejemplo n.º 2
0
int solve(void)
{
	int i ;

#if 1
  md_idiotproof_nodes();
#endif

#if 1
  md_reduce_coords();
#endif

	if (n_len < 2) { return(ERR); }
	if (e_len < 1) { return(ERR); }

  md_alloc_stuff();
  
  for (i=0; i<e_len; i++) { compute_KeFe(i); }
	
#ifdef DEVEL_VERBOSE
  md_K_prn();
  md_F_prn();
  md_U_prn();
#endif

  md_add_disps_and_loads();

#if 1
  md_idiotproof_hinges();
#endif

  if (md_solve_eqs() != OK)
	{
#ifdef DEVEL_VERBOSE
		fprintf(stderr, "Solution failed!\n");
    md_K_prn();
#endif
    md_free_stuff();
		return(ERR);
	}
#ifdef DEVEL_VERBOSE
	else { fprintf(stderr, "Solution done!\n"); }
#endif

#ifdef DEVEL_VERBOSE
  md_U_prn();
#endif

  compute_results();

  md_free_stuff();

  return(OK);
}