Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
84908df9
Commit
84908df9
authored
Sep 03, 2014
by
COULAUD Olivier
Browse files
Add new functions
parent
fa84e589
Changes
2
Hide whitespace changes
Inline
Side-by-side
Src/Utils/FBlas.hpp
View file @
84908df9
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, B
é
renger Bramas, Matthias Messner
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, B
e
renger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
...
...
@@ -119,6 +119,10 @@ extern "C"
void
zgemm_
(
const
char
*
,
const
char
*
,
const
unsigned
*
,
const
unsigned
*
,
const
unsigned
*
,
const
double
*
,
double
*
,
const
unsigned
*
,
double
*
,
const
unsigned
*
,
const
double
*
,
double
*
,
const
unsigned
*
);
void
zgesvd_
(
const
char
*
,
const
char
*
,
const
unsigned
*
,
const
unsigned
*
,
double
*
,
const
unsigned
*
,
double
*
,
double
*
,
const
unsigned
*
,
double
*
,
const
unsigned
*
,
double
*
,
int
*
,
double
*
,
int
*
);
void
zgeqrf_
(
const
unsigned
*
,
const
unsigned
*
,
double
*
,
const
unsigned
*
,
double
*
,
double
*
,
const
unsigned
*
,
int
*
);
void
zpotrf_
(
const
char
*
,
const
unsigned
*
,
double
*
,
const
unsigned
*
,
int
*
);
...
...
@@ -170,7 +174,7 @@ namespace FMkl{
namespace
FBlas
{
// TODO create interface for
h
adamard product in case an external Blas is used
// TODO create interface for
H
adamard product in case an external Blas is used
}
...
...
@@ -423,6 +427,7 @@ namespace FBlas {
// singular value decomposition
//
inline
int
gesvd
(
unsigned
m
,
unsigned
n
,
double
*
A
,
double
*
S
,
double
*
VT
,
unsigned
ldVT
,
unsigned
nwk
,
double
*
wk
)
{
...
...
@@ -430,6 +435,18 @@ namespace FBlas {
dgesvd_
(
JOB_STR
+
2
,
JOB_STR
+
3
,
&
m
,
&
n
,
A
,
&
m
,
S
,
A
,
&
m
,
VT
,
&
ldVT
,
wk
,
&
nwk
,
&
INF
);
return
INF
;
}
//
// A = U * SIGMA * conjugate-transpose(V)
// JOB_STR+2 = 'O': the first min(m,n) columns of U (the left singular vectors) are overwritten on the array A;
inline
int
c_gesvd
(
unsigned
m
,
unsigned
n
,
double
*
A
,
double
*
S
,
double
*
VT
,
unsigned
ldVT
,
int
&
nwk
,
double
*
wk
,
double
*
rwk
)
{
int
INF
;
zgesvd_
(
JOB_STR
+
2
,
JOB_STR
+
3
,
&
m
,
&
n
,
A
,
&
m
,
S
,
A
,
&
m
,
VT
,
&
ldVT
,
wk
,
&
nwk
,
rwk
,
&
INF
);
// zgesvd_(JOB_STR+2, JOB_STR+3, &m, &n, A, &m, S, A, &m, VT, &ldVT, wk, &nwk, rwk,&INF);
return
INF
;
}
inline
int
gesvd
(
unsigned
m
,
unsigned
n
,
float
*
A
,
float
*
S
,
float
*
VT
,
unsigned
ldVT
,
unsigned
nwk
,
float
*
wk
)
{
...
...
Src/Utils/FComplexe.hpp
View file @
84908df9
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
...
...
@@ -107,11 +106,22 @@ public:
FComplexe
negate
()
const
{
return
FComplexe
(
-
complex
[
0
],
-
complex
[
1
]);
}
/**
* return the square of the modulus of the complex number
*/
FReal
norm2
()
const
{
return
complex
[
0
]
*
complex
[
0
]
+
complex
[
1
]
*
complex
[
1
]
;
}
/**
* return the modulus of the complex number
*/
FReal
norm
()
const
{
return
FMath
::
Sqrt
(
this
->
norm2
()
);
}
/**
* Operator +=
* in complex[0] with other complex[0], same for complex[1]
* @param other the complex
e
to use data
* @param other the complex to use data
*/
FComplexe
&
operator
+=
(
const
FComplexe
&
other
){
this
->
complex
[
0
]
+=
other
.
complex
[
0
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment