Changeset 1982


Ignore:
Timestamp:
Apr 13, 2011 7:55:57 PM (9 years ago)
Author:
hpirnay
Message:

Adapted includes to sIPOPT file name changes. Some cleanup

Location:
trunk/Ipopt/contrib/sIPOPT
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ipopt/contrib/sIPOPT/AmplSolver/AsAmplNmpcTNLP.cpp

    r1975 r1982  
    77
    88#include "AsAmplNmpcTNLP.hpp"
    9 #include "AsNmpcUtils.hpp"
     9#include "SensUtils.hpp"
    1010#include "IpDenseVector.hpp"
    1111#include "IpIteratesVector.hpp"
  • trunk/Ipopt/contrib/sIPOPT/AmplSolver/ampl_nmpc.cpp

    r1960 r1982  
    77#include "AsAmplNmpcTNLP.hpp"
    88#include "IpIpoptApplication.hpp"
    9 #include "AsNMPCApplication.hpp"
     9#include "SensApplication.hpp"
    1010#include "IpPDSearchDirCalc.hpp"
    1111#include "IpIpoptAlg.hpp"
    12 #include "AsAsNMPCRegOp.hpp"
     12#include "SensRegOp.hpp"
    1313
    1414
     
    3535    exit(-100);
    3636  }
    37    
     37
    3838  app_ipopt->Initialize();
    3939
     
    8989    suffix_handler->AddAvailableSuffix(sol_state_zL, AmplSuffixHandler::Variable_Source, AmplSuffixHandler::Number_Type);
    9090    suffix_handler->AddAvailableSuffix(sol_state_zU, AmplSuffixHandler::Variable_Source, AmplSuffixHandler::Number_Type);
    91    
     91
    9292  }
    9393
     
    101101                                   AmplOptionsList::String_Option,
    102102                                   "Set to yes if nmpc algorithm should be run.");
    103   ampl_options_list->AddAmplOption("compute_red_hessian", "compute_red_hessian", 
     103  ampl_options_list->AddAmplOption("compute_red_hessian", "compute_red_hessian",
    104104                                   AmplOptionsList::String_Option,
    105105                                   "Set to yes if reduced hessian should be computed.");
  • trunk/Ipopt/contrib/sIPOPT/examples/parametric_cpp/parametric_driver.cpp

    r1959 r1982  
    88
    99#include "IpIpoptApplication.hpp"
    10 #include "AsNMPCApplication.hpp"
     10#include "SensApplication.hpp"
    1111#include "IpPDSearchDirCalc.hpp"
    1212#include "IpIpoptAlg.hpp"
    13 #include "AsAsNMPCRegOp.hpp"
     13#include "SensRegOp.hpp"
    1414
    1515int main(int argv, char**argc)
  • trunk/Ipopt/contrib/sIPOPT/examples/redhess_cpp/redhess_cpp.cpp

    r1861 r1982  
    88
    99#include "IpIpoptApplication.hpp"
    10 #include "AsNMPCApplication.hpp"
     10#include "SensApplication.hpp"
    1111#include "IpPDSearchDirCalc.hpp"
    1212#include "IpIpoptAlg.hpp"
    13 #include "AsAsNMPCRegOp.hpp"
     13#include "SensRegOp.hpp"
    1414
    1515int main(int argv, char**argc)
     
    3737  }
    3838
    39    
     39
    4040  app_ipopt->Initialize();
    4141
  • trunk/Ipopt/contrib/sIPOPT/src/Makefile.am

    r1964 r1982  
    1313
    1414libsipopt_la_SOURCES = \
    15         AsAsBacksolver.hpp \
    16         AsAsNmpController.cpp \
    17         AsAsNmpController.hpp \
    18         AsAsNMPCRegOp.cpp \
    19         AsAsNMPCRegOp.hpp \
    20         AsDenseGenSchurDriver.cpp \
    21         AsDenseGenSchurDriver.hpp \
    22         AsIFTSchurDriver.cpp \
    23         AsIFTSchurDriver.hpp \
    24         AsIndexPCalculator.cpp \
    25         AsIndexPCalculator.hpp \
    26         AsIndexSchurData.cpp \
    27         AsIndexSchurData.hpp \
    28         AsMeasurement.hpp \
    29         AsMetadataMeasurement.cpp \
    30         AsMetadataMeasurement.hpp \
    31         AsNMPCApplication.cpp \
    32         AsNMPCApplication.hpp \
    33         AsNmpcUtils.cpp \
    34         AsNmpcUtils.hpp \
    35         AsPCalculator.hpp \
    36         AsReducedHessianCalculator.cpp \
    37         AsReducedHessianCalculator.hpp \
    38         AsSchurBuilder.cpp \
    39         AsSchurBuilder.hpp \
    40         AsSchurData.hpp \
    41         AsSchurDriver.hpp \
    42         AsSensStepCalc.hpp \
    43         AsSimpleBacksolver.cpp \
    44         AsSimpleBacksolver.hpp \
    45         AsStdPCalculator.cpp \
    46         AsStdPCalculator.hpp \
    47         AsStdSchurData.cpp \
    48         AsStdSchurData.hpp \
    49         AsStdStepCalc.cpp \
    50         AsStdStepCalc.hpp \
    51         AsSuffixHandler.hpp
     15        SensBacksolver.hpp \
     16        SensAlgorithm.cpp \
     17        SensAlgorithm.hpp \
     18        SensRegOp.cpp \
     19        SensRegOp.hpp \
     20        SensDenseGenSchurDriver.cpp \
     21        SensDenseGenSchurDriver.hpp \
     22        SensIndexPCalculator.cpp \
     23        SensIndexPCalculator.hpp \
     24        SensIndexSchurData.cpp \
     25        SensIndexSchurData.hpp \
     26        SensMeasurement.hpp \
     27        SensMetadataMeasurement.cpp \
     28        SensMetadataMeasurement.hpp \
     29        SensApplication.cpp \
     30        SensApplication.hpp \
     31        SensUtils.cpp \
     32        SensUtils.hpp \
     33        SensPCalculator.hpp \
     34        SensReducedHessianCalculator.cpp \
     35        SensReducedHessianCalculator.hpp \
     36        SensBuilder.cpp \
     37        SensBuilder.hpp \
     38        SensSchurData.hpp \
     39        SensSchurDriver.hpp \
     40        SensStepCalc.hpp \
     41        SensSimpleBacksolver.cpp \
     42        SensSimpleBacksolver.hpp \
     43        SensStdStepCalc.cpp \
     44        SensStdStepCalc.hpp \
     45        SensSuffixHandler.hpp
    5246
    5347libsipopt_la_LDFLAGS = $(LT_LDFLAGS)
     
    7367
    7468ASTYLE_FILES = \
    75         AsAsBacksolver.hppbak \
    76         AsAsNmpController.cppbak \
    77         AsAsNmpController.hppbak \
    78         AsAsNMPCRegOp.cppbak \
    79         AsAsNMPCRegOp.hppbak \
    80         AsDenseGenSchurDriver.cppbak \
    81         AsDenseGenSchurDriver.hppbak \
    82         AsIFTSchurDriver.cppbak \
    83         AsIFTSchurDriver.hppbak \
    84         AsIndexPCalculator.cppbak \
    85         AsIndexPCalculator.hppbak \
    86         AsIndexSchurData.cppbak \
    87         AsIndexSchurData.hppbak \
    88         AsMeasurement.hppbak \
    89         AsMetadataMeasurement.cppbak \
    90         AsMetadataMeasurement.hppbak \
    91         AsNMPCAppbaklication.cppbak \
    92         AsNMPCAppbaklication.hppbak \
    93         AsNmpcUtils.cppbak \
    94         AsNmpcUtils.hppbak \
    95         AsPCalculator.hppbak \
    96         AsReducedHessianCalculator.cppbak \
    97         AsReducedHessianCalculator.hppbak \
    98         AsSchurBuilder.cppbak \
    99         AsSchurBuilder.hppbak \
    100         AsSchurData.hppbak \
    101         AsSchurDriver.hppbak \
    102         AsSensStepCalc.hppbak \
    103         AsSimpleBacksolver.cppbak \
    104         AsSimpleBacksolver.hppbak \
    105         AsStdPCalculator.cppbak \
    106         AsStdPCalculator.hppbak \
    107         AsStdSchurData.cppbak \
    108         AsStdSchurData.hppbak \
    109         AsStdStepCalc.cppbak \
    110         AsStdStepCalc.hppbak \
    111         AsSuffixHandler.hppbak
     69        SensBacksolver.hppbak \
     70        SensAlgorithm.cppbak \
     71        SensAlgorithm.hppbak \
     72        SensRegOp.cppbak \
     73        SensRegOp.hppbak \
     74        SensDenseGenSchurDriver.cppbak \
     75        SensDenseGenSchurDriver.hppbak \
     76        SensIndexPCalculator.cppbak \
     77        SensIndexPCalculator.hppbak \
     78        SensIndexSchurData.cppbak \
     79        SensIndexSchurData.hppbak \
     80        SensMeasurement.hppbak \
     81        SensMetadataMeasurement.cppbak \
     82        SensMetadataMeasurement.hppbak \
     83        SensApplication.cppbak \
     84        SensApplication.hppbak \
     85        SensUtils.cppbak \
     86        SensUtils.hppbak \
     87        SensPCalculator.hppbak \
     88        SensReducedHessianCalculator.cppbak \
     89        SensReducedHessianCalculator.hppbak \
     90        SensBuilder.cppbak \
     91        SensBuilder.hppbak \
     92        SensSchurData.hppbak \
     93        SensSchurDriver.hppbak \
     94        SensStepCalc.hppbak \
     95        SensSimpleBacksolver.cppbak \
     96        SensSimpleBacksolver.hppbak \
     97        SensStdStepCalc.cppbak \
     98        SensStdStepCalc.hppbak \
     99        SensSuffixHandler.hppbak
    112100
    113101ASTYLE = @ASTYLE@
  • trunk/Ipopt/contrib/sIPOPT/src/Makefile.in

    r1979 r1982  
    6363LTLIBRARIES = $(lib_LTLIBRARIES)
    6464libsipopt_la_LIBADD =
    65 am_libsipopt_la_OBJECTS = AsAsNmpController.lo AsAsNMPCRegOp.lo \
    66         AsDenseGenSchurDriver.lo AsIFTSchurDriver.lo \
    67         AsIndexPCalculator.lo AsIndexSchurData.lo \
    68         AsMetadataMeasurement.lo AsNMPCApplication.lo AsNmpcUtils.lo \
    69         AsReducedHessianCalculator.lo AsSchurBuilder.lo \
    70         AsSimpleBacksolver.lo AsStdPCalculator.lo AsStdSchurData.lo \
    71         AsStdStepCalc.lo
     65am_libsipopt_la_OBJECTS = SensAlgorithm.lo SensRegOp.lo \
     66        SensDenseGenSchurDriver.lo SensIndexPCalculator.lo \
     67        SensIndexSchurData.lo SensMetadataMeasurement.lo \
     68        SensApplication.lo SensUtils.lo \
     69        SensReducedHessianCalculator.lo SensBuilder.lo \
     70        SensSimpleBacksolver.lo SensStdStepCalc.lo
    7271libsipopt_la_OBJECTS = $(am_libsipopt_la_OBJECTS)
    7372depcomp = $(SHELL) $(top_srcdir)/depcomp
     
    353352lib_LTLIBRARIES = libsipopt.la
    354353libsipopt_la_SOURCES = \
    355         AsAsBacksolver.hpp \
    356         AsAsNmpController.cpp \
    357         AsAsNmpController.hpp \
    358         AsAsNMPCRegOp.cpp \
    359         AsAsNMPCRegOp.hpp \
    360         AsDenseGenSchurDriver.cpp \
    361         AsDenseGenSchurDriver.hpp \
    362         AsIFTSchurDriver.cpp \
    363         AsIFTSchurDriver.hpp \
    364         AsIndexPCalculator.cpp \
    365         AsIndexPCalculator.hpp \
    366         AsIndexSchurData.cpp \
    367         AsIndexSchurData.hpp \
    368         AsMeasurement.hpp \
    369         AsMetadataMeasurement.cpp \
    370         AsMetadataMeasurement.hpp \
    371         AsNMPCApplication.cpp \
    372         AsNMPCApplication.hpp \
    373         AsNmpcUtils.cpp \
    374         AsNmpcUtils.hpp \
    375         AsPCalculator.hpp \
    376         AsReducedHessianCalculator.cpp \
    377         AsReducedHessianCalculator.hpp \
    378         AsSchurBuilder.cpp \
    379         AsSchurBuilder.hpp \
    380         AsSchurData.hpp \
    381         AsSchurDriver.hpp \
    382         AsSensStepCalc.hpp \
    383         AsSimpleBacksolver.cpp \
    384         AsSimpleBacksolver.hpp \
    385         AsStdPCalculator.cpp \
    386         AsStdPCalculator.hpp \
    387         AsStdSchurData.cpp \
    388         AsStdSchurData.hpp \
    389         AsStdStepCalc.cpp \
    390         AsStdStepCalc.hpp \
    391         AsSuffixHandler.hpp
     354        SensBacksolver.hpp \
     355        SensAlgorithm.cpp \
     356        SensAlgorithm.hpp \
     357        SensRegOp.cpp \
     358        SensRegOp.hpp \
     359        SensDenseGenSchurDriver.cpp \
     360        SensDenseGenSchurDriver.hpp \
     361        SensIndexPCalculator.cpp \
     362        SensIndexPCalculator.hpp \
     363        SensIndexSchurData.cpp \
     364        SensIndexSchurData.hpp \
     365        SensMeasurement.hpp \
     366        SensMetadataMeasurement.cpp \
     367        SensMetadataMeasurement.hpp \
     368        SensApplication.cpp \
     369        SensApplication.hpp \
     370        SensUtils.cpp \
     371        SensUtils.hpp \
     372        SensPCalculator.hpp \
     373        SensReducedHessianCalculator.cpp \
     374        SensReducedHessianCalculator.hpp \
     375        SensBuilder.cpp \
     376        SensBuilder.hpp \
     377        SensSchurData.hpp \
     378        SensSchurDriver.hpp \
     379        SensStepCalc.hpp \
     380        SensSimpleBacksolver.cpp \
     381        SensSimpleBacksolver.hpp \
     382        SensStdStepCalc.cpp \
     383        SensStdStepCalc.hpp \
     384        SensSuffixHandler.hpp
    392385
    393386libsipopt_la_LDFLAGS = $(LT_LDFLAGS)
     
    400393# Astyle stuff
    401394ASTYLE_FILES = \
    402         AsAsBacksolver.hppbak \
    403         AsAsNmpController.cppbak \
    404         AsAsNmpController.hppbak \
    405         AsAsNMPCRegOp.cppbak \
    406         AsAsNMPCRegOp.hppbak \
    407         AsDenseGenSchurDriver.cppbak \
    408         AsDenseGenSchurDriver.hppbak \
    409         AsIFTSchurDriver.cppbak \
    410         AsIFTSchurDriver.hppbak \
    411         AsIndexPCalculator.cppbak \
    412         AsIndexPCalculator.hppbak \
    413         AsIndexSchurData.cppbak \
    414         AsIndexSchurData.hppbak \
    415         AsMeasurement.hppbak \
    416         AsMetadataMeasurement.cppbak \
    417         AsMetadataMeasurement.hppbak \
    418         AsNMPCAppbaklication.cppbak \
    419         AsNMPCAppbaklication.hppbak \
    420         AsNmpcUtils.cppbak \
    421         AsNmpcUtils.hppbak \
    422         AsPCalculator.hppbak \
    423         AsReducedHessianCalculator.cppbak \
    424         AsReducedHessianCalculator.hppbak \
    425         AsSchurBuilder.cppbak \
    426         AsSchurBuilder.hppbak \
    427         AsSchurData.hppbak \
    428         AsSchurDriver.hppbak \
    429         AsSensStepCalc.hppbak \
    430         AsSimpleBacksolver.cppbak \
    431         AsSimpleBacksolver.hppbak \
    432         AsStdPCalculator.cppbak \
    433         AsStdPCalculator.hppbak \
    434         AsStdSchurData.cppbak \
    435         AsStdSchurData.hppbak \
    436         AsStdStepCalc.cppbak \
    437         AsStdStepCalc.hppbak \
    438         AsSuffixHandler.hppbak
     395        SensBacksolver.hppbak \
     396        SensAlgorithm.cppbak \
     397        SensAlgorithm.hppbak \
     398        SensRegOp.cppbak \
     399        SensRegOp.hppbak \
     400        SensDenseGenSchurDriver.cppbak \
     401        SensDenseGenSchurDriver.hppbak \
     402        SensIndexPCalculator.cppbak \
     403        SensIndexPCalculator.hppbak \
     404        SensIndexSchurData.cppbak \
     405        SensIndexSchurData.hppbak \
     406        SensMeasurement.hppbak \
     407        SensMetadataMeasurement.cppbak \
     408        SensMetadataMeasurement.hppbak \
     409        SensApplication.cppbak \
     410        SensApplication.hppbak \
     411        SensUtils.cppbak \
     412        SensUtils.hppbak \
     413        SensPCalculator.hppbak \
     414        SensReducedHessianCalculator.cppbak \
     415        SensReducedHessianCalculator.hppbak \
     416        SensBuilder.cppbak \
     417        SensBuilder.hppbak \
     418        SensSchurData.hppbak \
     419        SensSchurDriver.hppbak \
     420        SensStepCalc.hppbak \
     421        SensSimpleBacksolver.cppbak \
     422        SensSimpleBacksolver.hppbak \
     423        SensStdStepCalc.cppbak \
     424        SensStdStepCalc.hppbak \
     425        SensSuffixHandler.hppbak
    439426
    440427DISTCLEANFILES = $(ASTYLE_FILES)
     
    509496        -rm -f *.tab.c
    510497
    511 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsAsNMPCRegOp.Plo@am__quote@
    512 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsAsNmpController.Plo@am__quote@
    513 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsDenseGenSchurDriver.Plo@am__quote@
    514 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsIFTSchurDriver.Plo@am__quote@
    515 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsIndexPCalculator.Plo@am__quote@
    516 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsIndexSchurData.Plo@am__quote@
    517 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsMetadataMeasurement.Plo@am__quote@
    518 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsNMPCApplication.Plo@am__quote@
    519 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsNmpcUtils.Plo@am__quote@
    520 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsReducedHessianCalculator.Plo@am__quote@
    521 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsSchurBuilder.Plo@am__quote@
    522 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsSimpleBacksolver.Plo@am__quote@
    523 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsStdPCalculator.Plo@am__quote@
    524 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsStdSchurData.Plo@am__quote@
    525 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AsStdStepCalc.Plo@am__quote@
     498@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensAlgorithm.Plo@am__quote@
     499@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensApplication.Plo@am__quote@
     500@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensBuilder.Plo@am__quote@
     501@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensDenseGenSchurDriver.Plo@am__quote@
     502@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensIndexPCalculator.Plo@am__quote@
     503@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensIndexSchurData.Plo@am__quote@
     504@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensMetadataMeasurement.Plo@am__quote@
     505@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensReducedHessianCalculator.Plo@am__quote@
     506@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensRegOp.Plo@am__quote@
     507@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensSimpleBacksolver.Plo@am__quote@
     508@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensStdStepCalc.Plo@am__quote@
     509@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SensUtils.Plo@am__quote@
    526510
    527511.cpp.o:
  • trunk/Ipopt/contrib/sIPOPT/src/SensAlgorithm.cpp

    r1981 r1982  
    55// Date   : 2009-05-16
    66
    7 #include "AsAsNmpController.hpp"
    8 #include "AsNmpcUtils.hpp"
     7#include "SensAlgorithm.hpp"
     8#include "SensUtils.hpp"
    99
    1010
  • trunk/Ipopt/contrib/sIPOPT/src/SensAlgorithm.hpp

    r1981 r1982  
    99
    1010#include "IpAlgStrategy.hpp"
    11 #include "AsSensStepCalc.hpp"
    12 #include "AsMeasurement.hpp"
    13 #include "AsSchurDriver.hpp"
    14 #include "AsNmpcUtils.hpp"
     11#include "SensStepCalc.hpp"
     12#include "SensMeasurement.hpp"
     13#include "SensSchurDriver.hpp"
     14#include "SensUtils.hpp"
    1515
    1616namespace Ipopt
     
    1919  class AsNmpController : public AlgorithmStrategyObject
    2020  {
    21     /** This is the interface for the actual controller. It handles 
     21    /** This is the interface for the actual controller. It handles
    2222     *  Data input to the controller (measurement) and returns controls */
    2323
    24   public: 
    25    
     24  public:
     25
    2626    AsNmpController(std::vector< SmartPtr<SchurDriver> >& driver_vec,
    2727                    SmartPtr<SensitivityStepCalculator> sens_step_calc,
     
    3434                                const std::string& prefix);
    3535
    36     /** Main loop: Wait for new measurement, Get new step, maybe deal with 
    37      *  bounds,  see to it that everything happens in the required 
     36    /** Main loop: Wait for new measurement, Get new step, maybe deal with
     37     *  bounds,  see to it that everything happens in the required
    3838     *  timeframe. */
    3939    NmpControllerExitStatus Run();
  • trunk/Ipopt/contrib/sIPOPT/src/SensApplication.cpp

    r1981 r1982  
    66
    77
    8 #include "AsNMPCApplication.hpp"
    9 #include "AsSchurBuilder.hpp"
    10 #include "AsNmpcUtils.hpp"
    11 #include "AsAsNMPCRegOp.hpp"
     8#include "SensApplication.hpp"
     9#include "SensBuilder.hpp"
     10#include "SensUtils.hpp"
     11#include "SensRegOp.hpp"
    1212
    1313// Ipopt includes
     
    5959                               "yes", "check bounds and resolve Schur decomposition",
    6060                               "If this option is activated, the algorithm will check the iterate after an initilal Schursolve and will resolve the decomposition if any bounds are not satisfied");
    61     roptions->AddStringOption2(
    62                                "nmpc_calc_style",
    63                                "Determines which implementation of SchurData and PCalculator will be used",
    64                                "index",
    65                                "std", "use StdPCalculator and StdSchurData",
    66                                "index", "use IndexPCalculator and IndexSchurData",
    67                                "Determines which implementation of SchurData and PCalculator will be used. Only the index style can do boundchecking.");
    6861    roptions->AddLowerBoundedNumberOption(
    6962                                          "sens_bound_eps",
  • trunk/Ipopt/contrib/sIPOPT/src/SensApplication.hpp

    r1981 r1982  
    99
    1010#include "IpReferenced.hpp"
    11 #include "AsNmpcUtils.hpp"
    12 #include "AsNmpcUtils.hpp"
     11#include "SensUtils.hpp"
     12#include "SensUtils.hpp"
    1313#include "IpRegOptions.hpp"
    1414
     
    5858
    5959  private:
    60  
     60
    6161    // standard constructor just so it can't be used
    6262    //    NmpcApplication();
  • trunk/Ipopt/contrib/sIPOPT/src/SensBuilder.cpp

    r1981 r1982  
    55// Date   : 2009-05-10
    66
    7 #include "AsSchurBuilder.hpp"
    8 #include "AsPCalculator.hpp"
    9 #include "AsStdPCalculator.hpp"
    10 #include "AsIndexPCalculator.hpp"
    11 #include "AsSchurData.hpp"
    12 #include "AsStdSchurData.hpp"
    13 #include "AsIndexSchurData.hpp"
    14 #include "AsDenseGenSchurDriver.hpp"
    15 #include "AsIFTSchurDriver.hpp"
    16 #include "AsMeasurement.hpp"
    17 #include "AsMetadataMeasurement.hpp"
    18 #include "AsStdStepCalc.hpp"
     7#include "SensBuilder.hpp"
     8#include "SensPCalculator.hpp"
     9#include "SensIndexPCalculator.hpp"
     10#include "SensSchurData.hpp"
     11#include "SensIndexSchurData.hpp"
     12#include "SensDenseGenSchurDriver.hpp"
     13#include "SensMeasurement.hpp"
     14#include "SensMetadataMeasurement.hpp"
     15#include "SensStdStepCalc.hpp"
    1916
    2017#include <string>
     
    5350    // Check options which Backsolver to use here
    5451    SmartPtr<AsBacksolver> backsolver = new SimpleBacksolver(&pd_solver);
    55 
    56     // Check option which SchurData and PCalculator implementation to use
    57     std::string nmpc_calc_style;
    58     options.GetStringValue("nmpc_calc_style", nmpc_calc_style, "");
    5952
    6053    // Create measurement unit
     
    6962    // Check ParameterData, send it to Pcalculator
    7063    SmartPtr<SchurData> E_0;
    71     if (nmpc_calc_style=="index") {
    72       E_0 = new IndexSchurData();
    73     }
    74     else if (nmpc_calc_style=="std") {
    75       E_0 = new StdSchurData();
    76     }
    77    
     64    E_0 = new IndexSchurData();
     65
    7866    std::string select_step;
    7967    options.GetStringValue("select_step", select_step, "");
     
    8270    std::vector<Index> initial_c = measurement->GetInitialEqConstraints(); // type: List
    8371    if (select_step=="advanced") {
    84       std::vector<Index> z_k_index = measurement->GetNmpcState(1); // type: Index 
    85    
     72      std::vector<Index> z_k_index = measurement->GetNmpcState(1); // type: Index
     73
    8674      E_0->SetData_Index(z_k_index.size(), &z_k_index[0]);
    87    
     75
    8876      std::vector<Index> delta_u_sort_empty;
    8977      Index new_du_size_empty=0;
    90    
     78
    9179      E_0->AddData_List(initial_c, delta_u_sort_empty,new_du_size_empty,1);
    9280    }
     
    9684    else if (select_step=="ift") {
    9785      /* For the IFT-step, the variables have to be ordered the other way around:
    98          The delta_u for the lambda_0 goes into the line of z_0 
     86         The delta_u for the lambda_0 goes into the line of z_0
    9987         and vice versa. */
    100       std::vector<Index> z_k_index = measurement->GetNmpcState(1); // type: Index 
     88      std::vector<Index> z_k_index = measurement->GetNmpcState(1); // type: Index
    10189      Index i_c_size = initial_c.size();
    10290      Index count = i_c_size;
     
    116104    if (select_step=="advanced" || select_step=="sensitivity") { // don't create pcalculator for IFT step
    117105      // Check options which PCalculator to use here
    118       if (nmpc_calc_style=="index") {
    119         pcalc = new IndexPCalculator(backsolver, E_0);
    120       }
    121       else if (nmpc_calc_style=="std") {
    122         pcalc = new StdPCalculator(backsolver, E_0);
    123       }
     106      pcalc = new IndexPCalculator(backsolver, E_0);
    124107
    125108      bool retval = pcalc->Initialize(jnlst,
     
    140123      options.GetBoolValue("sens_boundcheck", bound_check, prefix);
    141124      if (bound_check) {
    142         if (nmpc_calc_style=="index") {
    143           pcalc = new IndexPCalculator(backsolver, new IndexSchurData());
    144           bool retval = pcalc->Initialize(jnlst,
    145                                           ip_nlp,
    146                                           ip_data,
    147                                           ip_cq,
    148                                           options,
    149                                           prefix);
    150           DBG_ASSERT(retval);
    151         }
    152       }
    153     }
    154    
     125        pcalc = new IndexPCalculator(backsolver, new IndexSchurData());
     126        bool retval = pcalc->Initialize(jnlst,
     127                                        ip_nlp,
     128                                        ip_data,
     129                                        ip_cq,
     130                                        options,
     131                                        prefix);
     132        DBG_ASSERT(retval);
     133      }
     134    }
     135
    155136
    156137    // Find out how many steps there are and create as many SchurSolveDrivers
     
    162143    std::vector< SmartPtr<SchurDriver> > driver_vec(n_sens_steps);
    163144
    164     /** Here there should be the point to pass on the driver_vec and fork off the 
     145    /** Here there should be the point to pass on the driver_vec and fork off the
    165146     *  Schurcomputations to a different function/process if needed. */
    166147    std::vector<Index> sens_state_list;
     
    180161        // Create SchurDriver from pcalc and suffix indices
    181162        SmartPtr<SchurData> E_i;
    182         if (nmpc_calc_style=="index") {
    183           E_i = new IndexSchurData();
    184         }
    185         else if (nmpc_calc_style=="std") {
    186           E_i = new StdSchurData();
    187         }
     163        E_i = new IndexSchurData();
     164
    188165        sens_state_list = measurement->GetNmpcState(i+1);
    189166        DBG_PRINT((dbg_verbosity, "sens_state_list.size()=%d", sens_state_list.size()));
     
    207184      DBG_ASSERT(schur_retval);
    208185    }
    209    
     186
    210187    SmartPtr<SensitivityStepCalculator> sens_stepper = new StdStepCalculator(E_0, backsolver);
    211188
     
    241218  {
    242219    DBG_START_METH("SchurBuilder::BuildRedHessCalc", dbg_verbosity);
    243    
     220
    244221    // Check options which Backsolver to use here
    245222    SmartPtr<AsBacksolver> backsolver = new SimpleBacksolver(&pd_solver);
    246 
    247     // Check option which SchurData and PCalculator implementation to use
    248     std::string nmpc_calc_style;
    249     options.GetStringValue("nmpc_calc_style", nmpc_calc_style, "");
    250223
    251224    // Create suffix handler
     
    258231                                                                              prefix);
    259232    SmartPtr<SchurData> E_0;
    260     if (nmpc_calc_style=="index") {
    261       E_0 = new IndexSchurData();
    262     }
    263     else if (nmpc_calc_style=="std") {
    264       E_0 = new StdSchurData();
    265     }
    266    
     233    E_0 = new IndexSchurData();
     234
    267235    std::vector<Index> hessian_suff = suffix_handler->GetIntegerSuffix("red_hessian");
    268236
     
    270238    if ( setdata_error ){
    271239      jnlst.Printf(J_ERROR, J_MAIN, "\nEXIT: An Error Occured while processing "
    272                     "the Indices for the reduced hessian computation: Something "
    273                     "is wrong with index %d\n",setdata_error);
     240                   "the Indices for the reduced hessian computation: Something "
     241                   "is wrong with index %d\n",setdata_error);
    274242      THROW_EXCEPTION(ASNMPC_BUILDER_ERROR,
    275243                      "Reduced Hessian Index Error");
    276244    }
    277    
     245
    278246    SmartPtr<PCalculator> pcalc;
    279     if (nmpc_calc_style=="index") {
    280       pcalc = new IndexPCalculator(backsolver, E_0);
    281     }
    282     else if (nmpc_calc_style=="std") {
    283       pcalc = new StdPCalculator(backsolver, E_0);
    284     }
     247    pcalc = new IndexPCalculator(backsolver, E_0);
    285248
    286249    bool retval = pcalc->Initialize(jnlst,
     
    291254                                    prefix);
    292255    DBG_ASSERT(retval);
    293    
     256
    294257    retval = pcalc->ComputeP();
    295    
     258
    296259    SmartPtr<ReducedHessianCalculator> red_hess_calc = new ReducedHessianCalculator(E_0, pcalc);
    297260
     
    306269  }
    307270}
    308 
  • trunk/Ipopt/contrib/sIPOPT/src/SensBuilder.hpp

    r1981 r1982  
    1010
    1111#include "IpReferenced.hpp"
    12 #include "AsAsNmpController.hpp"
     12#include "SensAlgorithm.hpp"
    1313#include "IpPDSystemSolver.hpp"
    14 #include "AsNmpcUtils.hpp"
    15 #include "AsReducedHessianCalculator.hpp"
     14#include "SensUtils.hpp"
     15#include "SensReducedHessianCalculator.hpp"
    1616
    1717
     
    2323  {
    2424    /** This class sets up everything necessary and
    25      *  builds the P matrix which is an intermediate step 
     25     *  builds the P matrix which is an intermediate step
    2626     *  in calculating the schur matrix. */
    2727  public:
  • trunk/Ipopt/contrib/sIPOPT/src/SensDenseGenSchurDriver.cpp

    r1981 r1982  
    55// Date   : 2009-11-19
    66
    7 #include "AsIFTSchurDriver.hpp"
    8 #include "AsIndexSchurData.hpp"
     7#include "SensDenseGenSchurDriver.hpp"
     8#include "SensIndexSchurData.hpp"
    99
    1010namespace Ipopt
     
    6464
    6565  /* The functions SchurSolve do IFT step, if S_==NULL, and DenseGenSchurDriver otherwise. */
    66   bool IFTSchurDriver::SchurSolve(SmartPtr<IteratesVector> lhs, // new left hand side will be stored here 
     66  bool IFTSchurDriver::SchurSolve(SmartPtr<IteratesVector> lhs, // new left hand side will be stored here
    6767                                  SmartPtr<const IteratesVector> rhs, // rhs r_s
    6868                                  SmartPtr<Vector> delta_u,  // should be (u_p - u_0) WATCH OUT FOR THE SIGN! I like it this way, so that u_0+delta_u = u_p, but victor always used it the other way round, so be careful. At the end, delta_nu is saved in here.
     
    7979    delta_rhs->Print(Jnlst(),J_VECTOR,J_USER1,"delta_rhs");
    8080    delta_rhs->Scal(-1.0);
    81     delta_rhs->Axpy(1.0, *delta_u); 
     81    delta_rhs->Axpy(1.0, *delta_u);
    8282    delta_rhs->Print(Jnlst(),J_VECTOR,J_USER1,"rhs 3.48a");
    8383
     
    9595    new_rhs->Print(Jnlst(),J_VECTOR,J_USER1,"new_rhs");
    9696    retval = backsolver_->Solve(lhs, ConstPtr(new_rhs));
    97    
     97
    9898    return retval;
    9999  }
  • trunk/Ipopt/contrib/sIPOPT/src/SensDenseGenSchurDriver.hpp

    r1981 r1982  
    88#define __ASIFTSCHURDRIVER_HPP__
    99
    10 #include "AsSchurDriver.hpp"
    11 #include "AsAsBacksolver.hpp"
     10#include "SensSchurDriver.hpp"
     11#include "SensBacksolver.hpp"
    1212#include "IpDenseGenMatrix.hpp"
    1313
     
    1818  {
    1919
    20   public: 
    21    
     20  public:
     21
    2222    IFTSchurDriver(SmartPtr<AsBacksolver> backsolver,
    2323                   SmartPtr<PCalculator> pcalc,
     
    3333
    3434    /** Performs a backsolve on S and : Solves the system
    35      * 
     35     *
    3636     *  \f$\left[\begin{array}{c|c}
    3737     *  K & E\\\hline
    38      *  E^T & 0 
     38     *  E^T & 0
    3939     *  \end{array}
    40      *  \right] 
    41      *  \left[\begin{array}{c}x\\y\end{array}\right] = 
     40     *  \right]
     41     *  \left[\begin{array}{c}x\\y\end{array}\right] =
    4242     *  \left[\begin{array}{c}f\\g\end{array}\right]$\f
    4343     *
    4444     *  y will be stored in g at exit.
    45      *  Kf should hold 
     45     *  Kf should hold
    4646     *
    4747     *  \f$K^{-1}f$\f
     
    5050     *  pass in Kf=NULL and it will be computed internally.
    5151     */
    52     virtual bool SchurSolve(SmartPtr<IteratesVector> x, 
     52    virtual bool SchurSolve(SmartPtr<IteratesVector> x,
    5353                            SmartPtr<const IteratesVector> f,
    5454                            SmartPtr<Vector> g,
    5555                            SmartPtr<IteratesVector> Kf=NULL);
    5656
    57     /** DEPRECATED Performs a backsolve on S and K 
    58     virtual bool SchurSolve(SmartPtr<IteratesVector> lhs, 
     57    /** DEPRECATED Performs a backsolve on S and K
     58    virtual bool SchurSolve(SmartPtr<IteratesVector> lhs,
    5959                            SmartPtr<const IteratesVector> rhs,
    6060                            SmartPtr<Vector> delta_u);
  • trunk/Ipopt/contrib/sIPOPT/src/SensIndexPCalculator.cpp

    r1981 r1982  
    55// Date   : 2009-05-27
    66
    7 #include "AsIndexPCalculator.hpp"
    8 #include "AsIndexSchurData.hpp"
     7#include "SensIndexPCalculator.hpp"
     8#include "SensIndexSchurData.hpp"
    99#include "IpDenseVector.hpp"
    1010#include "IpDenseGenMatrix.hpp"
     
    1313#include <vector>
    1414
    15 namespace Ipopt 
     15namespace Ipopt
    1616{
    1717#if COIN_IPOPT_VERBOSITY > 0
     
    3939    DBG_START_METH("IndexPCalculator::InitializeImpl", dbg_verbosity);
    4040
    41     SmartPtr<const IteratesVector> iv = IpData().curr(); 
     41    SmartPtr<const IteratesVector> iv = IpData().curr();
    4242    nrows_ = 0;
    4343    for (Index i=0; i<iv->NComps(); ++i) {
     
    6969      find_it = cols_.find(col);
    7070      if (find_it==cols_.end()) {
    71         // column is in data_A but not in P-matrix ->create 
     71        // column is in data_A but not in P-matrix ->create
    7272        data_A()->GetRow(curr_schur_row, *col_vec);
    7373        retval = Solver()->Solve(sol_vec, ConstPtr(col_vec));
    74         DBG_ASSERT(retval);     
     74        DBG_ASSERT(retval);
    7575
    7676        /* This part is for displaying norm2(I_z*K^(-1)*I_1) */
     
    7878        DBG_PRINT((dbg_verbosity,"norm2(z)=%23.16e\n",sol_vec->x()->Nrm2()));
    7979        /* end displaying norm2 */
    80        
     80
    8181        DBG_ASSERT(col_values== NULL);
    8282        col_values = new Number[nrows_];
    83         curr_dim = 0;   
     83        curr_dim = 0;
    8484         for (Index j=0; j<sol_vec->NComps(); ++j) {
    8585           comp_vec = dynamic_cast<const DenseVector*>(GetRawPtr(sol_vec->GetComp(j)));
     
    9393      curr_schur_row++;
    9494    }
    95    
    96     return retval;   
     95
     96    return retval;
    9797  }
    9898
    9999  bool IndexPCalculator::GetSchurMatrix(const SmartPtr<const SchurData>& B, SmartPtr<Matrix>& S)
    100   { 
     100  {
    101101    DBG_START_METH("IndexPCalculator::GetSchurMatrix", dbg_verbosity);
    102102    bool retval = true;
     
    136136          ncols_ = data_A()->GetNRowsAdded();
    137137          ComputeP();
    138     }   
     138    }
    139139    /*
    140140    DBG_ASSERT(dS->NRows()==dS->NCols());
  • trunk/Ipopt/contrib/sIPOPT/src/SensIndexPCalculator.hpp

    r1981 r1982  
    88#define __ASINDEXPCALCULATOR_HPP__
    99
    10 #include "AsPCalculator.hpp"
     10#include "SensPCalculator.hpp"
    1111
    1212namespace Ipopt
     
    2424    IndexPCalculator(SmartPtr<AsBacksolver> backsolver,
    2525                     SmartPtr<SchurData> A_data);
    26    
     26
    2727    virtual ~IndexPCalculator();
    2828
     
    3232
    3333    virtual bool ComputeP();
    34    
     34
    3535    virtual bool GetSchurMatrix(const SmartPtr<const SchurData>& B, SmartPtr<Matrix>& S);
    3636
     
    4545
    4646    /** Rows of P = Rows of KKT */
    47     Index nrows_; 
     47    Index nrows_;
    4848
    4949    /** Cols of P */
    5050    Index ncols_;
    51    
     51
    5252    std::map< Index, SmartPtr<PColumn> > cols_;
    5353
    5454  };
    5555
    56   class PColumn : public ReferencedObject 
     56  class PColumn : public ReferencedObject
    5757  {
    5858    /** This class provides an easy interface for PCalculators with data where columns are
     
    6868    virtual const Number* Values() const;
    6969
    70   private: 
    71    
     70  private:
     71
    7272    Index nrows_;
    7373    Number* val_;
  • trunk/Ipopt/contrib/sIPOPT/src/SensIndexSchurData.cpp

    r1981 r1982  
    55// Date   : 2009-05-27
    66
    7 #include "AsIndexSchurData.hpp"
     7#include "SensIndexSchurData.hpp"
    88#include "IpIteratesVector.hpp"
    99#include "IpDenseVector.hpp"
    1010#include "IpBlas.hpp"
    11 #include "AsNmpcUtils.hpp"
     11#include "SensUtils.hpp"
    1212
    1313namespace Ipopt
     
    2323
    2424  IndexSchurData::IndexSchurData(const std::vector<Index> idx, const std::vector<Index> val)
    25   { 
     25  {
    2626    DBG_START_METH("IndexSchurData::IndexSchurData(vector,vector)", dbg_verbosity);
    2727    idx_ = idx;
     
    3131    Set_Initialized();
    3232  }
    33  
     33
    3434
    3535  IndexSchurData::~IndexSchurData()
     
    5151    DBG_ASSERT(!Is_Initialized());
    5252    DBG_ASSERT(v!=0);
    53    
     53
    5454    Index w;
    5555    (v>0) ? w=1 : w=-1;
     
    7272    DBG_ASSERT(idx_.size()==0);
    7373    DBG_ASSERT(!Is_Initialized());
    74    
     74
    7575    for (Index i=0; i<dim; ++i) {
    7676      DBG_ASSERT(flags[i]==1 || flags[i]==0);
     
    123123  {
    124124    DBG_START_METH("IndexSchurData::SetData_List", dbg_verbosity);
    125    
     125
    126126    DBG_ASSERT(!Is_Initialized());
    127127    DBG_ASSERT(idx_.empty());
     
    132132
    133133    val_.resize(list.size(), w);
    134     idx_ = list;   
    135    
     134    idx_ = list;
     135
    136136    Set_Initialized();
    137137  }
     
    153153
    154154    Index vec_idx = 0;
    155     while(!(col<v_lens[vec_idx])) { 
     155    while(!(col<v_lens[vec_idx])) {
    156156      vec_idx++;
    157157    }
    158    
     158
    159159    dynamic_cast<DenseVector*>(GetRawPtr(v.GetCompNonConst(vec_idx)))->Values()[col+v.GetComp(vec_idx)->Dim()-v_lens[vec_idx]] = (Number)val_[row];
    160160
     
    187187    for (unsigned int i=0; i<idx_.size(); ++i) {
    188188      v_row = idx_[i];
    189      
     189
    190190      // find vector in CompoundVector that corresponds to the given col in matrix/row in v.
    191191      vec_idx = -1;
    192192      while(!(v_row<v_lens[++vec_idx])) { }
    193      
     193
    194194      SmartPtr<const DenseVector> d_ptr = dynamic_cast<const DenseVector*>(GetRawPtr(v.GetComp(vec_idx)));
    195195      if (!d_ptr->IsHomogeneous()) {
    196         u_val[i] += 
     196        u_val[i] +=
    197197          val_[i]*d_ptr->Values()[v_row+v.GetComp(vec_idx)->Dim()-v_lens[vec_idx]];
    198198      }
     
    227227      v_vals[i] = 0;
    228228    }
    229    
     229
    230230    // perform v_vals <- A^T*u
    231231    Index row, col;
     
    253253  }
    254254
    255   Index* IndexSchurData::GetVectorLengths(const IteratesVector& v) const 
     255  Index* IndexSchurData::GetVectorLengths(const IteratesVector& v) const
    256256  {
    257257    DBG_START_METH("IndexSchurData::GetVectorLengths", dbg_verbosity);
     
    276276  {
    277277    DBG_START_METH("IndexSchurData::PrintImpl", dbg_verbosity);
    278    
     278
    279279    jnlst.PrintfIndented(level, category, indent,
    280280                         "%sIndexSchurData \"%s\" with %d rows:\n",
     
    317317        }
    318318      }
    319     }   
     319    }
    320320  }
    321321
     
    325325
    326326    new_du_size = (Index)idx_.size();
    327     bool oldindex; 
     327    bool oldindex;
    328328    for (unsigned int i=0; i<cols.size(); ++i) {
    329329      oldindex = false;
     
    360360    return &idx_;
    361361  }
    362 } 
     362}
  • trunk/Ipopt/contrib/sIPOPT/src/SensIndexSchurData.hpp

    r1981 r1982  
    88#define __ASINDEXSCHURDATA_HPP__
    99
    10 #include "AsSchurData.hpp"
     10#include "SensSchurData.hpp"
    1111
    1212namespace Ipopt
     
    2323
    2424    IndexSchurData(const std::vector<Index> idx, const std::vector<Index> val);
    25    
     25
    2626    virtual ~IndexSchurData();
    2727
     
    3535
    3636    virtual Index SetData_Index(Index dim, const Index* index, Number v=1.0);
    37    
     37
    3838    virtual void SetData_List(const std::vector<Index>& list, Number v=1.0);
    3939
     
    5959     *  it stays at the same place, otherwise the new indices are added at the bottom,
    6060     *  in the order specified by the indices. The vector delta_u_sort returns the actual
    61      *  sorting so that the user knows how to place the new values inside the elongated 
     61     *  sorting so that the user knows how to place the new values inside the elongated
    6262     *  delta_u vector. These places are in C++ index style, so they correspond exactly
    6363     *  to the indices used for the C++-array of the delta_u DenseVector*/
  • trunk/Ipopt/contrib/sIPOPT/src/SensMetadataMeasurement.cpp

    r1981 r1982  
    55// Date   : 2009-07-10
    66
    7 #include "AsMetadataMeasurement.hpp"
    8 #include "AsNmpcUtils.hpp"
     7#include "SensMetadataMeasurement.hpp"
     8#include "SensUtils.hpp"
    99
    1010#include <vector>
     
    4545    z_L_owner_space_ = dynamic_cast<const DenseVectorSpace*>(GetRawPtr(IpData().curr()->z_L()->OwnerSpace()));
    4646    z_U_owner_space_ = dynamic_cast<const DenseVectorSpace*>(GetRawPtr(IpData().curr()->z_U()->OwnerSpace()));
    47     DBG_ASSERT(IsValid(x_owner_space_) && IsValid(s_owner_space_) && 
     47    DBG_ASSERT(IsValid(x_owner_space_) && IsValid(s_owner_space_) &&
    4848               IsValid(y_c_owner_space_) && IsValid(y_d_owner_space_) &&
    4949               IsValid(z_L_owner_space_) && IsValid(z_U_owner_space_));
     
    5656      std::string sens_state_0 = "sens_state_1"; // sens_state_0 doesn't exist anymore...
    5757      std::vector<Index> tmp_idx = x_owner_space_->GetIntegerMetaData(sens_state_0);
    58      
     58
    5959      n_idx_ = AsIndexMax((Index)tmp_idx.size(), &tmp_idx[0], 1);
    6060
     
    7474
    7575    const std::vector<Index> constr_metadata = y_c_owner_space_->GetIntegerMetaData("sens_init_constr");
    76    
     76
    7777    std::vector<Index> retval;
    7878    for (Index i = 0; i<constr_metadata.size(); ++i) {
     
    8787  {
    8888    DBG_START_METH("MetadataMeasurement::GetNmpcState", dbg_verbosity);
    89    
     89
    9090    std::string state      = "sens_state_";
    9191    append_Index(state, state_number);
     
    112112    std::string state;
    113113    std::string statevalue;
    114      
     114
    115115    state      = "sens_state_";
    116116    statevalue = "sens_state_value_";
     
    148148
    149149      const Number* u_0_lambda = dynamic_cast<const DenseVector*>(GetRawPtr(IpData().trial()->y_c()))->Values();
    150    
     150
    151151      Index ind_it = constr_ipopt.size();
    152152      for (std::vector<Index>::iterator it=constr_ipopt.begin(); it!=constr_ipopt.end(); ++it) {
     
    155155      }
    156156    }
    157    
     157
    158158    delta_u->SetValues(du_val);
    159    
     159
    160160    return delta_u;
    161161  }
     
    172172    SmartPtr<DenseVectorSpace> x_owner_space_nonconst = const_cast<DenseVectorSpace*>(GetRawPtr(x_owner_space_));
    173173    x_owner_space_nonconst->SetNumericMetaData(nmpc_sol, x_sol);
    174    
     174
    175175    SmartPtr<const DenseVector> s_dv = dynamic_cast<const DenseVector*>(GetRawPtr(sol->s()));
    176176    if (IsValid(s_dv)) {
     
    180180      s_owner_space_nonconst->SetNumericMetaData(nmpc_sol, s_sol);
    181181    }
    182    
     182
    183183    const Number* sol_y_c_val = dynamic_cast<const DenseVector*>(GetRawPtr(sol->y_c()))->Values();
    184184    std::vector<Number> y_c_sol = std::vector<Number>(sol_y_c_val, sol_y_c_val+sol->y_c()->Dim());
     
    190190    SmartPtr<DenseVectorSpace> y_d_owner_space_nonconst = const_cast<DenseVectorSpace*>(GetRawPtr(y_d_owner_space_));
    191191    y_d_owner_space_nonconst->SetNumericMetaData(nmpc_sol, y_d_sol);
    192    
     192
    193193    const Number* sol_z_L_val = dynamic_cast<const DenseVector*>(GetRawPtr(sol->z_L()))->Values();
    194194    std::vector<Number> z_L_sol = std::vector<Number>(sol_z_L_val, sol_z_L_val+sol->z_L()->Dim());
     
    209209
    210210    std::vector<Index> retval = idx_ipopt;
    211    
    212     return retval;   
     211
     212    return retval;
    213213  }
    214214}
  • trunk/Ipopt/contrib/sIPOPT/src/SensMetadataMeasurement.hpp

    r1981 r1982  
    88#define __AS_METADATAMEASUREMENT_HPP__
    99
    10 #include "AsMeasurement.hpp"
    11 #include "AsSuffixHandler.hpp"
     10#include "SensMeasurement.hpp"
     11#include "SensSuffixHandler.hpp"
    1212#include "IpAlgStrategy.hpp"
    1313
     
    1515namespace Ipopt
    1616{
    17  
     17
    1818  class MetadataMeasurement : public Measurement, public SuffixHandler, public AlgorithmStrategyObject
    1919  {
     
    3434    virtual SmartPtr<DenseVector> GetMeasurement(Index measurement_number);
    3535
    36     virtual void SetSolution(Index measurement_number, SmartPtr<IteratesVector> sol);   
     36    virtual void SetSolution(Index measurement_number, SmartPtr<IteratesVector> sol);
    3737
    3838    /** suffix handler methods */
    39    
     39
    4040    virtual std::vector<Index> GetIntegerSuffix(std::string suffix_string);
    4141
     
    4444    /** Number of nmpc_indices */
    4545    Index n_idx_;
    46    
     46
    4747    std::string select_step_;
    4848    /** owner space of x */
     
    5151    SmartPtr<const DenseVectorSpace> s_owner_space_;
    5252    /** owner space of y_c */
    53     SmartPtr<const DenseVectorSpace> y_c_owner_space_; 
     53    SmartPtr<const DenseVectorSpace> y_c_owner_space_;
    5454    /** owner space of y_d */
    55     SmartPtr<const DenseVectorSpace> y_d_owner_space_; 
     55    SmartPtr<const DenseVectorSpace> y_d_owner_space_;
    5656    /** owner space of z_L */
    57     SmartPtr<const DenseVectorSpace> z_L_owner_space_; 
     57    SmartPtr<const DenseVectorSpace> z_L_owner_space_;
    5858    /** owner space of z_U */
    59     SmartPtr<const DenseVectorSpace> z_U_owner_space_; 
     59    SmartPtr<const DenseVectorSpace> z_U_owner_space_;
    6060
    6161  };
  • trunk/Ipopt/contrib/sIPOPT/src/SensPCalculator.hpp

    r1981 r1982  
    99
    1010#include "IpAlgStrategy.hpp"
    11 #include "AsSimpleBacksolver.hpp"
    12 #include "AsSchurData.hpp"
     11#include "SensSimpleBacksolver.hpp"
     12#include "SensSchurData.hpp"
    1313
    1414namespace Ipopt
     
    1818  {
    1919    /** This class is the interface for implementations of any class that calculates the matrix $P =K^{-1}A
    20      *  of the following matrix: 
     20     *  of the following matrix:
    2121     *  \begin{eqnarray}
    2222     *  \left(\begin{array}{cc}
     
    3737    {
    3838    }
    39    
     39
    4040    virtual ~PCalculator()
    4141    {
     
    5151    /** Function to start the computation of  P from E_0 and KKT*/
    5252    virtual bool ComputeP()=0;
    53    
     53
    5454    /** Function to extract a SchurMatrix corresponding to $B K^{-1} A$. If B==NULL, use A=B*/
    5555    virtual bool GetSchurMatrix(const SmartPtr<const SchurData>& B, SmartPtr<Matrix>& S) =0;
     
    8686    }
    8787
    88     /** Accessor methods for data and backsolver. This unconstness seems 
     88    /** Accessor methods for data and backsolver. This unconstness seems
    8989     *  kind of dangerous but I don't think there is a way around it. Anyway,
    9090     *  there is no difference between this and the IpData() method of AlgStrategy.*/
     
    104104    }
    105105
    106     void reset_data_A() 
     106    void reset_data_A()
    107107    {
    108108      data_A_ = data_A_init->MakeNewSchurDataCopy();
     
    116116    SmartPtr<SchurData> data_A_;
    117117
    118    
     118
    119119  };
    120120
  • trunk/Ipopt/contrib/sIPOPT/src/SensReducedHessianCalculator.cpp

    r1981 r1982  
    55// Date   : 2009-08-01
    66
    7 #include "AsReducedHessianCalculator.hpp"
     7#include "SensReducedHessianCalculator.hpp"
    88#include "IpDenseGenMatrix.hpp"
    99
     
    3939  {
    4040    DBG_START_METH("ReducedHessianCalculator::ComputeReducedHessian", dbg_verbosity);
    41    
     41
    4242    Index dim_S = hess_data_->GetNRowsAdded();
    4343    //SmartPtr<DenseGenMatrixSpace> S_space = new DenseGenMatrixSpace(dim_S, dim_S);
     
    4545    SmartPtr<Matrix> S;
    4646    bool retval = pcalc_->GetSchurMatrix(GetRawPtr(hess_data_), S);
    47    
     47
    4848    SmartPtr<DenseSymMatrix> S_sym = dynamic_cast<DenseSymMatrix*>(GetRawPtr(S));
    4949    if (!IsValid(S_sym)) {
     
    5151      throw (exc);
    5252    }
    53    
     53
    5454    bool have_x_scaling, have_c_scaling, have_d_scaling;
    5555    have_x_scaling = IpNLP().NLP_scaling()->have_x_scaling();
     
    5858
    5959    if (have_x_scaling || have_c_scaling || have_d_scaling) {
    60       Jnlst().Printf(J_WARNING, J_MAIN, 
     60      Jnlst().Printf(J_WARNING, J_MAIN,
    6161                     "\n"
    6262                     "-------------------------------------------------------------------------------\n"
     
    7373        Jnlst().Printf(J_WARNING, J_MAIN, "*** inequality constraints\n");
    7474      }
    75       Jnlst().Printf(J_WARNING, J_MAIN, 
     75      Jnlst().Printf(J_WARNING, J_MAIN,
    7676                     "enabled.\n"
    7777                     "A correct unscaled solution of the reduced hessian cannot be guaranteed in this\n"
    7878                     "case. Please consider rerunning with scaling turned off.\n"
    7979                     "-------------------------------------------------------------------------------\n\n");
    80      
     80
    8181    }
    8282
     
    9696      SmartPtr<DenseVectorSpace> eigenvaluesspace = new DenseVectorSpace(dim_S);
    9797      SmartPtr<DenseVector> eigenvalues = new DenseVector(GetRawPtr(eigenvaluesspace));
    98    
     98
    9999      eigenvectors->ComputeEigenVectors(*S_sym, *eigenvalues);
    100100      eigenvalues->Print(Jnlst(),J_INSUPPRESSIBLE,J_USER1,"Eigenvalues of reduced hessian matrix");
    101101    }
    102    
     102
    103103    return retval;
    104104  }
  • trunk/Ipopt/contrib/sIPOPT/src/SensReducedHessianCalculator.hpp

    r1981 r1982  
    99
    1010#include "IpAlgStrategy.hpp"
    11 #include "AsSchurData.hpp"
    12 #include "AsPCalculator.hpp"
     11#include "SensSchurData.hpp"
     12#include "SensPCalculator.hpp"
    1313
    1414namespace Ipopt
     
    1717  class ReducedHessianCalculator : public AlgorithmStrategyObject
    1818  {
    19     /** This is the interface for the actual controller. It handles 
     19    /** This is the interface for the actual controller. It handles
    2020     *  Data input to the controller (measurement) and returns controls */
    2121  public:
  • trunk/Ipopt/contrib/sIPOPT/src/SensRegOp.cpp

    r1981 r1982  
    99
    1010#include "IpRegOptions.hpp"
    11 #include "AsNMPCApplication.hpp"
     11#include "SensApplication.hpp"
    1212
    1313namespace Ipopt
  • trunk/Ipopt/contrib/sIPOPT/src/SensSchurDriver.hpp

    r1981 r1982  
    88#define __ASSCHURDRIVER_HPP__
    99
    10 #include "AsSchurData.hpp"
    11 #include "AsPCalculator.hpp"
     10#include "SensSchurData.hpp"
     11#include "SensPCalculator.hpp"
    1212#include "IpVector.hpp"
    1313#include "IpIteratesVector.hpp"
     
    2020    /** This class is the interface for any class that deals with the Schur matrix
    2121     *  from the point when it is constructed by the PCalculator to the solution
    22      *  against one vector. Specific implementations may also incorporate the 
     22     *  against one vector. Specific implementations may also incorporate the
    2323     *  treatment of adding rows/cols (like QPSchur).
    2424     *
    25      *  The computations done by this class are 
     25     *  The computations done by this class are
    2626     *  1. Solve $S \Delta\nu = r_s
    2727     *  2. Solve $K\Delta s = ... - \Delta nu (really?)*/
    2828
    29   public: 
    30    
     29  public:
     30
    3131    SchurDriver(SmartPtr<PCalculator> pcalc,
    32                 SmartPtr<SchurData> data_B) 
     32                SmartPtr<SchurData> data_B)
    3333      :
    3434      pcalc_(pcalc),
     
    5959    }
    6060
    61     virtual SmartPtr<SchurData> data_A_nonconst() 
     61    virtual SmartPtr<SchurData> data_A_nonconst()
    6262    {
    6363      return pcalc_->data_A_nonconst();
    6464    }
    6565
    66     virtual SmartPtr<SchurData> data_B_nonconst() 
     66    virtual SmartPtr<SchurData> data_B_nonconst()
    6767    {
    6868      return data_B_;
     
    8888
    8989    /** Performs a backsolve on S and K */
    90     virtual bool SchurSolve(SmartPtr<IteratesVector> lhs, 
     90    virtual bool SchurSolve(SmartPtr<IteratesVector> lhs,
    9191                            SmartPtr<const IteratesVector> rhs,
    9292                            SmartPtr<Vector> delta_u,
    9393                            SmartPtr<IteratesVector> sol=NULL)=0; // the vector K^(-1)*r_s which usually should have been computed before.
    94                            
     94
    9595
    9696    /** Performs a backsolve on S and K; calls the latter with sol=K^(-1)*r_s=0
    97     virtual bool SchurSolve(SmartPtr<IteratesVector> lhs, 
     97    virtual bool SchurSolve(SmartPtr<IteratesVector> lhs,
    9898                            SmartPtr<const IteratesVector> rhs,
    9999                            SmartPtr<Vector> delta_u) =0;
  • trunk/Ipopt/contrib/sIPOPT/src/SensSimpleBacksolver.cpp

    r1981 r1982  
    44//
    55// Date    : 2009-04-06
    6 // 
     6//
    77// Purpose : This is the same as IpSensitivityCalculator.hpp
    88
    99
    10 #include "AsSimpleBacksolver.hpp"
     10#include "SensSimpleBacksolver.hpp"
    1111
    1212namespace Ipopt
  • trunk/Ipopt/contrib/sIPOPT/src/SensSimpleBacksolver.hpp

    r1981 r1982  
    44//
    55// Date    : 2009-04-06
    6 // 
     6//
    77// Purpose : This is the same as IpSensitivityCalculator.hpp
    88//           It implements the AsBacksolver Interface.
     
    1313
    1414#include "IpPDSystemSolver.hpp"
    15 #include "AsAsBacksolver.hpp"
     15#include "SensBacksolver.hpp"
    1616
    1717namespace Ipopt {
  • trunk/Ipopt/contrib/sIPOPT/src/SensStdStepCalc.cpp

    r1981 r1982  
    66
    77
    8 #include "AsStdStepCalc.hpp"
     8#include "SensStdStepCalc.hpp"
    99#include "IpDenseVector.hpp"
    1010#include "IpIteratesVector.hpp"
    1111#include "IpBlas.hpp"
    12 #include "AsIndexSchurData.hpp"
     12#include "SensIndexSchurData.hpp"
    1313
    1414
  • trunk/Ipopt/contrib/sIPOPT/src/SensStdStepCalc.hpp

    r1981 r1982  
    88#define __ASSTDSTEPCALC_HPP__
    99
    10 #include "AsAsBacksolver.hpp"
    11 #include "AsSensStepCalc.hpp"
     10#include "SensBacksolver.hpp"
     11#include "SensStepCalc.hpp"
    1212#include <vector>
    1313
  • trunk/Ipopt/contrib/sIPOPT/src/SensStepCalc.hpp

    r1981 r1982  
    99
    1010#include "IpAlgStrategy.hpp"
    11 #include "AsSchurDriver.hpp"
     11#include "SensSchurDriver.hpp"
    1212
    1313
     
    4040      return true;
    4141    }
    42    
     42
    4343    bool Do_Boundcheck() const
    4444    {
     
    6565     *  a step using its SchurDriver, checks bounds, and returns it */
    6666    virtual bool Step(DenseVector& delta_u, IteratesVector& sol) =0;
    67    
     67
    6868
    6969  private:
  • trunk/Ipopt/contrib/sIPOPT/src/SensUtils.cpp

    r1981 r1982  
    66
    77
    8 #include "AsNmpcUtils.hpp"
     8#include "SensUtils.hpp"
    99#include <sstream>
    1010
    11 namespace Ipopt 
     11namespace Ipopt
    1212{
    1313
Note: See TracChangeset for help on using the changeset viewer.