Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-xt
Commits
cb204e02
Unverified
Commit
cb204e02
authored
6 years ago
by
Tobias Leibner
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #86 from dune-community/tmp_branch
[lapacke] add dorgqr, zungqr
parents
8109446d
0c8a3c24
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/xt/common/lapacke.cc
+38
-0
38 additions, 0 deletions
dune/xt/common/lapacke.cc
dune/xt/common/lapacke.hh
+15
-1
15 additions, 1 deletion
dune/xt/common/lapacke.hh
dune/xt/common/math.hh
+13
-0
13 additions, 0 deletions
dune/xt/common/math.hh
with
66 additions
and
1 deletion
dune/xt/common/lapacke.cc
+
38
−
0
View file @
cb204e02
...
...
@@ -198,6 +198,26 @@ int dorgqr(int matrix_layout, int m, int n, int k, double* a, int lda, const dou
}
int
dorgqr_work
(
int
matrix_layout
,
int
m
,
int
n
,
int
k
,
double
*
a
,
int
lda
,
const
double
*
tau
,
double
*
work
,
int
lwork
)
{
#if HAVE_MKL || HAVE_LAPACKE
return
LAPACKE_dorgqr_work
(
matrix_layout
,
m
,
n
,
k
,
a
,
lda
,
tau
,
work
,
lwork
);
#else
DUNE_UNUSED_PARAMETER
(
matrix_layout
);
DUNE_UNUSED_PARAMETER
(
m
);
DUNE_UNUSED_PARAMETER
(
n
);
DUNE_UNUSED_PARAMETER
(
k
);
DUNE_UNUSED_PARAMETER
(
a
);
DUNE_UNUSED_PARAMETER
(
lda
);
DUNE_UNUSED_PARAMETER
(
tau
);
DUNE_UNUSED_PARAMETER
(
work
);
DUNE_UNUSED_PARAMETER
(
lwork
);
DUNE_THROW
(
Exceptions
::
dependency_missing
,
"You are missing lapacke or the intel mkl, check available() first!"
);
return
1
;
#endif
}
int
dormqr
(
int
matrix_layout
,
char
side
,
char
trans
,
...
...
@@ -348,6 +368,24 @@ int zgeqp3(int matrix_layout, int m, int n, std::complex<double>* a, int lda, in
}
int
zungqr
(
int
matrix_layout
,
int
m
,
int
n
,
int
k
,
std
::
complex
<
double
>*
a
,
int
lda
,
const
std
::
complex
<
double
>*
tau
)
{
#if HAVE_MKL || HAVE_LAPACKE
return
LAPACKE_zungqr
(
matrix_layout
,
m
,
n
,
k
,
a
,
lda
,
tau
);
#else
DUNE_UNUSED_PARAMETER
(
matrix_layout
);
DUNE_UNUSED_PARAMETER
(
m
);
DUNE_UNUSED_PARAMETER
(
n
);
DUNE_UNUSED_PARAMETER
(
k
);
DUNE_UNUSED_PARAMETER
(
a
);
DUNE_UNUSED_PARAMETER
(
lda
);
DUNE_UNUSED_PARAMETER
(
tau
);
DUNE_THROW
(
Exceptions
::
dependency_missing
,
"You are missing lapacke or the intel mkl, check available() first!"
);
return
1
;
#endif
}
int
zunmqr
(
int
matrix_layout
,
char
side
,
char
trans
,
...
...
This diff is collapsed.
Click to expand it.
dune/xt/common/lapacke.hh
+
15
−
1
View file @
cb204e02
...
...
@@ -90,12 +90,19 @@ int dgeqp3(int matrix_layout, int m, int n, double* a, int lda, int* jpvt, doubl
*/
int
dgeqp3_work
(
int
matrix_layout
,
int
m
,
int
n
,
double
*
a
,
int
lda
,
int
*
jpvt
,
double
*
tau
,
double
*
work
,
int
lwork
);
/**
* \brief Wrapper around LAPACKE_dorgqr
* \sa LAPACKE_dor
q
qr
* \sa LAPACKE_dor
g
qr
*/
int
dorgqr
(
int
matrix_layout
,
int
m
,
int
n
,
int
k
,
double
*
a
,
int
lda
,
const
double
*
tau
);
/**
* \brief Wrapper around LAPACKE_dorgqr_work
* \sa LAPACKE_dorgqr_work
*/
int
dorgqr_work
(
int
matrix_layout
,
int
m
,
int
n
,
int
k
,
double
*
a
,
int
lda
,
const
double
*
tau
,
double
*
work
,
int
lwork
);
/**
* \brief Wrapper around LAPACKE_dormqr
...
...
@@ -184,6 +191,13 @@ int zunmqr(int matrix_layout,
int
ldc
);
/**
* \brief Wrapper around LAPACKE_zungqr
* \sa LAPACKE_zungqr
*/
int
zungqr
(
int
matrix_layout
,
int
m
,
int
n
,
int
k
,
std
::
complex
<
double
>*
a
,
int
lda
,
const
std
::
complex
<
double
>*
tau
);
}
// namespace Lapacke
namespace
Blas
{
...
...
This diff is collapsed.
Click to expand it.
dune/xt/common/math.hh
+
13
−
0
View file @
cb204e02
...
...
@@ -275,6 +275,19 @@ constexpr size_t factorial(size_t n)
return
n
>
0
?
n
*
factorial
(
n
-
1
)
:
1
;
}
//! calculates complex conjugate like std::conj, but returns T instead of complex<T>
template
<
class
T
>
std
::
enable_if_t
<
std
::
is_arithmetic
<
T
>::
value
,
T
>
conj
(
T
val
)
{
return
val
;
}
template
<
class
T
>
std
::
complex
<
T
>
conj
(
std
::
complex
<
T
>
val
)
{
return
std
::
conj
(
val
);
}
//! calculates binomial coefficient for arbitrary n
inline
double
binomial_coefficient
(
const
double
n
,
const
size_t
k
)
{
...
...
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