* [gentoo-science] sci-libs/ccp4-apps-6.1.3
@ 2010-01-21 18:44 99% Johan Hattne
0 siblings, 0 replies; 1+ results
From: Johan Hattne @ 2010-01-21 18:44 UTC (permalink / raw
To: gentoo-science
[-- Attachment #1: Type: text/plain, Size: 784 bytes --]
Dear all;
I don't know enough C++ to figure this one out--to me it seems the
compiler gets confused somewhere in the instantiation of some of the
templates in clipper_progs, at least on amd64 with gcc-4.3.4. The
mystery error messages are:
intensity_target.h:114: error: expected constructor, destructor, or
type conversion before ‘<’ token
intensity_target.h:120: error: expected initializer before ‘<’ token
The attached patch works around whatever the problem may be by putting
the definition of the functions inside the class.
Also, it seems like the CCP4 people have modified the
ccp4-6.1.3-core-src tarball. As a result, the manifests of
sci-chemistry/ccp4-apps, sci-chemistry/ccp4i, and sci-libs/ccp4-libs
need updating.
// Cheers; Johan
[-- Attachment #2: 6.1.3-clipper-template.patch --]
[-- Type: text/plain, Size: 2619 bytes --]
--- src/clipper_progs/src/intensity_target.h.orig 2010-01-21 11:27:13.236795886 -0600
+++ src/clipper_progs/src/intensity_target.h 2010-01-21 11:31:33.450686927 -0600
@@ -70,9 +70,31 @@
{
public:
//! constructor: takes the datalist against which to calc target
- TargetFn_scaleLogI1I2( const HKL_data<T1>& hkl_data1_, const HKL_data<T2>& hkl_data2_ );
+ TargetFn_scaleLogI1I2( const HKL_data<T1>& hkl_data1_, const HKL_data<T2>& hkl_data2_ )
+ {
+ hkl_data1 = &hkl_data1_;
+ hkl_data2 = &hkl_data2_;
+ }
//! return the value and derivatives of the target function
- Rderiv rderiv( const HKL_info::HKL_reference_index& ih, const ftype& intensityh ) const;
+ Rderiv rderiv( const HKL_info::HKL_reference_index& ih, const ftype& intensityh ) const
+ {
+ Rderiv result;
+ result.r = result.dr = result.dr2 = 0.0;
+ const T1& it1 = (*hkl_data1)[ih];
+ const T2& it2 = (*hkl_data2)[ih];
+ if ( !it1.missing() && !it2.missing() )
+ if ( it1.I() > 1.0e-6 && it2.I() > 1.0e-6 ) {
+ const ftype eps = ih.hkl_class().epsilon();
+ const ftype i1 = it1.I() / eps;
+ const ftype i2 = it2.I() / eps;
+ const ftype w = sqrt( i1 * i2 );
+ const ftype d = intensityh + log(i1) - log(i2);
+ result.r = w * d * d;
+ result.dr = 2.0 * w * d;
+ result.dr2 = 2.0 * w;
+ }
+ return result;
+ }
//! the type of the function: optionally used to improve convergence
FNtype type() const { return QUADRATIC; }
private:
@@ -109,33 +131,4 @@
return result;
}
- // Log I1-I2 scaling
-
- template<class T1, class T2> TargetFn_scaleLogI1I2<T1,T2>::TargetFn_scaleLogI1I2( const HKL_data<T1>& hkl_data1_, const HKL_data<T2>& hkl_data2_ )
- {
- hkl_data1 = &hkl_data1_;
- hkl_data2 = &hkl_data2_;
- }
-
- template<class T1, class T2> TargetFn_base::Rderiv TargetFn_scaleLogI1I2<T1,T2>::rderiv( const HKL_info::HKL_reference_index& ih, const ftype& intensityh ) const
- {
- Rderiv result;
- result.r = result.dr = result.dr2 = 0.0;
- const T1& it1 = (*hkl_data1)[ih];
- const T2& it2 = (*hkl_data2)[ih];
- if ( !it1.missing() && !it2.missing() )
- if ( it1.I() > 1.0e-6 && it2.I() > 1.0e-6 ) {
- const ftype eps = ih.hkl_class().epsilon();
- const ftype i1 = it1.I() / eps;
- const ftype i2 = it2.I() / eps;
- const ftype w = sqrt( i1 * i2 );
- const ftype d = intensityh + log(i1) - log(i2);
- result.r = w * d * d;
- result.dr = 2.0 * w * d;
- result.dr2 = 2.0 * w;
- }
- return result;
- }
-
-
#endif
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2010-01-21 18:44 99% [gentoo-science] sci-libs/ccp4-apps-6.1.3 Johan Hattne
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox