Changeset 3749


Ignore:
Timestamp:
Nov 15, 2015 10:39:22 AM (4 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 3f7008b477fdb967404fd2bf37f15dde076fd074
end hash code: 33fdadb9e550612e5ec560e58bf6b832f326328e

commit 33fdadb9e550612e5ec560e58bf6b832f326328e
Author: Brad Bell <bradbell@…>
Date: Sat Nov 14 08:59:48 2015 -0800

Remove invisible white space.

commit dc4d800a01f783c71ead9aa155315d679aac0611
Author: Brad Bell <bradbell@…>
Date: Sat Nov 14 08:59:25 2015 -0800

fix reference to stringstream used in error message.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/cppad/local/forward.hpp

    r3744 r3749  
    206206                        "vector_size = " << n << "\n" <<
    207207                        "file_name = " << file_name << "\n";
    208                         const char* msg = ss.str().c_str();
     208                        // ss.str() returns a string object with a copy of the current
     209                        // contents in the stream buffer.
     210                        std::string msg_str       = ss.str();
     211                        // msg_str.c_str() returns a pointer to the c-string
     212                        // representation of the string object's value.
     213                        const char* msg_char_star = msg_str.c_str();
    209214                        ErrorHandler::Call(
    210215                                true,
     
    212217                                __FILE__,
    213218                                "! CppAD::isnan( yq[ (q+1) * i + 0 ] )",
    214                                 msg
     219                                msg_char_star
    215220                        );
    216221                }
  • trunk/cppad/local/fun_construct.hpp

    r3607 r3749  
    77
    88CppAD is distributed under multiple licenses. This distribution is under
    9 the terms of the 
     9the terms of the
    1010                    Eclipse Public License Version 1.0.
    1111
     
    1515/*
    1616$begin FunConstruct$$
    17 $spell 
     17$spell
    1818        alloc
    1919        num
     
    4747
    4848$head Purpose$$
    49 The $codei%AD<%Base%>%$$ object $icode f$$ can 
     49The $codei%AD<%Base%>%$$ object $icode f$$ can
    5050store an AD of $icode Base$$
    5151$cref/operation sequence/glossary/Operation/Sequence/$$.
     
    6969        Independent(%x%)
    7070%$$
    71 and 
     71and
    7272$codei%
    7373        ADFun<%Base%> %f%(%x%, %y%)
     
    8484$head VectorAD$$
    8585The type $icode VectorAD$$ must be a $cref SimpleVector$$ class with
    86 $cref/elements of type/SimpleVector/Elements of Specified Type/$$ 
     86$cref/elements of type/SimpleVector/Elements of Specified Type/$$
    8787$codei%AD<%Base%>%$$.
    8888The routine $cref CheckSimpleVector$$ will generate an error message
     
    9393$index ADFun, default constructor$$
    9494$index constructor, ADFun constructor$$
    95 The default constructor 
     95The default constructor
    9696$codei%
    9797        ADFun<%Base%> %f%
    9898%$$
    99 creates an 
     99creates an
    100100$codei%AD<%Base%>%$$ object with no corresponding operation sequence; i.e.,
    101101$codei%
     
    108108$index ADFun, sequence constructor$$
    109109$index constructor, ADFun sequence$$
    110 The sequence constructor 
     110The sequence constructor
    111111$codei%
    112112        ADFun<%Base%> %f%(%x%, %y%)
     
    119119%$$
    120120and stores the corresponding operation sequence in the object $icode f$$.
    121 It then stores the zero order Taylor coefficients 
     121It then stores the zero order Taylor coefficients
    122122(corresponding to the value of $icode x$$) in $icode f$$.
    123123This is equivalent to the following steps using the default constructor:
     
    135135(see $cref Dependent$$).
    136136$lnext
    137 Calculate the zero order Taylor coefficients for all 
     137Calculate the zero order Taylor coefficients for all
    138138the variables in the operation sequence using
    139139$codei%
     
    174174
    175175$subhead Taylor Coefficients$$
    176 The Taylor coefficient information currently stored in $icode f$$ 
    177 (computed by $cref/f.Forward/Forward/$$) is 
     176The Taylor coefficient information currently stored in $icode f$$
     177(computed by $cref/f.Forward/Forward/$$) is
    178178copied to $icode g$$.
    179179Hence, directly after this operation
     
    183183
    184184$subhead Sparsity Patterns$$
    185 The forward Jacobian sparsity pattern currently stored in $icode f$$ 
    186 (computed by $cref/f.ForSparseJac/ForSparseJac/$$) is 
     185The forward Jacobian sparsity pattern currently stored in $icode f$$
     186(computed by $cref/f.ForSparseJac/ForSparseJac/$$) is
    187187copied to $icode g$$.
    188188Hence, directly after this operation
     
    200200        ADFun<%Base%> %f%( %x%, %y%)
    201201%$$
    202 or 
     202or
    203203$codei%
    204204        %f%.Dependent( %x%, %y%)
     
    212212$subhead Sequence Constructor$$
    213213The file
    214 $cref independent.cpp$$ 
     214$cref independent.cpp$$
    215215contains an example and test of the sequence constructor.
    216216It returns true if it succeeds and false otherwise.
     
    218218$subhead Default Constructor$$
    219219The files
    220 $cref fun_check.cpp$$ 
     220$cref fun_check.cpp$$
    221221and
    222222$cref hes_lagrangian.cpp$$
     
    228228%$$
    229229$subhead Assignment Operator$$
    230 The file 
     230The file
    231231$cref fun_assign.cpp$$
    232232contains an example and test of the $codei%ADFun<%Base%>%$$
     
    251251        ADFun<Base> f
    252252\endverbatim
    253 An empty ADFun object is created. 
     253An empty ADFun object is created.
    254254The Dependent member function,
    255255or the ADFun<Base> assingment operator,
     
    261261*/
    262262template <typename Base>
    263 ADFun<Base>::ADFun(void) : 
     263ADFun<Base>::ADFun(void) :
    264264has_been_optimized_(false),
    265265check_for_nan_(true) ,
     
    267267compare_change_number_(0),
    268268compare_change_op_index_(0),
    269 num_var_tape_(0) 
     269num_var_tape_(0)
    270270{ }
    271271
     
    278278\endverbatim
    279279where \c g and \c f are ADFun<Base> ADFun objects.
    280 A copy of the the operation sequence currently stored in \c f 
     280A copy of the the operation sequence currently stored in \c f
    281281is placed in this ADFun object (called \c g above).
    282282Any information currently stored in this ADFun object is lost.
     
    296296
    297297        // go through member variables in ad_fun.hpp order
    298         // 
     298        //
    299299        // size_t objects
    300300        has_been_optimized_        = f.has_been_optimized_;
     
    391391Thus, the zero order Taylor coefficients
    392392corresponding to the value of the \a x vector
    393 are stored in this ADFun object. 
     393are stored in this ADFun object.
    394394*/
    395395template <typename Base>
     
    475475# ifndef NDEBUG
    476476        // on MS Visual Studio 2012, CppAD required in front of isnan ?
    477         for(i = 0; i < m; i++) 
     477        for(i = 0; i < m; i++)
    478478        if( taylor_[dep_taddr_[i]] != y[i].value_ || CppAD::isnan( y[i].value_ ) )
    479479        {       using std::endl;
     
    482482                    << "its tape evaluation value," << endl
    483483                    << "perhaps it is nan." << endl
    484                     << "Dependent variable value = " 
     484                    << "Dependent variable value = "
    485485                    <<  y[i].value_ << endl
    486                     << "Tape evaluation value    = " 
     486                    << "Tape evaluation value    = "
    487487                    <<  taylor_[dep_taddr_[i]]  << endl
    488                     << "Difference               = " 
     488                    << "Difference               = "
    489489                    <<  y[i].value_ -  taylor_[dep_taddr_[i]]  << endl
    490490                ;
     491                // buf.str() returns a string object with a copy of the current
     492                // contents in the stream buffer.
     493                std::string msg_str       = buf.str();
     494                // msg_str.c_str() returns a pointer to the c-string
     495                // representation of the string object's value.
     496                const char* msg_char_star = msg_str.c_str();
    491497                CPPAD_ASSERT_KNOWN(
    492498                        0,
    493                         buf.str().c_str()
     499                        msg_char_star
    494500                );
    495501        }
  • trunk/cppad/thread_alloc.hpp

    r3717 r3749  
    10191019                        oss << "See CPPAD_TRACE_THREAD & CPPAD_TRACE_CAPACITY in";
    10201020                        oss << endl << "# include <cppad/thread_alloc.hpp>" << endl;
    1021                         CPPAD_ASSERT_KNOWN(false, oss.str().c_str()     );
     1021                        // oss.str() returns a string object with a copy of the current
     1022                        // contents in the stream buffer.
     1023                        std::string msg_str       = oss.str();
     1024                        // msg_str.c_str() returns a pointer to the c-string
     1025                        // representation of the string object's value.
     1026                        const char* msg_char_star = msg_str.c_str();
     1027                        CPPAD_ASSERT_KNOWN(false, msg_char_star );
    10221028                }
    10231029
  • trunk/omh/whats_new/whats_new_15.omh

    r3746 r3749  
    7676assist you in learning about changes between various versions of CppAD.
    7777
     78$head 11-14$$
     79There was a bug in the new
     80$cref/get_check_for_nan/check_for_nan/get_check_for_nan/$$
     81feature that writes independent variable values to a temporary file;
     82see $cref/11-06/whats_new_15/11-06/$$ below.
     83This has been fixed.
     84
     85
    7886$head 11-08$$
    7987$list number$$
Note: See TracChangeset for help on using the changeset viewer.