Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
44db1f6e
Commit
44db1f6e
authored
1 year ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Use C implamentation of complex numbers for LAPACK calls
parent
bbb401dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libnptm/lapack_calls.cpp
+3
-5
3 additions, 5 deletions
src/libnptm/lapack_calls.cpp
with
3 additions
and
5 deletions
src/libnptm/lapack_calls.cpp
+
3
−
5
View file @
44db1f6e
#include
<complex>
#include
<complex>
#include
<c
stdlib
>
#include
<c
omplex.h
>
#ifndef INCLUDE_LAPACK_CALLS_H_
#ifndef INCLUDE_LAPACK_CALLS_H_
#include
"lapacke.h"
#include
"lapacke.h"
#include
"../include/lapack_calls.h"
#include
"../include/lapack_calls.h"
#endif
#endif
using
namespace
std
;
void
zinvert
(
std
::
complex
<
double
>
**
mat
,
lapack_int
n
,
int
&
jer
)
{
void
zinvert
(
std
::
complex
<
double
>
**
mat
,
lapack_int
n
,
int
&
jer
)
{
jer
=
0
;
jer
=
0
;
__complex__
double
*
arr
=
new
__complex__
double
[
n
*
n
];
__complex__
double
*
arr
=
new
__complex__
double
[
n
*
n
];
const
__complex__
double
uim
=
1.0
di
;
const
__complex__
double
uim
=
1.0
*
I
;
for
(
lapack_int
i
=
0
;
i
<
n
;
i
++
)
{
for
(
lapack_int
i
=
0
;
i
<
n
;
i
++
)
{
for
(
lapack_int
j
=
0
;
j
<
n
;
j
++
)
{
for
(
lapack_int
j
=
0
;
j
<
n
;
j
++
)
{
lapack_int
idx
=
i
+
n
*
j
;
lapack_int
idx
=
i
+
n
*
j
;
...
@@ -26,7 +24,7 @@ void zinvert(std::complex<double> **mat, lapack_int n, int &jer) {
...
@@ -26,7 +24,7 @@ void zinvert(std::complex<double> **mat, lapack_int n, int &jer) {
for
(
lapack_int
i
=
0
;
i
<
n
;
i
++
)
{
for
(
lapack_int
i
=
0
;
i
<
n
;
i
++
)
{
for
(
lapack_int
j
=
0
;
j
<
n
;
j
++
)
{
for
(
lapack_int
j
=
0
;
j
<
n
;
j
++
)
{
lapack_int
idx
=
i
+
n
*
j
;
lapack_int
idx
=
i
+
n
*
j
;
mat
[
j
][
i
]
=
complex
<
double
>
(
__
real
__
arr
[
idx
],
__
imag
__
arr
[
idx
]);
mat
[
j
][
i
]
=
std
::
complex
<
double
>
(
c
real
(
arr
[
idx
]
)
,
c
imag
(
arr
[
idx
])
)
;
}
}
}
}
delete
[]
IPIV
;
delete
[]
IPIV
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment