Actual source code: dlregis.c

      1: /*$Id: dlregis.c 1.13 04/03/01 16:51:48-06:00 sarich@lully.mcs.anl.gov $*/

      3: #include "tao_solver.h"

      8: /*
      9:   DLLibraryRegister - This function is called when the dynamic library it is in is opened.

     11:   This registers all of the TAO methods that are in the basic libtao library.

     13:   Input Parameter:
     14:   path - library path
     15:  */
     16: int DLLibraryRegister(const char *path)
     17: {
     18:   int info;
     19:   TaoFunctionBegin;

     21: #ifdef TAO_USE_PETSC
     22:   info = PetscInitializeNoArguments(); if (info) return 1;
     23: #endif

     25:   /*
     26:       If we got here then PETSc was properly loaded
     27:   */
     28:   info = TaoRegisterAll(path);CHKERRQ(info);
     29:   TaoFunctionReturn(0);
     30: }

     33: /* --------------------------------------------------------------------------*/
     34: static const char *contents = "TAO unconstrained minimization library. \n\
     35:      limited memory variable metric method\n\
     36:      line search Newton method\n\
     37:      trust region Newton method\n";

     39: static const char *authors = TAO_AUTHOR_INFO;
     40: static const char *version = TAO_VERSION_NUMBER;

     42: /* --------------------------------------------------------------------------*/
     46: int DLLibraryInfo(const char *path,const char *type,const char **mess)
     47: {
     48:   int        info;
     49:   TaoTruth iscon,isaut,isver;

     51:   TaoFunctionBegin;

     53:   info = TaoStrcmp(type,"Contents",&iscon);CHKERRQ(info);
     54:   info = TaoStrcmp(type,"Authors",&isaut);CHKERRQ(info);
     55:   info = TaoStrcmp(type,"Version",&isver);CHKERRQ(info);
     56:   if (iscon)      *mess = contents;
     57:   else if (isaut) *mess = authors;
     58:   else if (isver) *mess = version;
     59:   else            *mess = 0;
     60:   TaoFunctionReturn(0);
     61: }