public inbox for gentoo-science@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-science] sci-libs/ccp4-apps-6.1.3
@ 2010-01-21 18:44 Johan Hattne
  2010-01-21 19:15 ` Justin
  0 siblings, 1 reply; 3+ messages in thread
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	[flat|nested] 3+ messages in thread

* Re: [gentoo-science] sci-libs/ccp4-apps-6.1.3
  2010-01-21 18:44 [gentoo-science] sci-libs/ccp4-apps-6.1.3 Johan Hattne
@ 2010-01-21 19:15 ` Justin
  2010-01-21 19:32   ` Johan Hattne
  0 siblings, 1 reply; 3+ messages in thread
From: Justin @ 2010-01-21 19:15 UTC (permalink / raw
  To: gentoo-science

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

On 21/01/10 19:44, Johan Hattne wrote:
> 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

Thanks for that one. I will take a look into it a soon as possible.
You can always file bugs at bugs.gentoo.org and CC me. I will take care
of it then.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-science] sci-libs/ccp4-apps-6.1.3
  2010-01-21 19:15 ` Justin
@ 2010-01-21 19:32   ` Johan Hattne
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Hattne @ 2010-01-21 19:32 UTC (permalink / raw
  To: gentoo-science

On 01/21/10 13:15, Justin wrote:
> On 21/01/10 19:44, Johan Hattne wrote:
>> 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
> 
> Thanks for that one. I will take a look into it a soon as possible.
> You can always file bugs at bugs.gentoo.org and CC me. I will take care
> of it then.
> 

Right!  See #301762.

// Cheers; Johan




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-21 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-21 18:44 [gentoo-science] sci-libs/ccp4-apps-6.1.3 Johan Hattne
2010-01-21 19:15 ` Justin
2010-01-21 19:32   ` Johan Hattne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox