Changeset 6152


Ignore:
Timestamp:
12/11/08 13:14:09 (5 years ago)
Author:
wehart
Message:

Merged revisions 6024-6151 via svnmerge from
 https://software.sandia.gov/svn/public/acro/acro-root/trunk

........

r6035 | wehart | 2008-12-07 19:07:51 -0700 (Sun, 07 Dec 2008) | 3 lines


Adding acro-parpcx to the set of acro-limited projects that are
recognized by svn.a

........

r6068 | lafisk | 2008-12-08 14:05:24 -0700 (Mon, 08 Dec 2008) | 2 lines


copy of change made in top/configure.ac

........

r6074 | lafisk | 2008-12-09 09:38:06 -0700 (Tue, 09 Dec 2008) | 2 lines


fix path to cp_u

........

r6079 | wehart | 2008-12-09 15:22:40 -0700 (Tue, 09 Dec 2008) | 2 lines


Bug fix in IO during 'make python'

........

r6085 | lafisk | 2008-12-10 09:35:58 -0700 (Wed, 10 Dec 2008) | 4 lines


be sure to always define make file conditional USE_GMP_LIB
ticket #4290

........

r6092 | wehart | 2008-12-10 14:52:19 -0700 (Wed, 10 Dec 2008) | 2 lines


Reworking Python installation to check for whether acro/python exists.

........

r6101 | lafisk | 2008-12-10 15:49:26 -0700 (Wed, 10 Dec 2008) | 2 lines


fix bootstrap/packages packages mismatch

........

r6110 | wehart | 2008-12-10 16:35:41 -0700 (Wed, 10 Dec 2008) | 2 lines


Change that hopefully will fix tinyxml tests.

........

r6113 | jdsiiro | 2008-12-10 17:04:46 -0700 (Wed, 10 Dec 2008) | 3 lines


  • removing colin/colin.h
  • updating userapps/colin_hj example to match current Hooke in interfaces

........

r6116 | wehart | 2008-12-10 18:48:03 -0700 (Wed, 10 Dec 2008) | 2 lines


bug fix

........

r6151 | wehart | 2008-12-11 11:40:49 -0700 (Thu, 11 Dec 2008) | 4 lines


Removing the 'release-links' line.
Added further diagnosis information about the updates that are available.

........

