Skip to content

Commit fb5dfb3

Browse files
Test: enable generic xGGQRCS tests for ZGGQRCS
1 parent 3e93e39 commit fb5dfb3

3 files changed

Lines changed: 95 additions & 0 deletions

File tree

TESTING/cpp/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,16 @@ if(BUILD_COMPLEX)
6060

6161
add_test(NAME cpp_tests_complex COMMAND cpp_tests_complex)
6262
endif()
63+
64+
65+
if(BUILD_COMPLEX16)
66+
add_executable(cpp_tests_complex16
67+
main.cpp
68+
zggqrcs.cpp)
69+
target_link_libraries(cpp_tests_complex16
70+
tmglib
71+
${LAPACK_LIBRARIES}
72+
${Boost_LIBRARIES})
73+
74+
add_test(NAME cpp_tests_complex16 COMMAND cpp_tests_complex16)
75+
endif()

TESTING/cpp/lapack.hpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,24 @@ extern "C"
135135
lapack_int* info,
136136
std::size_t jobu1_len, std::size_t jobu2_len, std::size_t jobqt_len
137137
);
138+
139+
void zggqrcs_(
140+
char* jobu1, char* jobu2, char* jobqt,
141+
lapack_int* m, lapack_int* n, lapack_int* p,
142+
double* w, lapack_int* l,
143+
std::complex<double>* A, lapack_int* lda,
144+
std::complex<double>* B, lapack_int* ldb,
145+
double* theta,
146+
std::complex<double>* U1, lapack_int* ldu1,
147+
std::complex<double>* U2, lapack_int* ldu2,
148+
std::complex<double>* Qt, lapack_int* ldqt,
149+
std::complex<double>* work, lapack_int* lwork,
150+
double* rwork, lapack_int* lrwork,
151+
lapack_int* iwork,
152+
lapack_int* info,
153+
std::size_t jobu1_len, std::size_t jobu2_len, std::size_t jobqt_len
154+
);
155+
138156
}
139157

140158

@@ -450,6 +468,36 @@ inline integer_t ggqrcs(
450468
return info;
451469
}
452470

471+
inline integer_t ggqrcs(
472+
char jobu1, char jobu2, char jobqt,
473+
integer_t m, integer_t n, integer_t p, double* w, integer_t* l,
474+
std::complex<double>* A, integer_t lda,
475+
std::complex<double>* B, integer_t ldb,
476+
double* theta,
477+
std::complex<double>* U1, integer_t ldu1,
478+
std::complex<double>* U2, integer_t ldu2,
479+
std::complex<double>* Qt, integer_t ldqt,
480+
std::complex<double>* work, integer_t lwork,
481+
double* rwork, integer_t lrwork,
482+
integer_t* iwork)
483+
{
484+
assert( w );
485+
assert( l );
486+
assert( work );
487+
assert( rwork );
488+
489+
integer_t info = -1;
490+
zggqrcs_(
491+
&jobu1, &jobu2, &jobqt,
492+
&m, &n, &p, w, l,
493+
A, &lda, B, &ldb,
494+
theta,
495+
U1, &ldu1, U2, &ldu2, Qt, &ldqt,
496+
work, &lwork, rwork, &lrwork, iwork, &info,
497+
1, 1, 1);
498+
return info;
499+
}
500+
453501

454502

455503
#ifdef HAS_GGSVD3

TESTING/cpp/zggqrcs.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2020 Christoph Conrads (https://christoph-conrads.name)
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
* * Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions and the following disclaimer.
9+
* * Redistributions in binary form must reproduce the above copyright
10+
* notice, this list of conditions and the following disclaimer in the
11+
* documentation and/or other materials provided with the distribution.
12+
* * Neither the name of the copyright holders nor the
13+
* names of its contributors may be used to endorse or promote products
14+
* derived from this software without specific prior written permission.
15+
*
16+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26+
* POSSIBILITY OF SUCH DAMAGE.
27+
*/
28+
#include <boost/mpl/list.hpp>
29+
#include <complex>
30+
31+
32+
typedef boost::mpl::list<std::complex<double>> test_types;
33+
34+
#include <ggqrcs.hpp>

0 commit comments

Comments
 (0)