コード例 #1
0
ファイル: cmain.c プロジェクト: bubuker/keggle_santa
/** main method starting SCIP */
int main(
   int                        argc,          /**< number of arguments from the shell */
   char**                     argv           /**< array of shell arguments */
   )
{
   SCIP_RETCODE retcode;
   SCIP_Bool interactive;
   const char* setfile;
   int i;

   assert(argc >= 1);
   if( argc == 1 )
   {
      SCIP* scip;

      SCIP_CALL_ABORT( SCIPcreate(&scip) );
      SCIPprintVersion(scip, NULL);
      printf("\n");
      SCIP_CALL_ABORT( SCIPfree(&scip) );

      printf("Usage: %s <nl-file> { [-AMPL] | [<settings-file>] | -i }\n", argv[0]);
      printf("\n");
      printf("       -i starts the SCIP shell after reading settings and .nl file, instead of starting the SCIP solve\n");

      return 0;
   }

   /* check command line arguments after .nl file */
   interactive = FALSE;
   setfile = NULL;
   for( i = 2; i < argc; ++i )
   {
      if( strcmp(argv[i], "-AMPL") == 0 )
         continue;

      if( strcmp(argv[i], "-i") == 0 )
      {
         interactive = TRUE;
         continue;
      }

      setfile = argv[i];
   }

   if( setfile == NULL && SCIPfileExists("scip.set") )
      setfile = "scip.set";

   retcode = run(argv[1], setfile, interactive);

   /* evaluate retrun code of the SCIP process */
   if( retcode != SCIP_OKAY )
   {
      /* write error back trace */
      SCIPprintError(retcode);
      return -1;
   }

   return 0;
}
コード例 #2
0
ファイル: cppmain.cpp プロジェクト: fischer-gsc/hi
/** reads parameters */
static
SCIP_RETCODE readParams(
   SCIP*                      scip,               /**< SCIP data structure */
   const char*                filename            /**< parameter file name, or NULL */
   )
{
   if( filename != NULL )
   {
      if( SCIPfileExists(filename) )
      {
         std::cout << "reading parameter file <" << filename << ">" << std::endl;
         SCIP_CALL( SCIPreadParams(scip, filename) );
      }
      else
         std::cout << "parameter file <" << filename << "> not found - using default parameters" << std::endl;
   }
   else if( SCIPfileExists("scipmip.set") )
   {
      std::cout << "reading parameter file <scipmip.set>" << std::endl;
      SCIP_CALL( SCIPreadParams(scip, "scipmip.set") );
   }

   return SCIP_OKAY;
}
コード例 #3
0
ファイル: main.c プロジェクト: aimanqais/gerardus
/** read in parameter file */
static
SCIP_RETCODE readParams(
   SCIP*                 scip,               /**< SCIP data structure */
   const char*           filename            /**< parameter file name */
   )
{
   if( SCIPfileExists(filename) )
   {
      SCIPinfoMessage(scip, NULL, "reading user parameter file <%s>\n", filename);
      SCIP_CALL( SCIPreadParams(scip, filename) );
   }
   else
      SCIPinfoMessage(scip, NULL, "user parameter file <%s> not found - using default parameters\n", filename);

   return SCIP_OKAY;
}