Skip to content

Commit

Permalink
Incorporating (and extending) another contribution from Michael Grant…
Browse files Browse the repository at this point in the history
… for the Python interface
  • Loading branch information
poulson committed May 30, 2013
1 parent f91a2eb commit a9e4e5c
Show file tree
Hide file tree
Showing 3 changed files with 527 additions and 609 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Jeff Hammond and Argonne National Laboratory:
improvement for Elemental's threading support.

Michael Grant:
Initial implementation of SWIG Python interface
The SWIG Python interface
17 changes: 17 additions & 0 deletions include/elemental/blas-like/level1/Conjugate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace elem {

#ifndef SWIG
// Default case is for real datatypes
template<typename Z>
inline void
Expand All @@ -32,6 +33,22 @@ Conjugate( Matrix<Complex<Z> >& A )
for( int i=0; i<m; ++i )
A.Set(i,j,Conj(A.Get(i,j)));
}
#else // ifndef SWIG
// Avoid what seems to be a bug in SWIG's template instantiation
template<typename T>
inline void
Conjugate( Matrix<T>& A )
{
#ifndef RELEASE
CallStackEntry entry("Conjugate (in-place)");
#endif
const int m = A.Height();
const int n = A.Width();
for( int j=0; j<n; ++j )
for( int i=0; i<m; ++i )
A.Set(i,j,Conj(A.Get(i,j)));
}
#endif // ifndef SWIG

template<typename T>
inline void
Expand Down
Loading

0 comments on commit a9e4e5c

Please sign in to comment.