Location:
acro-root/stable/1.3
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • acro-root/stable/1.3

  • acro-root/stable/1.3/admin/checks

    r6024 r6152  
    1515   echo "   svn-summary   - summary of Acro-related repositories" 
    1616   echo "   stable-links  - update stable links" 
    17    echo "   release-links - update release links" 
    1817   echo "" 
    1918   exit 1; 
     
    117116if [ "$1" == "stable-links" ]; then 
    118117   echo "Creating stable directories in svn_stable ..." 
    119    bin/update_externals --stable --remove --dir svn_stable --aux https://software.sandia.gov/svn/public/sacache --aux https://software.sandia.gov/svn/public/pyutilib --aux https://software.sandia.gov/svn/public/optpp/optpp --aux https://software.sandia.gov/svn/public/fast --aux https://software.sandia.gov/svn/public/exact --aux https://software.sandia.gov/svn/public/utilib --aux https://software.sandia.gov/svn/public/tpl --aux https://software.sandia.gov/svn/public/cxxtest/ --aux https://software.sandia.gov/svn/public/coopr --aux https://software.sandia.gov/svn/public/appspack https://software.sandia.gov/svn/public/acro > check.log 2>&1 
     118   bin/update_externals --remove --dir svn_stable --aux https://software.sandia.gov/svn/public/sacache --aux https://software.sandia.gov/svn/public/pyutilib --aux https://software.sandia.gov/svn/public/optpp/optpp --aux https://software.sandia.gov/svn/public/fast --aux https://software.sandia.gov/svn/public/exact --aux https://software.sandia.gov/svn/public/utilib --aux https://software.sandia.gov/svn/public/tpl --aux https://software.sandia.gov/svn/public/cxxtest/ --aux https://software.sandia.gov/svn/public/coopr --aux https://software.sandia.gov/svn/public/appspack https://software.sandia.gov/svn/public/acro > check.log 2>&1 
    120119   echo "Done." 
    121120   echo "Review check.log for details of the updates." 
     121   echo "" 
     122   echo "Subversion status summary" 
     123   cd svn_stable 
     124   for i in $( ls ); do  
     125     echo " FILE: $i" 
     126     svn status -q $i 
     127   done 
    122128   echo "" 
    123129   echo "You must manually commit the edits in the svn_stable subdirectories!" 
  • acro-root/stable/1.3/bootstrap/packages/Makefile.am

    r5988 r6152  
    6666endif 
    6767 
    68 COPY=$(top_srcdir)/bin/cp_u 
     68COPY=@abs_top_srcdir@/bin/cp_u 
    6969 
    7070## acro user teva-spot does out-of-source builds, so we want the 
     
    7474 
    7575python: 
    76         @if test -d ../python/dist; then : ; else mkdir ../python/dist; fi 
    77         @for dir in pyutilib fast coopr ; do\ 
     76        @if test -d ../python; then \ 
     77        if test -d ../python/dist; then : ; else mkdir ../python/dist; fi; \ 
     78        for dir in pyutilib fast coopr ; do\ 
    7879           if test -d $$dir ; then : ; else  \ 
    7980             cp -r ${srcdir}/$$dir . ;  \ 
    8081             rm -rf `find $$dir -name .svn` ;  \ 
    8182           fi ; \ 
    82          done 
    83         @for dir in pyutilib fast coopr ; do\ 
     83         done;\ 
     84        for dir in pyutilib fast coopr ; do\ 
    8485           if test -e $$dir/setup.py;  then \ 
    8586              cd $$dir;\ 
    8687              ../../python/bin/python$(EXEEXT) setup.py -q install ; \ 
    87               $(COPY) dist/*.egg ../../python/dist; \ 
    8888              cd ..;\ 
     89              $(COPY) $$dir/dist/*.egg ../python/dist; \ 
    8990           fi;\ 
    90         done 
    91         @rdir=`pwd`/..;\ 
    92         $(top_srcdir)/bin/install_pyscripts .. $$rdir 
    93         $(RM) ../bin/python$(EXEEXT) 
     91        done;\ 
     92        rdir=`pwd`/..;\ 
     93        $(top_srcdir)/bin/install_pyscripts .. $$rdir;\ 
     94        $(RM) ../bin/python$(EXEEXT);\ 
     95        else echo "ERROR: the Acro Python TPLs have failed to create a virtual Python installation in acro/python!"; echo "Cannot install Acro Python packages."; fi 
    9496 
    9597docs: 
  • acro-root/stable/1.3/bootstrap/root/configure.ac

    r5988 r6152  
    235235# Hard-coding UTILIB configuration 
    236236# 
    237 if test -d tpl/tinyxml ; then 
    238    pwd=`pwd` 
     237pwd=`pwd` 
     238if test -d $pwd/tpl/tinyxml; then 
    239239   new_configure_args="$ac_configure_args --with-tinyxml=$pwd/tpl/tinyxml" 
    240240   ac_configure_args="$new_configure_args" 
    241241fi 
    242 if test -d tpl/cxxtest ; then 
    243    pwd=`pwd` 
     242if test -d tpl/cxxtest; then 
    244243   new_configure_args="$ac_configure_args --with-cxxtest=$pwd/tpl/cxxtest" 
    245244   ac_configure_args="$new_configure_args" 
     
    889888      AC_CONFIG_FILES([tpl/glpk/Makefile:tpl/glpk/Makefile.in:packages/dummy/Makefile.in]) 
    890889   fi 
    891     # Will add -lgmp to LIBS if libgmp is found.  glpk library uses gmp if it is found, so 
    892     # when we build the solver (glpksol) using the library we need to add -lgmp 
    893  
    894     AC_SEARCH_LIBS([__gmp_randclear], [gmp], [GMP=yes], [GMP=no]) 
    895  
    896     if test GMP == yes ; then 
     890 
     891    # If libgmp is available, use it when we build glpk 
     892    AC_CHECK_LIB([gmp], [__gmp_randclear], [GMP="yes"], [GMP="no"]) 
     893      
     894    if test $GMP == "yes" ; then 
    897895      AC_MSG_NOTICE(["GLPK will use libgmp"]) 
     896      AM_CONDITIONAL(USE_GMP_LIB, true) 
    898897    else 
    899       AC_MSG_NOTICE(["GLPK will use NOT libgmp, it is not found"]) 
     898      AC_MSG_NOTICE(["GLPK will NOT use libgmp, it is not found"]) 
     899      AM_CONDITIONAL(USE_GMP_LIB, false) 
    900900    fi 
     901else 
     902    AM_CONDITIONAL(USE_GMP_LIB, false) 
    901903fi 
    902904 
  • acro-root/stable/1.3/userapps/colin_hj/Example.cpp

    r5284 r6152  
    11/*  _________________________________________________________________________ 
    22 * 
    3  *  Coliny: A Library of COLIN optimizers 
    4  *  Copyright (c) 2003, Sandia National Laboratories. 
    5  *  This software is distributed under the GNU Lesser General Public License. 
    6  *  For more information, see the README.html file in the top Coliny directory. 
     3 *  Acro: A Common Repository for Optimizers 
     4 *  Copyright (c) 2008 Sandia Corporation. 
     5 *  This software is distributed under the BSD License. 
     6 *  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 
     7 *  the U.S. Government retains certain rights in this software. 
     8 *  For more information, see the README.txt file in the top Acro directory. 
    79 *  _________________________________________________________________________ 
    810 */ 
    911 
    1012// 
    11 // Example.cpp 
     13// Hooke.cpp 
    1214// 
    1315 
    1416#include <acro_config.h> 
    15 #include <colin/Factory.h> 
    16 #include <colin/ConcreteOptSolverHandle.h> 
    17 #include <Example.h> 
     17#include <colin/SolverMngr.h> 
     18#include <interfaces/Hooke.h> 
    1819 
    1920using namespace std; 
     
    2122extern int hooke(int,double*,double*,double,double,int,int,double); 
    2223 
    23 namespace coliny { 
     24namespace interfaces { 
    2425 
    2526// 
    2627// Static data used to communicate with the C function 
    2728// 
    28 coliny::Hooke* Hooke::curr_solver = 0; 
     29Hooke* Hooke::curr_solver = 0; 
    2930 
    3031// 
     
    3334double Hooke::test_problem(double* x, int n) 
    3435{ 
    35 if (curr_solver->problem->enforcing_bounds()) { 
     36if (curr_solver->problem->enforcing_domain_bounds()) { 
    3637   for (int i=0; i<n; i++) { 
    3738     if ((curr_solver->lower[i] > x[i]) || 
     
    5152// 
    5253double hooke_func(double* x, int n) 
    53 { return coliny::Hooke::test_problem(x,n); } 
     54{ return interfaces::Hooke::test_problem(x,n); } 
    5455 
    55 namespace coliny { 
     56namespace interfaces { 
    5657 
    5758Hooke::Hooke() 
     59    : colin::Solver<colin::UNLP0_problem>(), 
     60      colin::CommonOptions(option) 
    5861{ 
    59 // 
    60 // Define the COLIN solver type 
    61 // 
    62 solver_type="Hooke"; 
    63 // 
    64 // Disable default COLIN solver parameters 
    65 // 
    66 disable_parameter("max_time"); 
    67 disable_parameter("ftol"); 
    68 disable_parameter("constraint_tolerance"); 
    69 disable_parameter("output_frequency"); 
    70 disable_parameter("output_flush"); 
    71 disable_parameter("output_final"); 
    72 disable_parameter("output_dynamic"); 
    73 disable_parameter("debug_opt_stats"); 
    74 disable_parameter("debug_all"); 
    75 disable_parameter("debug_best_point"); 
    76 disable_parameter("debug_num_evaluations"); 
    77 disable_parameter("debug_iteration_info"); 
    78 disable_parameter("debug_best"); 
    79 disable_parameter("debug_time"); 
     62reset_signal.connect( boost::bind( &Hooke::reset_Hooke, this ) ); 
    8063// 
    8164// Create a solver parameter for the contraction factor, rho 
    8265// 
    8366rho=0.5; 
    84 create_parameter("rho",rho, 
    85         "<double>","0.5", 
     67option.add("rho",rho, 
    8668        "Step length contraction factor"); 
    8769// 
     
    8971// 
    9072epsilon=1e-6; 
    91 create_parameter("min_step_length",epsilon, 
    92         "<double>","1e-6", 
     73option.add("min_step_length",epsilon, 
    9374        "The minimum step length"); 
     75 
     76option.enable("debug"); 
     77option.enable("max_iters"); 
     78option.enable("max_neval"); 
     79option.enable("accuracy"); 
    9480} 
    9581 
    9682 
    97 void Hooke::reset() 
     83void Hooke::reset_Hooke() 
    9884{ 
    99 if (!problem) 
     85if (problem.empty()) 
    10086   return; 
    10187 
    102 colin::StdOptSolver<utilib::BasicArray<double>,colin::UNLP0_problem>::reset(); 
    103  
    104 if (problem->numNonlinearEqConstraints() > 0) 
    105    EXCEPTION_MNGR(runtime_error, "Hooke::reset - " << problem->numNonlinearEqConstraints() << " equality constraints cannot be handled by hooke!"); 
    106  
    10788work_point.resize(problem->num_real_vars()); 
    108 if (problem->enforcing_bounds()) 
     89if (problem->enforcing_domain_bounds()) 
    10990   problem->get_real_bounds(lower,upper); 
    11091} 
    11192 
    11293 
    113 void Hooke::minimize() 
     94void Hooke::optimize() 
    11495{ 
    115 opt_init(); 
    116  
    11796int n=problem->num_real_vars(); 
    11897if (n == 0) { 
    119    best().termination_info = "No-Real-Params"; 
     98   solver_status.termination_info = "No-Real-Params"; 
     99   solver_status.model_status = colin::model_no_solution_returned; 
     100   solver_status.solver_status = colin::solver_terminated_by_solver; 
    120101   return; 
    121102   } 
    122  
     103// 
     104// Get the initial point 
     105// 
     106if ( initial_points->size( problem.application() ) == 0 ) { 
     107   solver_status.termination_info = "No-Initial-Point"; 
     108   solver_status.model_status = colin::model_no_solution_returned; 
     109   solver_status.solver_status = colin::solver_terminated_by_solver; 
     110   return; 
     111   } 
     112if ( initial_points->size( problem.application()) > 1 ) 
     113   DEBUGPR(1, ucout << "Warning: more than one initial point specified. Cobyla will only use the first point."); 
     114utilib::BasicArray<double> x(problem->num_real_vars()); 
     115initial_points.get_point(problem, x); 
     116if (x.size() != problem->num_real_vars()) 
     117   EXCEPTION_MNGR(std::runtime_error, "User-provided initial point has length " << x.size() << " but the problem size is " << problem->num_real_vars() << std::endl); 
     118// 
     119// Set the runtime limits 
     120// 
    123121int num_evals; 
    124122if (max_neval <= 0) 
     
    131129else 
    132130   num_iters = max_iters; 
    133  
     131// 
     132// Call the Hooke-Jeeves optimizer 
     133// 
    134134curr_solver = this; 
    135 utilib::BasicArray<double> final_point(initial_point.size()); 
    136 int status = hooke(n, initial_point.data(), final_point.data(), rho, epsilon, num_iters, num_evals, accuracy); 
     135utilib::BasicArray<double> final_point(x.size()); 
     136int status = hooke(n, x.data(), final_point.data(), rho, epsilon, num_iters, num_evals, accuracy); 
    137137// 
    138 // set the termination info 
     138// Setup the solver status 
    139139// 
    140140if (status == 0) { 
    141    best().termination_info="Max-Num-Iterations"; 
     141   solver_status.termination_info="Max-Num-Iterations"; 
     142   solver_status.model_status = colin::model_intermediate_nonoptimal; 
     143   solver_status.solver_status = colin::solver_normal_completion; 
     144   final_points.add_point(problem, final_point); 
    142145} 
    143146else if (status == 1) { 
    144    best().termination_info="Step-Length"; 
     147   solver_status.termination_info="Step-Length"; 
     148   solver_status.model_status = colin::model_intermediate_nonoptimal; 
     149   solver_status.solver_status = colin::solver_normal_completion; 
     150   final_points.add_point(problem, final_point); 
    145151} 
    146152else if (status == 2) { 
    147    best().termination_info="Accuracy"; 
     153   solver_status.termination_info="Accuracy"; 
     154   solver_status.model_status = colin::model_intermediate_nonoptimal; 
     155   solver_status.solver_status = colin::solver_normal_completion; 
     156   final_points.add_point(problem, final_point); 
    148157} 
    149158else if (status == 3) { 
    150    best().termination_info="Max-Num-Evals"; 
     159   solver_status.termination_info="Max-Num-Evals"; 
     160   solver_status.model_status = colin::model_intermediate_nonoptimal; 
     161   solver_status.solver_status = colin::solver_normal_completion; 
     162   final_points.add_point(problem, final_point); 
    151163} 
    152 else 
    153    best().termination_info="Unknown"; 
     164else { 
     165   stringstream tmp; 
     166   tmp << "Unknown return code: " << status; 
     167   solver_status.termination_info=tmp.str(); 
     168   solver_status.model_status = colin::model_no_solution_returned; 
     169   solver_status.solver_status = colin::solver_error_internal_solver_error; 
     170} 
     171} 
    154172 
    155 // 
    156 // Capture the best point and re-revaluate it 
    157 // 
    158 best().point = final_point; 
    159 colin::AppRequest request = problem->set_domain(final_point, best().response); 
    160 problem->Request_F(request, best().value()); 
    161 eval_mngr().perform_evaluation(request); 
    162 } 
     173REGISTER_COLIN_SOLVER_WITH_ALIAS(Hooke, "hj:Hooke", "hj:hj", "The Hooke-Jeeves derivative-free optimizer") 
    163174 
    164175} 
    165176 
    166 // 
    167 // Register Hooke for the COLIN optimizer factory 
    168 // 
    169 FACTORY_REGISTER(hj, colin::OptSolverHandle*, 
    170                 return new colin::ConcreteOptSolverHandle<coliny::Hooke>;, 
    171                 "An alias to Hooke") 
    172 FACTORY_REGISTER(Hooke, colin::OptSolverHandle*, 
    173                 return new colin::ConcreteOptSolverHandle<coliny::Hooke>;, 
    174                 "The Hooke-Jeeves derivative-free optimizer") 
  • acro-root/stable/1.3/userapps/colin_hj/Example.h

    r5284 r6152  
    11/*  _________________________________________________________________________ 
    22 * 
    3  *  Coliny: A Library of COLIN optimizers 
    4  *  Copyright (c) 2003, Sandia National Laboratories. 
    5  *  This software is distributed under the GNU Lesser General Public License. 
    6  *  For more information, see the README.html file in the top Coliny directory. 
     3 *  Acro: A Common Repository for Optimizers 
     4 *  Copyright (c) 2008 Sandia Corporation. 
     5 *  This software is distributed under the BSD License. 
     6 *  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 
     7 *  the U.S. Government retains certain rights in this software. 
     8 *  For more information, see the README.txt file in the top Acro directory. 
    79 *  _________________________________________________________________________ 
    810 */ 
     
    1113 * \file Hooke.h 
    1214 * 
    13  * Defines the coliny::Hooke class. 
     15 * Defines the interfaces::Hooke class. 
    1416 */ 
    1517 
    16 #ifndef coliny_Hooke_h 
    17 #define coliny_Hooke_ 
     18#ifndef interfaces_Hooke_h 
     19#define intefaces_Hooke_h 
    1820 
    1921#include <acro_config.h> 
    20 #include <colin/colin.h> 
    21 #include <colin/StdOptSolver.h> 
     22#ifdef ACRO_USING_THREEPO 
     23#include <colin/Solver.h> 
     24#include <colin/CommonOptions.h> 
    2225 
    23 namespace coliny { 
     26namespace interfaces { 
    2427 
    2528/** An interface to the hooke direct search method. 
    2629  */ 
    27 class Hooke : public colin::StdOptSolver<utilib::BasicArray<double>,colin::UNLP0_problem> 
     30class Hooke : public colin::Solver<colin::UNLP0_problem>, 
     31              public colin::CommonOptions 
    2832{ 
    2933public: 
     
    3337 
    3438  /// 
    35   void reset(); 
    36  
    37   /// 
    38   void minimize(); 
     39  void optimize(); 
    3940 
    4041  /// 
     
    4445 
    4546  /// 
    46   void initialize_best_point() 
    47         { 
    48         if ((initial_point.size() > 0) && 
    49             (initial_point.size() != problem->num_real_vars())) 
    50            EXCEPTION_MNGR(std::runtime_error, "initialize_best_point - user-provided best point has length " << initial_point.size() << " but the problem size is " << problem->num_real_vars() << std::endl); 
    51         initial_point.resize(problem->num_real_vars()); 
    52         } 
     47  std::string define_solver_type() const 
     48    { return "Hooke"; } 
    5349 
    5450  /// 
     
    7268  /// 
    7369  static Hooke* curr_solver; 
     70 
     71private: 
     72 
     73  /// 
     74  void reset_Hooke(); 
     75 
    7476}; 
    7577 
    76 } // namespace coliny 
     78} // namespace interfaces 
    7779#endif 
     80#endif 
  • acro-root/stable/1.3/userapps/colin_hj/README

    r4886 r6152  
    55**      This example illustrates the process of extending COLIN to add 
    66**      a user-defined optimizer.  In this example, this is the 'hooke()' 
    7 **      optimizer, which is wrapped with the coliny::Hooke class. 
     7**      optimizer, which is wrapped with the interfaces::Hooke class. 
    88** 
    99**      Note: the hooke() function is included in the lib3po.a library. 
    1010** 
    11 **      Note: this example mirrors the coliny::Hooke solver that is included 
    12 **      in Coliny. 
     11**      Note: this example mirrors the interfaces::Hooke solver that is 
     12**      included in the Interfaces library. 
    1313** 
    1414************************************************************************ 
Note: See TracChangeset for help on using the changeset viewer.