Sorry, forgot the patch. Attached here.

Kumar
-- 
Kumar Appaiah,
458, Jamuna Hostel,
Indian Institute of Technology Madras,
Chennai - 600 036
From d0373919dab24a2dde440e9bf9a4d7f41b5a1251 Mon Sep 17 00:00:00 2001
From: Kumar Appaiah <[EMAIL PROTECTED]>
Date: Tue, 18 Mar 2008 17:47:15 +0530
Subject: [PATCH] Fix complex constructors in operators.cpp to build with g++ 4.3.

It appears that g++ 4.3 is a bit more strict with respect to type
checking when we attempt to overload the std::complex constructor for
use with non-double types. Use of an explicit static_cast is needed to
overcome this restriction. This patch does the needful by converting
those constructors to use static_casts.

Signed-off-by: Kumar Appaiah <[EMAIL PROTECTED]>
---
 itpp/base/operators.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/itpp/base/operators.cpp b/itpp/base/operators.cpp
index 1ab586d..041d048 100644
--- a/itpp/base/operators.cpp
+++ b/itpp/base/operators.cpp
@@ -434,7 +434,7 @@ namespace itpp {
 
     for (int i=0;i<a.rows();i++) {
       for (int j=0;j<a.cols();j++) {
-	temp(i,j)+=(std::complex<double>)a(i,j);
+        temp(i,j) += std::complex<double>(static_cast<double>(a(i,j)), 0.0);
       }
     }
     return temp;
@@ -460,7 +460,7 @@ namespace itpp {
 
     for (int i=0;i<a.rows();i++) {
       for (int j=0;j<a.cols();j++) {
-	temp(i,j)+=(std::complex<double>)a(i,j);
+        temp(i,j) += std::complex<double>(static_cast<double>(a(i,j)), 0.0);
       }
     }
     return temp;
@@ -473,7 +473,7 @@ namespace itpp {
 
     for (int i=0;i<a.rows();i++) {
       for (int j=0;j<a.cols();j++) {
-	temp(i,j)+=(std::complex<double>)a(i,j);
+        temp(i,j) += std::complex<double>(static_cast<double>(a(i,j)), 0.0);
       }
     }
     return temp;
-- 
1.5.4.4

Attachment: signature.asc
Description: Digital signature

Reply via email to