Changeset 737 for library/bdm/math

Show
Ignore:
Timestamp:
11/25/09 12:14:38 (15 years ago)
Author:
mido
Message:

ASTYLER RUN OVER THE WHOLE LIBRARY, JUPEE

Location:
library/bdm/math
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/math/chmat.cpp

    r565 r737  
    44//using std::endl; 
    55 
    6 namespace bdm 
    7 { 
     6namespace bdm { 
    87 
    98void chmat::opupdt ( const vec &v, double w ) { 
  • library/bdm/math/chmat.h

    r725 r737  
    1717#include "square_mat.h" 
    1818 
    19 namespace bdm 
    20 { 
     19namespace bdm { 
    2120 
    2221/*! \brief Symmetric matrix stored in square root decomposition using upper cholesky 
     
    110109        void setCh ( const chmat &Ch0 ) { 
    111110                Ch = Ch0._Ch(); 
    112                 dim=Ch0.rows(); 
     111                dim = Ch0.rows(); 
    113112        } 
    114113        //! access function 
     
    116115                //TODO check if Ch0 is OK!!! 
    117116                Ch = Ch0; 
    118                 dim=Ch0.rows(); 
     117                dim = Ch0.rows(); 
    119118        } 
    120          
     119 
    121120        //! Access functions 
    122121        void setD ( const vec &nD, int i ) { 
     
    126125        } 
    127126 
    128         //! Operator  
     127        //! Operator 
    129128        chmat& operator += ( const chmat &A2 ); 
    130         //! Operator  
     129        //! Operator 
    131130        chmat& operator -= ( const chmat &A2 ); 
    132         //! Operator  
     131        //! Operator 
    133132        chmat& operator * ( const double &d ) { 
    134133                Ch*sqrt ( d ); 
    135134                return *this; 
    136135        }; 
    137         //! Operator  
     136        //! Operator 
    138137        chmat& operator = ( const chmat &A2 ) { 
    139138                Ch = A2.Ch; 
     
    141140                return *this; 
    142141        } 
    143         //! Operator  
     142        //! Operator 
    144143        chmat& operator *= ( double x ) { 
    145144                Ch *= sqrt ( x ); 
  • library/bdm/math/functions.h

    r665 r737  
    8484        vec eval ( const vec &cond ) { 
    8585                bdm_assert_debug ( cond.length() == ( dimx + dimu ), "linfn::eval Wrong cond." ); 
    86                 if (dimu>0){ 
     86                if ( dimu > 0 ) { 
    8787                        return eval ( cond ( 0, dimx - 1 ), cond ( dimx, dimx + dimu - 1 ) );//-1 = end (in matlab) 
    8888                } else { 
    89                         return eval ( cond ( 0, dimx - 1 ), vec(0) );//-1 = end (in matlab) 
     89                        return eval ( cond ( 0, dimx - 1 ), vec ( 0 ) );//-1 = end (in matlab) 
    9090                } 
    91                                  
     91 
    9292        } 
    9393 
  • library/bdm/math/square_mat.cpp

    r725 r737  
    22#include "square_mat.h" 
    33 
    4 namespace bdm 
    5 { 
     4namespace bdm { 
    65 
    76using namespace itpp; 
  • library/bdm/math/square_mat.h

    r700 r737  
    1818#include "../bdmerror.h" 
    1919 
    20 namespace bdm 
    21 { 
     20namespace bdm { 
    2221 
    2322using namespace itpp; 
     
    4342         BLAS-2b operation. 
    4443         */ 
    45         virtual void opupdt ( const vec &v, double w ) { bdm_error("not implemented"); }; 
     44        virtual void opupdt ( const vec &v, double w ) { 
     45                bdm_error ( "not implemented" ); 
     46        }; 
    4647 
    4748        /*! \brief Conversion to full matrix. 
    4849        */ 
    4950 
    50         virtual mat to_mat() const { bdm_error("not implemented"); return mat(0,0); } 
     51        virtual mat to_mat() const { 
     52                bdm_error ( "not implemented" ); 
     53                return mat ( 0, 0 ); 
     54        } 
    5155 
    5256        /*! \brief Inplace symmetric multiplication by a SQUARE matrix \f$C\f$, i.e. \f$V = C*V*C'\f$ 
    5357        @param C multiplying matrix, 
    5458        */ 
    55         virtual void mult_sym ( const mat &C ) { bdm_error("not implemented"); }; 
     59        virtual void mult_sym ( const mat &C ) { 
     60                bdm_error ( "not implemented" ); 
     61        }; 
    5662 
    5763        /*! \brief Inplace symmetric multiplication by a SQUARE transpose of matrix \f$C\f$, i.e. \f$V = C'*V*C\f$ 
    5864        @param C multiplying matrix, 
    5965        */ 
    60         virtual void mult_sym_t ( const mat &C ) { bdm_error("not implemented"); } 
     66        virtual void mult_sym_t ( const mat &C ) { 
     67                bdm_error ( "not implemented" ); 
     68        } 
    6169 
    6270 
     
    6573 
    6674        */ 
    67         virtual double logdet() const { bdm_error("not implemented"); return 0;}; 
     75        virtual double logdet() const { 
     76                bdm_error ( "not implemented" ); 
     77                return 0; 
     78        }; 
    6879 
    6980        /*! 
     
    7283        Used e.g. in generating normal samples. 
    7384        */ 
    74         virtual vec sqrt_mult ( const vec &v )  const { bdm_error("not implemented"); return vec(0); }; 
     85        virtual vec sqrt_mult ( const vec &v )  const { 
     86                bdm_error ( "not implemented" ); 
     87                return vec ( 0 ); 
     88        }; 
    7589 
    7690        /*! 
     
    7892 
    7993        */ 
    80         virtual double qform ( const vec &v ) const { bdm_error("not implemented"); return 0; }; 
     94        virtual double qform ( const vec &v ) const { 
     95                bdm_error ( "not implemented" ); 
     96                return 0; 
     97        }; 
    8198 
    8299        /*! 
     
    84101 
    85102        */ 
    86         virtual double invqform ( const vec &v ) const { bdm_error("not implemented"); return 0; }; 
     103        virtual double invqform ( const vec &v ) const { 
     104                bdm_error ( "not implemented" ); 
     105                return 0; 
     106        }; 
    87107 
    88108//      //! easy version of the 
     
    90110 
    91111        //! Clearing matrix so that it corresponds to zeros. 
    92         virtual void clear() { bdm_error("not implemented"); }; 
     112        virtual void clear() { 
     113                bdm_error ( "not implemented" ); 
     114        }; 
    93115 
    94116        //! Reimplementing common functions of mat: cols(). 
     
    214236                return *this; 
    215237        }; 
    216          
     238 
    217239        //! cast to normal mat 
    218         operator mat&() {return M;}; 
    219          
     240        operator mat&() { 
     241                return M; 
     242        }; 
     243 
    220244//              fsqmat& operator = ( const fsqmat &A) {M=A.M; return *this;}; 
    221245        //! print full matrix 
    222246        friend std::ostream &operator<< ( std::ostream &os, const fsqmat &sq ); 
    223247        //!access function 
    224         mat & _M (  ) {return M;}; 
     248        mat & _M ( ) { 
     249                return M; 
     250        }; 
    225251 
    226252};