Commit 17c722d6 authored by Andreas Marek's avatar Andreas Marek
Browse files

Remove solve_tridi from new API. as long as general banded case is not implemented

parent 85279fad
......@@ -131,7 +131,6 @@ the user application):
a) e%eigenvectors ! solve EV problem with solver as set by "set" method; computes eigenvalues AND eigenvectors
! (replaces a) and b) from legacy API)
b) e%eigenvalues ! solve EV problem with solver as set by "set" method; computes eigenvalues only
b) e%solve_tridi ! solve problem with tridiagonal matrix (replacement for c) from legacy API)
c) e%choleksy ! do a cholesky decomposition (replaces d) from legacy API)
d) e%invert_tridiagonal ! invert triangular matrix (replaces e) from legacy API)
e) e%hermitian_multiply ! multiply a**T *b or a**H *b (replaces f) and g) from legacy API)
......
......@@ -72,7 +72,6 @@ Using *ELPA* with the latest API is done in the following steps
real/complex matrices
- "cholesky" does a cholesky factorization for a single/double real/complex matrix
- "invert_triangular" inverts a single/double real/complex triangular matrix
- "solve_tridi" solves the eigenvalue problem for a single/double real tridiagonale matrix
- if the ELPA object is not needed any more call ELPA-type function destroy
......
......@@ -130,23 +130,3 @@
float complex*: \
elpa_invert_trm_fc \
)(handle, a, error)
/*! \brief generic C method for elpa_solve_tridi
*
* \details
* \param handle handle of the ELPA object, which defines the problem
* \param d float/double pointer to the diagonal elements of a matrix a,
* on output: eigenvalues in ascending order
* \param e float/double pointer to the subdiagonal elements of a matrix a
* \param q on output: float/double pointer to the eigenvectors
* \param error on return the error code, which can be queried with elpa_strerr()
* \result void
*/
#define elpa_solve_tridi(handle, d, e, q, error) _Generic((d), \
double*: \
elpa_solve_tridi_d, \
\
float*: \
elpa_solve_tridi_f \
)(handle, d, e, q, error)
......@@ -57,7 +57,11 @@
#include "../../general/sanity.X90"
use precision
use elpa1_auxiliary_impl, only : elpa_solve_tridi_&
&PRECISION&
&_impl
use elpa
use elpa_abstract_impl
implicit none
integer(kind=ik) :: na, nev, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
real(kind=REAL_DATATYPE) :: d(na), e(na)
......@@ -68,7 +72,7 @@
#endif
logical, intent(in) :: wantDebug
logical :: success
logical :: success
integer(kind=iK) :: successInternal
class(elpa_t), pointer :: obj
......@@ -103,16 +107,19 @@
if (wantDebug) then
call obj%set("debug",1)
endif
call obj%solve_tridi(d(1:na), e(1:na), q(1:ldq,1:matrixCols), successInternal)
if (successInternal .ne. ELPA_OK) then
print *, "Cannot run solve_tridi"
stop
success = .false.
return
else
success =.true.
endif
select type(obj)
class is (elpa_abstract_impl_t)
success = elpa_solve_tridi_&
&PRECISION&
&_impl(obj, d, e, q)
!call obj%solve_tridi(d(1:na), e(1:na), q(1:ldq,1:matrixCols), successInternal)
if (.not.(success)) then
print *, "Cannot run solve_tridi"
return
endif
end select
call elpa_deallocate(obj)
call elpa_uninit()
......
......@@ -128,7 +128,7 @@ module elpa_api
elpa_invert_trm_dc, &
elpa_invert_trm_fc
generic, public :: solve_tridi => & !< method to solve the eigenvalue problem for a tridiagonal
generic, private :: solve_tridi => & !< method to solve the eigenvalue problem for a tridiagonal
elpa_solve_tridi_d, & !< matrix
elpa_solve_tridi_f
......
......@@ -1899,23 +1899,6 @@ module elpa_impl
end subroutine
!c> void elpa_solve_tridi_d(elpa_t handle, double *d, double *e, double *q, int *error);
subroutine elpa_solve_tridi_d_c(handle, d_p, e_p, q_p, error) bind(C, name="elpa_solve_tridi_d")
type(c_ptr), intent(in), value :: handle, d_p, e_p, q_p
integer(kind=c_int), optional, intent(in) :: error
real(kind=c_double), pointer :: d(:), e(:), q(:,:)
type(elpa_impl_t), pointer :: self
call c_f_pointer(handle, self)
call c_f_pointer(d_p, d, [self%na])
call c_f_pointer(e_p, e, [self%na])
call c_f_pointer(q_p, q, [self%local_nrows,self%local_ncols])
call elpa_solve_tridi_d(self, d, e, q, error)
end subroutine
!> \brief elpa_solve_tridi_f: class method to solve the eigenvalue problem for a float real tridiagonal matrix a
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cylic-distribution
......@@ -1966,24 +1949,6 @@ module elpa_impl
end subroutine
!c> void elpa_solve_tridi_f(elpa_t handle, float *d, float *e, float *q, int *error);
subroutine elpa_solve_tridi_f_c(handle, d_p, e_p, q_p, error) bind(C, name="elpa_solve_tridi_f")
type(c_ptr), intent(in), value :: handle, d_p, e_p, q_p
integer(kind=c_int), optional, intent(in) :: error
real(kind=c_float), pointer :: d(:), e(:), q(:,:)
type(elpa_impl_t), pointer :: self
call c_f_pointer(handle, self)
call c_f_pointer(d_p, d, [self%na])
call c_f_pointer(e_p, e, [self%na])
call c_f_pointer(q_p, q, [self%local_nrows,self%local_ncols])
call elpa_solve_tridi_f(self, d, e, q, error)
end subroutine
subroutine elpa_destroy(self)
use elpa_generated_fortran_interfaces
class(elpa_impl_t) :: self
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment