From: Johan Hattne <johan.hattne@utsouthwestern.edu>
To: gentoo-science@lists.gentoo.org
Subject: [gentoo-science] sci-libs/ccp4-apps-6.1.3
Date: Thu, 21 Jan 2010 12:44:35 -0600 [thread overview]
Message-ID: <4B58A093.9030004@utsouthwestern.edu> (raw)
[-- 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
next reply other threads:[~2010-01-21 18:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-21 18:44 Johan Hattne [this message]
2010-01-21 19:15 ` [gentoo-science] sci-libs/ccp4-apps-6.1.3 Justin
2010-01-21 19:32 ` Johan Hattne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B58A093.9030004@utsouthwestern.edu \
--to=johan.hattne@utsouthwestern.edu \
--cc=gentoo-science@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox