LAPACK
3.9.0
LAPACK: Linear Algebra PACKage
lapacke_clascl.c
Go to the documentation of this file.
1
/*****************************************************************************
2
Copyright (c) 2014, Intel Corp.
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
8
* Redistributions of source code must retain the above copyright notice,
9
this list of conditions and the following disclaimer.
10
* Redistributions in binary form must reproduce the above copyright
11
notice, this list of conditions and the following disclaimer in the
12
documentation and/or other materials provided with the distribution.
13
* Neither the name of Intel Corporation nor the names of its contributors
14
may be used to endorse or promote products derived from this software
15
without specific prior written permission.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27
THE POSSIBILITY OF SUCH DAMAGE.
28
*****************************************************************************
29
* Contents: Native high-level C interface to LAPACK function slaswp
30
* Author: Intel Corporation
31
* Generated June 2016
32
*****************************************************************************/
33
34
#include "
lapacke_utils.h
"
35
36
lapack_int
LAPACKE_clascl
(
int
matrix_layout,
char
type,
lapack_int
kl,
37
lapack_int
ku,
float
cfrom,
float
cto,
38
lapack_int
m,
lapack_int
n,
lapack_complex_float
* a,
39
lapack_int
lda )
40
{
41
if
( matrix_layout !=
LAPACK_COL_MAJOR
&& matrix_layout !=
LAPACK_ROW_MAJOR
) {
42
LAPACKE_xerbla
(
"LAPACKE_clascl"
, -1 );
43
return
-1;
44
}
45
#ifndef LAPACK_DISABLE_NAN_CHECK
46
if
(
LAPACKE_get_nancheck
() ) {
47
/* Optionally check input matrices for NaNs */
48
switch
(type) {
49
case
'G'
:
50
if
(
LAPACKE_cge_nancheck
( matrix_layout, m, n, a, lda ) ) {
51
return
-9;
52
}
53
break
;
54
case
'L'
:
55
// TYPE = 'L' - lower triangle of general matrix
56
if
( matrix_layout ==
LAPACK_COL_MAJOR
&&
57
LAPACKE_cgb_nancheck
( matrix_layout, m, n, m-1, 0, a, lda+1 ) ) {
58
return
-9;
59
}
60
if
( matrix_layout ==
LAPACK_ROW_MAJOR
&&
61
LAPACKE_cgb_nancheck
(
LAPACK_COL_MAJOR
, n, m, 0, m-1, a-m+1, lda+1 ) ) {
62
return
-9;
63
}
64
break
;
65
case
'U'
:
66
// TYPE = 'U' - upper triangle of general matrix
67
if
( matrix_layout ==
LAPACK_COL_MAJOR
&&
68
LAPACKE_cgb_nancheck
( matrix_layout, m, n, 0, n-1, a-n+1, lda+1 ) ) {
69
return
-9;
70
}
71
if
( matrix_layout ==
LAPACK_ROW_MAJOR
&&
72
LAPACKE_cgb_nancheck
(
LAPACK_COL_MAJOR
, n, m, n-1, 0, a, lda+1 ) ) {
73
return
-9;
74
}
75
break
;
76
case
'H'
:
77
// TYPE = 'H' - part of upper Hessenberg matrix in general matrix
78
if
( matrix_layout ==
LAPACK_COL_MAJOR
&&
79
LAPACKE_cgb_nancheck
( matrix_layout, m, n, 1, n-1, a-n+1, lda+1 ) ) {
80
return
-9;
81
}
82
if
( matrix_layout ==
LAPACK_ROW_MAJOR
&&
83
LAPACKE_cgb_nancheck
(
LAPACK_COL_MAJOR
, n, m, n-1, 1, a-1, lda+1 ) ) {
84
return
-9;
85
}
86
case
'B'
:
87
// TYPE = 'B' - lower part of symmetric band matrix (assume m==n)
88
if
(
LAPACKE_chb_nancheck
( matrix_layout,
'L'
, n, kl, a, lda ) ) {
89
return
-9;
90
}
91
break
;
92
case
'Q'
:
93
// TYPE = 'Q' - upper part of symmetric band matrix (assume m==n)
94
if
(
LAPACKE_chb_nancheck
( matrix_layout,
'U'
, n, ku, a, lda ) ) {
95
return
-9;
96
}
97
break
;
98
case
'Z'
:
99
// TYPE = 'Z' - band matrix laid out for ?GBTRF
100
if
( matrix_layout ==
LAPACK_COL_MAJOR
&&
101
LAPACKE_cgb_nancheck
( matrix_layout, m, n, kl, ku, a+kl, lda ) ) {
102
return
-9;
103
}
104
if
( matrix_layout ==
LAPACK_ROW_MAJOR
&&
105
LAPACKE_cgb_nancheck
( matrix_layout, m, n, kl, ku, a+lda*kl, lda ) ) {
106
return
-9;
107
}
108
break
;
109
}
110
}
111
#endif
112
return
LAPACKE_clascl_work
( matrix_layout, type, kl, ku, cfrom, cto, m, n, a, lda );
113
}
LAPACKE_chb_nancheck
lapack_logical LAPACKE_chb_nancheck(int matrix_layout, char uplo, lapack_int n, lapack_int kd, const lapack_complex_float *ab, lapack_int ldab)
Definition:
lapacke_chb_nancheck.c:36
lapack_int
#define lapack_int
Definition:
lapack.h:21
LAPACKE_clascl
lapack_int LAPACKE_clascl(int matrix_layout, char type, lapack_int kl, lapack_int ku, float cfrom, float cto, lapack_int m, lapack_int n, lapack_complex_float *a, lapack_int lda)
Definition:
lapacke_clascl.c:35
lapacke_utils.h
LAPACKE_xerbla
void LAPACKE_xerbla(const char *name, lapack_int info)
Definition:
lapacke_xerbla.c:36
LAPACKE_cge_nancheck
lapack_logical LAPACKE_cge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *a, lapack_int lda)
Definition:
lapacke_cge_nancheck.c:36
lapack_complex_float
#define lapack_complex_float
Definition:
lapack.h:56
LAPACKE_cgb_nancheck
lapack_logical LAPACKE_cgb_nancheck(int matrix_layout, lapack_int m, lapack_int n, lapack_int kl, lapack_int ku, const lapack_complex_float *ab, lapack_int ldab)
Definition:
lapacke_cgb_nancheck.c:36
LAPACKE_clascl_work
lapack_int LAPACKE_clascl_work(int matrix_layout, char type, lapack_int kl, lapack_int ku, float cfrom, float cto, lapack_int m, lapack_int n, lapack_complex_float *a, lapack_int lda)
Definition:
lapacke_clascl_work.c:35
LAPACKE_get_nancheck
int LAPACKE_get_nancheck()
Definition:
lapacke_nancheck.c:42
LAPACK_ROW_MAJOR
#define LAPACK_ROW_MAJOR
Definition:
lapacke.h:53
LAPACK_COL_MAJOR
#define LAPACK_COL_MAJOR
Definition:
lapacke.h:54
LAPACKE
src
lapacke_clascl.c
Generated on Wed May 5 2021 15:10:33 for LAPACK by
1.8.16