-
Notifications
You must be signed in to change notification settings - Fork 480
Adding Dynamic Mode Decomposition (DMD) into LAPACK #736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
cea00a7
Adding DMD algorithm in four precisions, tester will follow
dc9b4e8
Updating precision routines and beginning integration of tester
a8e4012
Adding the DMDQ codes
7aeab07
Fix for complex dmdq codes and progress to tester
fd272e7
Progress to the testing implementation in double precision
c4adf64
Removing unused variables
7bfb8ff
single precision tester finished, working on double complex
21059dc
Progressing code
c65a7a7
Progress to resolving the bug with complex testers
3b08c51
Updating src files, testing all precisions. Some clean-up remains but…
bd1204d
Merge branch 'Reference-LAPACK:master' into master
dbielich 25030ae
Improving testers - will need to investigate float precision impl
c91783e
Merge branch 'master' of https://github.com/dbielich/lapack88
1e2d26e
adding correction to schkdmd tester
e52daa3
Fixing compilation warning error for git
fbd853c
Adding lapacke wrappers for dmd routines - dmdq is needed yet
cc50227
Adding first precision of dmdq impl for lapacke
f74a632
Finishing up first impl of lapacke wrappers, waiting for review to re…
b5f984f
Fixing lapacke wrappers for memory leak conventions
7e42285
Addressing lapacke incorrectness and comments to the PR in general
e798ab2
Fixing interger workspace allocation
c6c2689
Fixes for the integer workspace
59f4d58
Documentation fix
8ade5d1
Pushing final comments on PR for current progress
dbielich fd82c87
Merge branch 'master' into master
langou 561e5bd
Requested changes for typos and convention errors in branch
dbielich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Adding lapacke wrappers for dmd routines - dmdq is needed yet
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| /***************************************************************************** | ||
| Copyright (c) 2014, Intel Corp. | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
|
|
||
| * Redistributions of source code must retain the above copyright notice, | ||
| this list of conditions and the following disclaimer. | ||
| * Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in the | ||
| documentation and/or other materials provided with the distribution. | ||
| * Neither the name of Intel Corporation nor the names of its contributors | ||
| may be used to endorse or promote products derived from this software | ||
| without specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
| THE POSSIBILITY OF SUCH DAMAGE. | ||
| ***************************************************************************** | ||
| * Contents: Native high-level C interface to LAPACK function cgedmd | ||
| * Author: Intel Corporation | ||
| *****************************************************************************/ | ||
|
|
||
| #include "lapacke_utils.h" | ||
|
|
||
| lapack_int LAPACKE_cgedmd( int matrix_layout, char jobs, char jobz, char jobf, | ||
| lapack_int whtsvd, lapack_int m, lapack_int n, | ||
| lapack_complex_float* x, lapack_int ldx, | ||
| lapack_complex_float* y, lapack_int ldy, lapack_int k, | ||
| lapack_complex_float* reig, lapack_complex_float* imeig, | ||
| lapack_complex_float* z, lapack_int ldz, | ||
| lapack_complex_float* res, lapack_complex_float* b, | ||
| lapack_int ldb, lapack_complex_float* w, | ||
| lapack_int ldw, lapack_complex_float* s, lapack_int lds) | ||
| { | ||
| lapack_int info = 0; | ||
| lapack_int lwork = -1; | ||
| lapack_int liwork = -1; | ||
| lapack_complex_float* work = NULL; | ||
| lapack_complex_float* iwork = NULL; | ||
| lapack_complex_float work_query; | ||
| lapack_complex_float iwork_query; | ||
| if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { | ||
| LAPACKE_xerbla( "LAPACKE_cgedmd", -1 ); | ||
| return -1; | ||
| } | ||
| #ifndef LAPACK_DISABLE_NAN_CHECK | ||
| if( LAPACKE_get_nancheck() ) { | ||
| /* Optionally check input matrices for NaNs */ | ||
| if( LAPACKE_cge_nancheck( matrix_layout, m, n, x, ldx ) ) { | ||
| return -4; | ||
| } | ||
| if( LAPACKE_cge_nancheck( matrix_layout, m, n, y, ldy ) ) { | ||
| return -4; | ||
| } | ||
| if( LAPACKE_cge_nancheck( matrix_layout, m, n, z, ldz ) ) { | ||
| return -4; | ||
| } | ||
| if( LAPACKE_cge_nancheck( matrix_layout, m, n, b, ldb ) ) { | ||
| return -4; | ||
| } | ||
| if( LAPACKE_cge_nancheck( matrix_layout, m, n, s, lds ) ) { | ||
| return -4; | ||
| } | ||
| if( LAPACKE_cge_nancheck( matrix_layout, m, n, w, ldw ) ) { | ||
| return -4; | ||
| } | ||
| } | ||
| #endif | ||
| /* Query optimal working array(s) size */ | ||
| info = LAPACKE_cgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n, | ||
| x, ldx, y, ldy, k, reig, imeig, z, ldz, res, | ||
| b, ldb, w, ldw, s, lds, &work_query, lwork, | ||
| &iwork_query, liwork ); | ||
|
|
||
| if( info != 0 ) { | ||
| goto exit_level_0; | ||
| } | ||
| lwork = (lapack_int) work_query; | ||
| liwork = (lapack_int) iwork_query; | ||
| /* Allocate memory for work arrays */ | ||
| work = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lwork ); | ||
| iwork = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * liwork ); | ||
| if( work == NULL ) { | ||
| info = LAPACK_WORK_MEMORY_ERROR; | ||
| goto exit_level_0; | ||
| } | ||
| if( iwork == NULL ) { | ||
| info = LAPACK_WORK_MEMORY_ERROR; | ||
| goto exit_level_0; | ||
| } | ||
| /* Call middle-level interface */ | ||
| info = LAPACKE_cgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n, | ||
| x, ldx, y, ldy, k, reig, imeig, z, ldz, res, | ||
| b, ldb, w, ldw, s, lds, work, lwork, iwork, | ||
| liwork ); | ||
| /* Release memory and exit */ | ||
| LAPACKE_free( work ); | ||
| LAPACKE_free( iwork ); | ||
| exit_level_0: | ||
| if( info == LAPACK_WORK_MEMORY_ERROR ) { | ||
| LAPACKE_xerbla( "LAPACKE_cgedmd", info ); | ||
| } | ||
| return info; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.