Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move [cz]symv and [cz]syr to BLAS++ #71

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,6 @@ add_library(
src/sygv.cc
src/sygvd.cc
src/sygvx.cc
src/symv.cc
src/syr.cc
src/syrfs.cc
src/syrfsx.cc
src/sysv_aa.cc
Expand Down
10 changes: 0 additions & 10 deletions docs/doxygen/groups.dox
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,6 @@
@defgroup auxiliary Other auxiliary routines
@}

----------------------------------------------------------------------------
@defgroup group_blas BLAS extensions in LAPACK
@{
@defgroup symv symv: Symmetric matrix-vector multiply
@brief $y = \alpha Ax + \beta y$

@defgroup syr syr: Symmetric rank 1 update
@brief $A = \alpha xx^T + A$
@}

----------------------------------------------------------------------------
@defgroup group_test Test routines
@{
Expand Down
83 changes: 24 additions & 59 deletions include/lapack/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,92 +21,57 @@
#else
typedef int lapack_int;
#endif
/* #define so that #ifdef works. */
// #define so we can check later with #ifdef.
#define lapack_int lapack_int
#endif

#ifndef lapack_logical
#define lapack_logical lapack_int
#endif

/* f2c, hence MacOS Accelerate, returns double instead of float
* for sdot, slange, clange, etc. */
// f2c, hence MacOS Accelerate (before 13.3), returns double instead of float
// for sdot, slange, clange, etc.
// LAPACKE's lapack.h is missing #define to protect against multiple
// definitions, so use lapackpp prefix.
#if defined(BLAS_HAVE_ACCELERATE) || defined(BLAS_HAVE_F2C)
typedef double lapack_float_return;
typedef double lapackpp_float_return;
#else
typedef float lapack_float_return;
typedef float lapackpp_float_return;
#endif
// #define so we can check later with #ifdef.
#define lapackpp_float_return lapackpp_float_return

/* --------------------------------------------------------------------------
* Complex types */
#if defined(LAPACK_COMPLEX_CUSTOM)
/* If user defines LAPACK_COMPLEX_CUSTOM, then the user must define:
* lapack_complex_float
* lapack_complex_double
* lapack_complex_float_real(z)
* lapack_complex_float_imag(z)
* lapack_complex_double_real(z)
* lapack_complex_double_imag(z)
*/
//------------------------------------------------------------------------------
// Complex types
#if defined( lapack_complex_float ) || defined( LAPACK_COMPLEX_CUSTOM )
// LAPACKE's header may already define lapack_complex_float. Otherwise,
// if user defines LAPACK_COMPLEX_CUSTOM, then the user must define:
// lapack_complex_float
// lapack_complex_double

#elif defined(LAPACK_COMPLEX_STRUCTURE) || defined(_MSC_VER)

/* If user defines LAPACK_COMPLEX_STRUCTURE, then use a struct.
* Also use this for MSVC, as it has no C99 _Complex.
*/
// If user defines LAPACK_COMPLEX_STRUCTURE, then use a struct.
// Also use this for MSVC, as it has no C99 _Complex.
typedef struct { float real, imag; } lapack_complex_float;
typedef struct { double real, imag; } lapack_complex_double;
#define lapack_complex_float_real(z) ((z).real)
#define lapack_complex_float_imag(z) ((z).imag)
#define lapack_complex_double_real(z) ((z).real)
#define lapack_complex_double_imag(z) ((z).imag)

#elif defined(LAPACK_COMPLEX_CPP) && defined(__cplusplus)
/* If user defines LAPACK_COMPLEX_CPP, then use C++ std::complex.
* This isn't compatible as a return type from extern C functions,
* so it may generate compiler warnings or errors. */
// If user defines LAPACK_COMPLEX_CPP, then use C++ std::complex.
// This isn't compatible as a return type from extern C functions,
// so it may generate compiler warnings or errors.
#include <complex>
typedef std::complex<float> lapack_complex_float;
typedef std::complex<double> lapack_complex_double;
#define lapack_complex_float_real(z) ((z).real())
#define lapack_complex_float_imag(z) ((z).imag())
#define lapack_complex_double_real(z) ((z).real())
#define lapack_complex_double_imag(z) ((z).imag())

#else

/* Otherwise, by default use C99 _Complex. */
// Otherwise, by default use C99 _Complex.
#include <complex.h>
typedef float _Complex lapack_complex_float;
typedef double _Complex lapack_complex_double;
#define lapack_complex_float_real(z) (creal(z))
#define lapack_complex_float_imag(z) (cimag(z))
#define lapack_complex_double_real(z) (creal(z))
#define lapack_complex_double_imag(z) (cimag(z))

#endif

/* define so we can check later with ifdef */
// #define so we can check later with #ifdef.
#define lapack_complex_float lapack_complex_float
#define lapack_complex_double lapack_complex_double

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

lapack_complex_float lapack_make_complex_float( float re, float im );
lapack_complex_double lapack_make_complex_double( double re, double im );

#ifdef __cplusplus
}
#endif /* __cplusplus */

#ifndef LAPACK_malloc
#define LAPACK_malloc( size ) malloc( size )
#endif

#ifndef LAPACK_free
#define LAPACK_free( p ) free( p )
#endif

#endif /* LAPACK_CONFIG_H */
#endif // LAPACK_CONFIG_H
Loading
Loading