- Timestamp:
- 06/11/10 14:18:09 (14 years ago)
- Location:
- library/bdm
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/mex/mex_pdf.h
r1064 r1083 1 using namespace bdm; 2 1 3 class mexEpdf: public epdf { 2 4 protected: -
library/bdm/stat/exp_family.cpp
r1079 r1083 415 415 416 416 417 double egamma::evallog ( const vec &val ) const {417 double egamma::evallog_nn ( const vec &val ) const { 418 418 double res = 0.0; //the rest will be added 419 419 int i; … … 424 424 res += ( alpha ( i ) - 1 ) * std::log ( val ( i ) ) - beta ( i ) * val ( i ); 425 425 } 426 double tmp = res - lognc();; 427 bdm_assert_debug ( std::isfinite ( tmp ), "Infinite value" ); 428 return tmp; 426 return res; 429 427 } 430 428 -
library/bdm/stat/exp_family.h
r1079 r1083 893 893 894 894 vec sample() const; 895 double evallog( const vec &val ) const;896 895 double evallog_nn ( const vec &val ) const; 896 double lognc () const; 897 897 //! Returns pointer to internal alpha. Potentially dengerous: use with care! 898 898 vec& _alpha() { -
library/bdm/stat/merger.h
r1079 r1083 38 38 //! 39 39 //! check if all epdfs are on the same support 40 v oid validate_sources() {41 int n= sources.length();40 virtual void set_sources(const Array<shared_ptr<pdf> > &A) { 41 int n=A.length(); 42 42 43 43 bdm_assert(n>0,"merger has no sources to merge"); … … 48 48 49 49 // check compatibility of sources -- no types are needed 50 int dim0 = sources(0)->dimension();50 int dim0 = A(0)->dimension(); 51 51 for (int i=0; i<n; i++){ 52 const epdf *si=dynamic_cast<const epdf*>(A(i).get()); 53 if (si){ 54 sources(i) = dynamic_cast<epdf*>(A(i)->_copy()); 55 } 52 56 bdm_assert(sources(i)->dimension()==dim0, "Merger: Incompatible dimensions of sources"); 53 57 if (sources(i)->isnamed()){