Skip to content

Commit

Permalink
Test: enable generic xGGQRCS tests for ZGGQRCS
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-conrads committed Apr 22, 2020
1 parent 3e93e39 commit fb5dfb3
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
13 changes: 13 additions & 0 deletions TESTING/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,16 @@ if(BUILD_COMPLEX)

add_test(NAME cpp_tests_complex COMMAND cpp_tests_complex)
endif()


if(BUILD_COMPLEX16)
add_executable(cpp_tests_complex16
main.cpp
zggqrcs.cpp)
target_link_libraries(cpp_tests_complex16
tmglib
${LAPACK_LIBRARIES}
${Boost_LIBRARIES})

add_test(NAME cpp_tests_complex16 COMMAND cpp_tests_complex16)
endif()
48 changes: 48 additions & 0 deletions TESTING/cpp/lapack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,24 @@ extern "C"
lapack_int* info,
std::size_t jobu1_len, std::size_t jobu2_len, std::size_t jobqt_len
);

void zggqrcs_(
char* jobu1, char* jobu2, char* jobqt,
lapack_int* m, lapack_int* n, lapack_int* p,
double* w, lapack_int* l,
std::complex<double>* A, lapack_int* lda,
std::complex<double>* B, lapack_int* ldb,
double* theta,
std::complex<double>* U1, lapack_int* ldu1,
std::complex<double>* U2, lapack_int* ldu2,
std::complex<double>* Qt, lapack_int* ldqt,
std::complex<double>* work, lapack_int* lwork,
double* rwork, lapack_int* lrwork,
lapack_int* iwork,
lapack_int* info,
std::size_t jobu1_len, std::size_t jobu2_len, std::size_t jobqt_len
);

}


Expand Down Expand Up @@ -450,6 +468,36 @@ inline integer_t ggqrcs(
return info;
}

inline integer_t ggqrcs(
char jobu1, char jobu2, char jobqt,
integer_t m, integer_t n, integer_t p, double* w, integer_t* l,
std::complex<double>* A, integer_t lda,
std::complex<double>* B, integer_t ldb,
double* theta,
std::complex<double>* U1, integer_t ldu1,
std::complex<double>* U2, integer_t ldu2,
std::complex<double>* Qt, integer_t ldqt,
std::complex<double>* work, integer_t lwork,
double* rwork, integer_t lrwork,
integer_t* iwork)
{
assert( w );
assert( l );
assert( work );
assert( rwork );

integer_t info = -1;
zggqrcs_(
&jobu1, &jobu2, &jobqt,
&m, &n, &p, w, l,
A, &lda, B, &ldb,
theta,
U1, &ldu1, U2, &ldu2, Qt, &ldqt,
work, &lwork, rwork, &lrwork, iwork, &info,
1, 1, 1);
return info;
}



#ifdef HAS_GGSVD3
Expand Down
34 changes: 34 additions & 0 deletions TESTING/cpp/zggqrcs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2020 Christoph Conrads (https://christoph-conrads.name)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holders nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <boost/mpl/list.hpp>
#include <complex>


typedef boost::mpl::list<std::complex<double>> test_types;

#include <ggqrcs.hpp>

0 comments on commit fb5dfb3

Please sign in to comment.