155 Commits
Author SHA1 Message Date
Markus Mützel 9304416095 Select different targets for building in CI on Alpine
build-alpine / alpine (armv7) (push) Waiting to run
build-alpine / alpine (loongarch64) (push) Waiting to run
build-alpine / alpine (x86) (push) Waiting to run
cross-build-ubuntu / cross armhf (push) Waiting to run
cross-build-ubuntu / cross ppc64el (push) Waiting to run
cross-build-ubuntu / cross riscv64 (push) Waiting to run
cross-build-ubuntu / cross s390x (push) Waiting to run
arpack-ng / ubuntu_latest_cmake (push) Waiting to run
arpack-ng / ubuntu_latest_cmake_install (push) Waiting to run
arpack-ng / ubuntu_latest_autotools (push) Waiting to run
arpack-ng / ubuntu_latest_autotools_install (push) Waiting to run
arpack-ng / ubuntu_latest_cmake_python (push) Waiting to run
arpack-ng / ubuntu_latest_autotools_ilp64 (push) Waiting to run
arpack-ng / macos_latest_cmake (push) Waiting to run
arpack-ng / macos_latest_cmake_python (push) Waiting to run
arpack-ng / macos_latest_autotools (push) Waiting to run
arpack-ng / MinGW-w64 CLANG64 INTERFACE64=OFF/MPI=OFF (push) Waiting to run
arpack-ng / MinGW-w64 UCRT64 INTERFACE64=OFF/MPI=OFF (push) Waiting to run
arpack-ng / MinGW-w64 CLANG64 INTERFACE64=OFF/MPI=ON (push) Waiting to run
arpack-ng / MinGW-w64 UCRT64 INTERFACE64=OFF/MPI=ON (push) Waiting to run
arpack-ng / MinGW-w64 CLANG64 INTERFACE64=ON/MPI=OFF (push) Waiting to run
arpack-ng / MinGW-w64 UCRT64 INTERFACE64=ON/MPI=OFF (push) Waiting to run
The Alpine repository for the PowerPC target got more and more unreliable
recently.
Additionally, the PowerPC target is covered with the cross-build rules on
Ubuntu now.

Drop some (expensive) targets to reduce the overlap in coverage with the
workflow that cross-builds on Ubuntu.
Add LoongArch64 target which is not (yet?) available for Ubuntu.
Keep targets that can be build natively (which should be reasonably fast).
Use an Ubuntu on ARM runner for the armv7 target.
Rename workflow because out of the three remaining targets only one is
actually emulated - the others can execute natively.
2026-08-16 14:01:08 +02:00
Markus Mützel 9f90017bf8 Add CI workflow that cross-builds for several targets on Ubuntu
Cross build ARPACK for some targets on Ubuntu using their cross-compilation
toolchains and packages.
Run the test suite using `qemu` if necessary.
2026-08-16 14:01:08 +02:00
Markus Mützel 6ae2072b0c PARPACK: Initialize machine dependent constants only once in PDNAITR
The current implementation checks the value of the variable `aitr_first` but
sets `first`.

Change that to set `aitr_first` to false after the initialization has run.

This also brings that part of the implementation of `PDNAITR` in line with
the corresponding logic that is used in the implementation of the other
`P?NAITR`.
2026-08-01 15:59:19 +02:00
Markus Mützel 8a4ede774e CI: Use VecLibFort as shim library for Apple Accelerate/VecLib on macOS.
Currently, the CI rules are building ARPACK using the old `f2c` Fortran
ABI. However, all packages of applications written in Fortran that are
distributed by Homebrew are using the default GNU Fortran ABI.
Testing the package with the ABI expected by most macOS users would
probably be better than what is currently done in the CI setup.

Instead of building a version of ARPACK using that old, non-default `f2c`
Fortran ABI, use a library that "translates" from the default GNU Fortran
ABI to the old `f2c` ABI used by Apple Accelerate/VecLib.
2026-07-26 18:28:41 +02:00
dependabot[bot] 7217471833 Bump actions/checkout from 2 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-25 17:22:12 +02:00
dependabot[bot] 96892b7938 Bump actions/cache from 4 to 6
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-24 19:48:01 +02:00
Markus Mützel b36bddadd2 CI: Use dependabot to periodically check for updated actions
Currently, a warning like the following is emitted for each job in the CI:
> Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v2. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/

Let dependabot check for updates to avoid the chore of manually updating the versions of GitHub actions every time the Node.js version on the runner images is updated.
2026-07-24 15:18:16 +02:00
evanbiederstedt f284b0682d Fix "Warning: Obsolescent feature: Old-style character length at (1)", found in /UTIL (#482)
* fix obsolescent character length warning, arpack/utils

* updates to changelog, other fixes to avoid warning

* try brew install open-mpi

* use brew install open-mpi instead

* remove F77 syntax, TESTS/mmio.f

* Update CHANGES
2026-06-06 12:47:15 +02:00
Kyle GuinnandFranck HOUSSEN f73592dd1e Fix header and pkg-config file installation (#426)
* Don't install pkg-config files for unbuilt libraries

The autotools build is configured to skip entire directories depending
on the configuration.  Each directory's Makefile is responsible for
installing what it needs, and moving the .pc files to the toplevel broke
that.

In the pkg-config files, leave ${includedir} unmodified from how
configure defines it.

* Install arpackicb.h only when ICB is ON.

---------

Co-authored-by: Franck HOUSSEN <fghoussen@users.noreply.github.com>
2025-10-31 15:05:59 +01:00
Theodore 07dbd37e52 Reorder library linking for robustness (#478)
* fix: reorder library linking for consistency in CMakeLists.txt

* fix: unify LAPACK and BLAS library linking across targets

* feat: set C++ standard to C++14 for improved language features

* fix: update C++ standard to C++14 for Python3, Eigen, and ICB support

* fix: improve dependency linking and bump minimum C++ standard version in CMake

* Remove redundant C language as it is already enabled previously
2025-10-12 12:03:39 +02:00
Sylvestre Ledru 804fa3149a Document the recent change 2024-10-21 09:03:36 +02:00
Sylvestre Ledru b63d37f4b6 Merge pull request #473 from szhorvat/fix/obsolescent-character-length
fix: fix obsolescent character length warnings, fixes #472
2024-10-21 09:01:08 +02:00
Szabolcs Horvát 7ada6520f5 fix: fix obsolescent character length warnings, fixes #472 2024-10-20 19:31:46 +00:00
Sylvestre Ledru 9431fd5ea6 Merge pull request #461 from mmuetzel/cmake
Make ctests platform independent
2024-09-23 10:14:56 +02:00
Sylvestre Ledru bc1944851f Merge pull request #471 from vaerksted/master
fix typos
2024-09-23 10:14:09 +02:00
Markus Mützel 2c1203e23f Update CHANGELOG. 2024-09-22 18:34:27 +02:00
Markus Mützel 32070150c7 CMake: Add function to add tests that change working directory.
Add a new CMake function that helps to add tests that change their
working directory to somewhere else than the directory with the
libarpack library.

In that case, the environment variable PATH is set to include the
directory with the library on Windows while running the tests.

Use that new CMake function for the three ctests involving the Eigen
library.
2024-09-22 18:09:41 +02:00
Markus Mützel 7671cebf29 CI: Remove work-around from rules for MinGW that is no longer needed 2024-09-22 17:59:20 +02:00
Markus Mützel 44fe87f3fc Make ctests platform independent
Windows doesn't have a mechanism similar to rpaths. Instead, shared
libraries are searched in the current working directory and  in the
directory with the executable followed by directories in the environment
variable PATH.

Add the path to the shared libarpack library to PATH for ctests that run
executables that are located in a different directory and that set the
current working directory not to the directory with the libarpack.dll.
Use a generator expression that should be working independent on the CMake
generator.
2024-09-22 17:59:20 +02:00
musvaage 04b192a2b1 typos 2024-09-22 10:03:26 -05:00
Franck HOUSSEN f2921f232b arpackmm: improve command line for testing. (#470) 2024-09-19 18:58:07 +02:00
Franck HOUSSEN 43d3e5606b Fix arpack solver (#468)
* arpackmm: improve command line.

* [BUG FIX] arpackmm: run arpack with real or imag shift.

* [BUG FIX] arpackmm: make sure the restart file is written.

* [BUG FIX] arpackmm: rewrite the test.

  - Do NOT use eval in bash script which does NOT return command exit code.

  - Use a dedicated maxResNorm to test the residual (no point to deduce
    it from tol).

* Update .gitignore.

* Update CHANGELOG.
2024-09-18 21:55:38 +02:00
Henri Menke e55d3b2dcb Add missing stdexcept header (#467) 2024-09-14 12:05:42 +02:00
Sylvestre Ledru 0b3038d139 Merge pull request #462 from mmuetzel/ci-macos
CI: Enable eigen on macOS runners
2024-06-27 14:30:51 +02:00
Markus Mützel 081e13cd3f CI: Enable eigen on macOS runners 2024-06-27 13:26:14 +02:00
Sylvestre Ledru 77ba50e800 Merge pull request #459 from mmuetzel/ci
CI: Add CI for CLANG64 environment of MSYS2
2024-06-22 14:00:26 +02:00
Markus Mützel aea67a3426 CI: Re-run tests on error with more output for debugging 2024-06-22 13:04:24 +02:00
Markus Mützel ca979855b4 CI: Install Eigen on MSYS2 runners 2024-06-22 13:04:24 +02:00
Markus Mützel 8d58c1ac1d CI: Setup workflow for MSYS2 CLANG64 2024-06-22 13:04:24 +02:00
Sylvestre Ledru 1ebaf744b6 Merge pull request #460 from mmuetzel/ci-macos
CI: Install numpy from Homebrew on macOS
2024-06-22 13:04:11 +02:00
Markus Mützel e5643dce21 CI: Use clearer settings for BLAS/LAPACK implementation on macOS
With the previous configuration it was unclear whether the reference
implementation (from Netlib) or Apple's implementation of the BLAS
and LAPACK libraries should be used. (`LIBS` pointed to Apple's
implementation, but `BLA_VENDOR` selected the reference implementation.)

Use only `BLA_VENDOR` to select Apple's implementation.
2024-06-22 11:51:22 +02:00
Markus Mützel 0efe8a6113 CI: Install numpy from Homebrew on macOS 2024-06-22 11:51:19 +02:00
Sylvestre Ledru 9d9e1bf36d Merge pull request #458 from mmuetzel/ci
Add CI runners on emulated hardware
2024-06-21 11:48:28 +02:00
Markus Mützel 416011c701 CI (Alpine Linux): Use ccache
The compilation (especially of the C++ objects) is pretty slow with qemu.
Use ccache to speed up build time on subsequent runs.
2024-06-17 11:15:40 +02:00
Markus Mützel fec63adf5f Add CI runners on emulated hardware
Use a GitHub action to install Alpine Linux for different, less common
architectures that are emulated with qemu (apart from x86).
Additionally, Alpine Linux is one of those distributions that are based
on musl (instead of glibc).

This increases coverage for different configurations in CI.
2024-06-12 19:14:45 +02:00
Franck HOUSSEN 217e25ac7c Improve documentation. (#456) 2024-05-08 13:02:16 +02:00
Franck HOUSSEN 7f25013f29 [CI] Fix macos job. (#457)
* [CI] Fix macos job.
2024-05-08 12:35:10 +02:00
Franck HOUSSEN 4caa8f4c70 Add documentation on ILP64. (#453)
* Add documentation on ILP64.

* Rephrase.
2024-04-01 20:37:14 +02:00
Kyle Guinn 51ce061ff7 Update changelog 2024-01-31 09:59:28 +01:00
Kyle Guinn ef90e416cf Build all PARPACK files with optimization 2024-01-31 09:59:28 +01:00
Sylvestre Ledru ba440d1322 Merge pull request #446 from turboencabulator/quoting
Quote the default pkgconfigdir
2024-01-21 08:39:45 +01:00
Kyle Guinn 243a1011e5 Quote the default pkgconfigdir
The second argument to AC_SUBST is placed on the right-hand-side of a
shell variable assignment.  Without the single quotes, ${libdir} is
expanded when that variable assignment is executed, which is earlier
than we want.
2024-01-20 21:25:36 -06:00
wo80 0eaf38bd51 Fix examples BAND _nbdr2 returning error info = -9
Both examples access the M matrix, so we initialize M to be the identity matrix. See #443 for discussion.
2023-12-20 09:41:27 +01:00
Sam James 31b50762a5 configure.ac: fix bashisms
configure scripts need to be runnable with a POSIX-compliant /bin/sh.

On many (but not all!) systems, /bin/sh is provided by Bash, so errors
like this aren't spotted. Notably Debian defaults to /bin/sh provided
by dash which doesn't tolerate such bashisms as '=='.

This retains compatibility with bash.

Fixes configure warnings/errors like:
```
checking for cheev_ in -llapack... yes
./configure: 8590: test: x: unexpected operator
checking how to print strings... printf
```
2023-12-20 08:57:16 +01:00
Sylvestre Ledru 569a3859c1 Merge pull request #438 from sylvestre/cmake
configure should still install cmake files
2023-10-15 13:46:22 +02:00
Sylvestre Ledru 3371fdfc8e configure should still install cmake files 2023-10-14 14:48:34 +02:00
Sylvestre Ledru 40329031ae also update cmake configure
arpack-ng / ubuntu_latest_cmake (push) Waiting to run
arpack-ng / ubuntu_latest_cmake_install (push) Waiting to run
arpack-ng / ubuntu_latest_autotools (push) Waiting to run
arpack-ng / ubuntu_latest_autotools_install (push) Waiting to run
arpack-ng / ubuntu_latest_cmake_python (push) Waiting to run
arpack-ng / ubuntu_latest_autotools_ilp64 (push) Waiting to run
arpack-ng / macos_latest_cmake (push) Waiting to run
arpack-ng / macos_latest_cmake_python (push) Waiting to run
arpack-ng / macos_latest_autotools (push) Waiting to run
arpack-ng / windows_latest_cmake (push) Waiting to run
2023-10-14 13:55:37 +02:00
Sylvestre Ledru 85c35d5d57 update of the version to 3.9.1 2023-10-14 13:38:28 +02:00
Sylvestre Ledru a80ff0d017 Update of the changelog 2023-10-14 13:38:01 +02:00
Fabien Péan 0f7c32bf78 Update changelog 2023-09-14 12:12:59 +02:00
Fabien Péan 93c048fae3 Fix solver parameters for pyarpackSparse{LDLT/LU} 2023-09-14 12:12:59 +02:00
Fabien Péan 447b4387e9 Swap pyarpackDenseLDLT and pyarpackDenseLUPP tests
DenseLUPP tests solves now
 - complex128 non-symmetric problem
 - complex64 non-symmetric general problem

DenseLDLT solves now
- float64 symmetric problem
- float32 symmetric general problem
2023-09-14 12:12:59 +02:00
Fabien Péan 12300c1d4b Change pyarpackCGILU to solve hermitian non-general problem 2023-09-14 12:12:59 +02:00
Fabien Péan de52ee6e32 Swap pyarpackSparseLDLT and pyarpackSparseLU tests
SparseLU tests solves now
- complex128 non-symmetric problem
- complex64 non-symmetric general problem

SparseLDLT solves now
- float64 symmetric problem
- float32 symmetric general problem
2023-09-14 12:12:59 +02:00
Fabien Péan bdb881c973 Fix error report in ctest when calling bash script 2023-09-03 18:54:28 +02:00
Fabien Péan cdeaaeafa0 Update changelog 2023-09-03 15:29:46 +02:00
Fabien Péan c783dbbb0a Enable non symmetric tests with BiCG solver in arpackmm test suite 2023-09-03 15:29:46 +02:00
VinceNeede 3c48b9508b Update README.md MKL options
cmake option for mkl BLA_VENDOR=INTEL works for obsolete verdions, replaced with INTEL10_64lp and INTEL10_64ilp for lp64 and ilp64 respectively.
2023-09-02 19:30:16 +02:00
Franck HOUSSEN e7cf106bc2 Merge pull request #425 from fghoussen/fix-install
Fix installation tests: compile and run icb_arpack_c.
2023-08-14 12:26:23 +02:00
Franck HOUSSEN c08859052b README: document use of *.pc and *.cmake files. 2023-08-13 11:04:17 +02:00
Franck HOUSSEN 5a2f942473 CMake test install: add comments + make it symmetric with autotools's one. 2023-08-13 10:59:18 +02:00
Franck HOUSSEN a857b80721 [CI] Increase CMake version to avoid deprecation messages in logs. 2023-08-13 10:56:55 +02:00
Franck HOUSSEN cdcb80a0ff Export LD_LIBRARY_PATH before running binaries. 2023-08-12 21:33:05 +02:00
Franck HOUSSEN a0ee97487e README: document use of *.pc and *.cmake files. 2023-08-12 21:05:52 +02:00
Franck HOUSSEN 4bd39d7a39 [CI] Increase CMake version to avoid deprecation messages in logs. 2023-08-12 20:57:24 +02:00
Franck HOUSSEN 798f87698f [CI] Add eigen to test installs. 2023-08-12 20:55:42 +02:00
Franck HOUSSEN 031ea2554d Update change log. 2023-08-12 19:18:35 +02:00
Franck HOUSSEN 7f0e2dca4a Fix installation tests: compile and run arpackmm. 2023-08-12 19:18:22 +02:00
Franck HOUSSEN 2239bf22e6 Fix installation tests: compile and run icb_parpack_cpp. 2023-08-12 18:02:03 +02:00
Franck HOUSSEN f4b2f31a64 Fix installation tests: compile and run icb_parpack_c. 2023-08-12 17:40:31 +02:00
Franck HOUSSEN c46da4f87a Fix installation tests: compile and run icb_arpack_cpp. 2023-08-12 13:55:09 +02:00
Franck HOUSSEN 1b525b649c Fix installation tests: compile and run icb_arpack_c. 2023-08-12 13:26:52 +02:00
Fabien Péan c18d153f20 Update FAQ 2023-08-12 12:39:18 +02:00
Fabien Péan 46d1dd36d0 Fix icb_parpack_[c|cpp] to split the problem across MPI processes 2023-08-12 12:39:18 +02:00
Szabolcs Horvát e7ae5f818d chore: update changelog 2023-08-12 12:39:18 +02:00
Szabolcs Horvát b29d5630fc fix: ensure separate seeds on parallel threads, fixes #411 2023-08-12 12:39:18 +02:00
Szabolcs Horvát 9fe9d462a6 fix: propagte RNG state in PARPACK as well 2023-08-12 12:39:18 +02:00
Szabolcs Horvát 0996200c7a fix: ensure that LAPACK RNG state is propagated 2023-08-12 12:39:18 +02:00
Bálint Aradi 6d625dbf34 Fix package name in CMake find_package() examples (#419) 2023-05-27 14:09:41 +02:00
Ivan Rostov 3e3e12fef2 Update CMakeLists.txt , add mpiexec to issue46_tst run (#418) 2023-05-25 22:47:39 +02:00
Vonfry 662cd51fc1 Fix windows icb macros (#416)
* Distinct new intel llvm compiler on windows

intel llvm compiler uses clang-cl who also defines _MSC_VER, which let icx find msc complex.h instead intel copmlex.h

* Undef I in windows complex.h

I macro is defined by windows complex.h which is used as variable name in arpackSolver as well.
2023-05-18 12:26:31 +02:00
مهدي شينون (Mehdi Chinoune) 22172ff212 Add LLVMFlang flag to build with INTERFACE64 (#412)
* LLVMFlang: Add required flag to build with INTERFACE64

* LLVMFlang: Add compile flags

Add compile flags for preprocessing and for
supporting lines longer than 72
2023-04-15 08:40:44 +02:00
Sylvestre Ledru 25524b70c2 Merge pull request #413 from FabienPean/patch-1
Add details on Windows installation
2023-04-10 10:52:38 +02:00
Fabien Péan 2219bef7ea Update changelog 2023-04-08 19:35:58 +00:00
Fabien Péan 98cd927215 Update README.md 2023-04-08 19:59:20 +02:00
Sylvestre Ledru 396b90a015 Merge pull request #409 from fghoussen/readme
README: document where to find arpack user's guide.
2023-03-11 10:07:40 +01:00
Franck HOUSSEN b13558c527 README: document where to find arpack user's guide. 2023-03-05 22:58:48 +01:00
Franck HOUSSEN e124fcabc2 [BUG FIX] arpackmm: fix restart. (#408)
* Fixing issue401.
* Fixing issue215 with shift.
2023-02-28 19:29:32 +01:00
Franck HOUSSEN e144e946ec README: document how to use ICB. 2023-02-25 10:49:55 +01:00
Franck HOUSSEN 5a963c4d31 Rename icbexmm option into eigen option. 2023-02-18 10:21:19 +01:00
Franck HOUSSEN ae350abfed arpackSolver: cut-off arpack workspace dim. (#404) 2023-02-18 10:20:38 +01:00
Franck HOUSSEN cd49a7fb98 arpackmm: allow for using LA/SA magnitudes. (#402) 2023-02-17 22:30:40 +01:00
Franck HOUSSEN 3a9a9ce8c0 Add comments to README. (#400) 2023-02-15 22:39:19 +01:00
Franck HOUSSEN 459f46a6dd [BUG FIX] Fix install: headers in /path/to/local/include/arpack (#398) 2023-02-12 15:29:33 +01:00
Franck HOUSSEN 6c7a3240d8 New upstream release.
arpack-ng / ubuntu_latest_cmake (push) Waiting to run
arpack-ng / ubuntu_latest_cmake_install (push) Waiting to run
arpack-ng / ubuntu_latest_autotools (push) Waiting to run
arpack-ng / ubuntu_latest_autotools_install (push) Waiting to run
arpack-ng / ubuntu_latest_cmake_python (push) Waiting to run
arpack-ng / ubuntu_latest_autotools_ilp64 (push) Waiting to run
arpack-ng / macos_latest_cmake (push) Waiting to run
arpack-ng / macos_latest_cmake_python (push) Waiting to run
arpack-ng / macos_latest_autotools (push) Waiting to run
arpack-ng / windows_latest_cmake (push) Waiting to run
2023-02-11 13:56:54 +01:00
easifem 2a7244b8a3 Improve README. 2023-02-11 13:56:54 +01:00
Franck HOUSSEN b8ab7a72c4 [CI] Run full test suite (including eigen tests). (#396) 2023-02-07 23:09:56 +01:00
Fabien Péan 6be238e703 Avoid removing macro _CRT_USE_C_COMPLEX_H if pre-existing (#393) 2023-01-27 19:27:44 +01:00
Fabien Péan 12814dc6b1 Run all examples for job windows_latest_cmake in CI (#392)
* Enable examples on CI for `windows_latest_cmake`

* Enable MPI for CI job `windows_latest_cmake`
2023-01-26 21:20:32 +01:00
Fabien Péan f4d7302a49 Fix library consumption from C++17 on Windows (#391) 2023-01-19 20:02:59 +01:00
Fabien Péan 6f58bb1974 Link to LAPACK before BLAS (#384) 2023-01-15 19:54:09 +01:00
Sylvestre Ledru af09793e70 Merge pull request #385 from FabienPean/patch-2
Make building tests an option in CMake
2023-01-15 18:37:17 +01:00
Fabien Péan f4823d97e6 Make building tests an option 2023-01-15 17:35:45 +01:00
Fabien Péan 282bd42fde Make building tests an option 2023-01-15 17:35:45 +01:00
Sylvestre Ledru 1278cb1001 Merge pull request #389 from FabienPean/fix/macos
Fix CI macOS jobs
2023-01-15 17:35:29 +01:00
Fabien Péan 4002c2733c Replace deprecated np.complex by built-in complex 2023-01-14 21:45:23 +00:00
Fabien Péan 81ed8ef3ec Fix CI for macOS 2023-01-14 21:45:02 +00:00
Juan José García RipollandFranck HOUSSEN db55a7ff41 Propagate dependencies in CMake configuration file (#377)
* Propagate dependencies in CMake configuration file

* Test that CMake find_package(arpackng) finds arpack in standard locations

Co-authored-by: Franck HOUSSEN <fghoussen@users.noreply.github.com>
2022-10-27 21:51:41 +02:00
Zhentao Wang 8ecf1be713 Add Ritz options (largest/smallest in real/imaginary parts) for complex routines 2022-08-20 21:30:21 +02:00
Zhentao Wang 36eaaf0791 [CLEAN] Shuffle the order of the functions inside parpack.h to be
consistent with those in parpack.hpp. Remove a few trailing white spaces
in pc/znaupd.f
2022-08-20 21:30:21 +02:00
Sylvestre Ledru 5131f792f2 Merge pull request #372 from fghoussen/fix_issue_332
Fix issue 332
2022-08-14 23:36:10 +02:00
Franck HOUSSEN 04e1b3c9db parpack: no ILP64 support. 2022-08-14 23:10:17 +02:00
Franck HOUSSEN 5c81720203 [CI - W10] bug_1315_single: easy tolerance as we deal with float. 2022-08-14 23:10:17 +02:00
Franck HOUSSEN 98bf1f1ade [BUG FIX] Fixing issue 332: rewrite icb_parpack_c*. 2022-08-14 23:10:02 +02:00
Franck HOUSSEN 68b2840c63 [BUG FIX] Use MPI ICB types (mpi_f08) instead of integer(kind=i_int). 2022-08-14 23:06:47 +02:00
Franck HOUSSEN e0d67054f5 [BUG FIX] According to lapack doc of ?larnv, iseed(4) must be odd. 2022-08-14 23:06:47 +02:00
Franck HOUSSEN ce2e69a849 [BUG FIX] Make sure iseed is always initialized to values allowed by
lapack ?larnv.

This means killing inits variable:
  - Using MPI, inits (shared variable) may be set to false by one proc,
    and prevent other procs to initialize seeds (as inits is shared by
    use of the save fortran keyword).
  - Not using MPI, inits only prevents from re-initializing seeds which
    have already been initialized.

This commit is not-op. From a functional point of view, we are doing
the same thing. From an implementation point of view, we make sure
iseed is always (for all MPI procs) initialized to values allowed
by lapack (if not, lapack crashes).

This problem doesn't occur with sequential code. Changes have been
done in both sequential and MPI code to keep things symmetric.
2022-08-14 23:06:47 +02:00
Zhentao Wang f36eb6c75d [BUG FIX] parpack.h\hpp: rwork should be real instead of complex. 2022-08-14 23:06:47 +02:00
Sylvestre Ledru 17e6bba6b2 Merge pull request #370 from luzpaz/typos/SRC
Fix typos in SRC/
2022-08-03 20:34:55 +02:00
luz paz 90e04f3afa Fix typos in SRC/
Found via `codespell -q 3 -L canot,coo,inout,reord,workd`
2022-08-03 13:29:43 -04:00
Franck HOUSSEN 13bc40022c How to use arpack-ng with Intel MKL. (#369) 2022-07-30 10:47:43 +02:00
Sylvestre Ledru d280435c25 Merge pull request #367 from fghoussen/fix_error_msg
arpackSolver: fix error messages.
2022-07-09 14:10:44 +02:00
Franck HOUSSEN 0c655a68cd arpackSolver: fix error messages. 2022-07-09 12:36:27 +02:00
Franck HOUSSEN 872df83b9e [CI] Test pyarpack on macos. (#365)
* [CI] Test pyarpack on macos.
* Fix pyarpack compilation warning: seems like default is python3 now.
* Improve pyarpack doc.
* pyarpack: run with latest boost-python version and require Boost >= 1.78.
2022-06-25 19:16:31 +02:00
Juan José García Ripoll d3cec6d67e Support for Microsoft's non-standard complex types (#334)
Replaced _Complex types with a_fcomplex and a_dcomplex in all C/C++ files.
Replaced uses of I and _Complex_I with the CMPLXand CMPLXF constructors.
For MSVC, defined those constructors as macros that call MSVC's functions.
Updated the CHANGES file.
2022-06-18 21:13:32 +02:00
Franck HOUSSEN 51249ebcfc [DOC] Add notes in pyarpack documentation. (#364) 2022-06-18 21:12:57 +02:00
Franck HOUSSEN 5eafea4328 Create one .cmake file per arpack-ng flavor (32-bits, 64-bits, ILP64). (#362) 2022-06-04 10:54:05 +02:00
Markus Mützel 83e6205289 Simplify build rules for CI on Windows (#361) 2022-06-04 10:30:16 +02:00
Jose E. Roman 08e2368179 Avoid isnan(), which is GNU-specific (#357)
The proposed solution relies on IEEE-754 standard definition of NaN,
https://stackoverflow.com/questions/17389958/is-there-a-standard-way-to-check-for-infinite-and-nan-in-fortran-90-95
2022-05-28 19:48:55 +02:00
Franck HOUSSEN 2683ada680 README.md: fix style. (#359) 2022-05-21 19:23:28 +02:00
Markus Mützel b3f48b7cb7 CMake: don't override BLAS/LAPACK/MPI flags. (#355) 2022-05-21 19:21:28 +02:00
Franck HOUSSEN 7124d622ab Test install with ITF64 suffix. (#356) 2022-05-07 23:00:18 +02:00
Markus Mützel 5465aee30e cmake: handle libraries without "lib" prefix. 2022-05-01 13:45:16 +02:00
Franck HOUSSEN bf82f61b13 [BUG FIX] Test install.
CMake may change install directory structure (local/lib or
local/lib/arch). Use find to prevent tests from this.
2022-04-30 18:42:28 +02:00
Franck HOUSSEN e7abe8b42b Test install with suffix. (#352) 2022-04-24 22:14:28 +02:00
Franck HOUSSEN 9331036702 Test autotools pkg-config (*.pc files). (#351) 2022-04-23 23:08:08 +02:00
Franck HOUSSEN 3ba4dbfbe9 Test install cmake (#350)
Test CMake find_package (*.cmake files).
2022-04-23 22:44:06 +02:00
Tom Payerle 1f4c1e0a44 Change the continuation line format for stat.h, debug.h (#339)
Change the continuation line format for stat.h, debug.h

AOCC flang compiler is complaining about the continuation lines in these
two files.  It does not complain about similar continuation lines in
files (e.g. SRC/icbacn.F90), so I believe this is due to flang setting
the Fortran dialect to something like F77 for most of the compilations,
which cause problems with these *.h files.

I cannot find a way to force flang Fortran dialect to accept the & at
end of line continuation marker, so this patch changes the continuation
lines in these two files (stat.h, debug.h) to use continuation marker in
column 6.

This should fix #300
2022-04-23 18:42:25 +02:00
prj- a5155ee72b [c,z]dotc => [cc,zz]dotc (#346)
[c,z]dotc => [cc,zz]dotc
2022-04-17 21:56:24 +02:00
Franck HOUSSEN 7e85cb19ad CI: fix github-actions workflow.
c45094c broke the workflow: CI triggered on PR (modified code) was
actually testing master codebase (untouched code). Solution:
- Drop pull_request_target: use pull_request
- Drop all docker jobs (which need pull_request_target to be based
  on master to be able to access opencollab secrets)
- Remove opencollab secrets (docker login and password)
- Drop coverage jobs (OK with TravisCI but never worked with
  github-actions)
2022-04-10 20:00:13 +02:00
Dima Pasechnik 645db9e647 Fortran intrinsic: replace non standard (dimag) function with standard (aimag) one. (#318)
Fortran intrinsic: replace non standard (dimag) function with standard (aimag) one. Nagfor compiler fix.
2021-10-17 19:34:40 +02:00
Dima Pasechnik 9cd6c25cb9 Replace obsolete macro AC_TRY_COMPILE (#325)
* Replace obsolete macro AC_TRY_COMPILE

This is to pacify autoconf 2.70 and 2.71,
which otherwise print warnings, etc.

* Update CHANGES
2021-10-16 17:13:27 +02:00
Franck HOUSSEN c45094c758 Github Actions: enable access to opencollab secrets for docker jobs. 2021-10-07 19:26:00 +02:00
Franck HOUSSEN 3b5dab9c93 [BUG FIX] arpackmm: command line sanity checks. 2021-10-04 22:50:56 +02:00
Franck HOUSSEN e3a1f97f2a [BUG FIX] arpackmm: Cut-off in case previous run used different nbDim. 2021-10-04 22:50:56 +02:00
Franck HOUSSEN 5f9bd674b1 [BUG FIX] Compile C programs with ICB. 2021-10-04 22:50:16 +02:00
Franck HOUSSEN 38902e024c [BUG FIX] BLAS/LAPACK: allow suffixes in case BLAS/LAPACK can not provide ICB. 2021-10-04 22:50:16 +02:00
Franck HOUSSEN c7382178cf [BUG FIX] autotools: ICB must be checked first (MPI changes compilers). 2021-10-04 22:50:16 +02:00
Dima Pasechnik 5cc85ad6f6 Allow triggering GitHub Actions for PRs (#322) 2021-10-04 22:14:54 +02:00
Dima Pasechnik 5c28eac0b3 CI based on GitHub Actions only (#317) 2021-09-29 09:57:06 +02:00
Haoyang Liu 0a655d918d [TravisCI] Add support for centos:7 (#304)
* CI: add support for centos:7
* add wrapper for centos builds
2021-04-02 17:44:53 +02:00
Haoyang Liu 51b299cba0 CMake : add C99 standard, move to CMake3 (#298)
* update CMakeLists.txt:
- add C99 standard checking to `CMakeLists.txt`
  older compilers may not enable this by default.
- change minimum cmake version to 3.0
  cmake2 does not recognize `add_library(... INTERFACE ...)`

* update CHANGES
2021-03-28 14:15:33 +02:00
Robert Schütz 47fc83cb37 [BUG FIX] Use CMAKE_INSTALL_FULL_<dir> in arpack.pc (#301)
CMAKE_INSTALL_<dir> cannot be assumed to be relative to CMAKE_INSTALL_PREFIX.
See https://github.com/jtojnar/cmake-snips#assuming-cmake_install_dir-is-relative-path.
2021-03-27 09:29:22 +01:00
Haoyang Liu deb47b5682 Fix ci (#299)
[TravisCI] : Fixing CI.
2021-03-26 21:58:56 +01:00
Sylvestre Ledru e3bdd3b8db prepare future release 2020-12-07 11:41:40 +01:00
189 changed files with 4064 additions and 2759 deletions
+10
View File
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
+128
View File
@@ -0,0 +1,128 @@
name: build-alpine
on:
workflow_dispatch:
push:
pull_request:
concurrency: ci-arch-emu-${{ github.ref }}
jobs:
alpine:
# Run armv7 on aarch64 runners
runs-on: ${{ matrix.arch == 'armv7' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
defaults:
run:
# Use emulated shell as default
shell: alpine.sh {0}
strategy:
# Allow other runners in the matrix to continue if some fail
fail-fast: false
matrix:
# For available CPU architectures, see:
# https://github.com/marketplace/actions/setup-alpine-linux-environment
arch: [x86, armv7, loongarch64]
name: alpine (${{ matrix.arch }})
steps:
- name: get CPU information (host)
shell: bash
run: lscpu
- name: checkout repository
uses: actions/checkout@v7
- name: install dependencies
uses: jirutka/setup-alpine@v1
with:
arch: ${{ matrix.arch }}
apk-tools-url: ${{ matrix.arch == 'armv7'
&& 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
|| 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62' }}
packages: >
bash
build-base
ccache
cmake
gfortran
eigen-dev
lapack-dev
lscpu
- name: disable QEMU emulation
if: matrix.arch == 'armv7'
shell: bash
run: sudo update-binfmts --disable qemu-arm
- name: get CPU information (emulated)
run: lscpu
- name: prepare ccache
# create key with human readable timestamp
# used in action/cache/restore and action/cache/save steps
id: ccache-prepare
run: |
echo "key=ccache:alpine:${{ matrix.arch }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
- name: restore ccache
# setup the GitHub cache used to maintain the ccache from one job to the next
uses: actions/cache/restore@v6
with:
# location of the ccache of the chroot in the root file system
path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}
# Prefer caches from the same branch. Fall back to caches from the default branch.
restore-keys: |
ccache:alpine:${{ matrix.arch }}:${{ github.ref }}
ccache:alpine:${{ matrix.arch }}
- name: configure ccache
run: |
test -d ~/.ccache || mkdir ~/.ccache
echo "max_size = 20M" >> ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
ccache -s
which ccache
- name: configure
run: |
echo "gcc --version"
gcc --version
echo "gcc -dumpmachine"
gcc -dumpmachine
echo " "
mkdir -p ${GITHUB_WORKSPACE}/build && cd ${GITHUB_WORKSPACE}/build
cmake \
-DEXAMPLES=ON \
-DMPI=OFF \
-DICB=ON \
-DEIGEN=ON \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
..
- name: build
run: |
cd ${GITHUB_WORKSPACE}/build
cmake --build .
- name: ccache status
continue-on-error: true
run: ccache -s
- name: save ccache
# Save the cache after we are done (successfully) building
# This helps to retain the ccache even if the subsequent steps are failing.
uses: actions/cache/save@v6
with:
path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}
- name: test
run: |
cd ${GITHUB_WORKSPACE}/build
CTEST_OUTPUT_ON_FAILURE=1 ctest .
+219
View File
@@ -0,0 +1,219 @@
name: cross-build-ubuntu
on:
workflow_dispatch:
push:
pull_request:
concurrency: ci-cross-build-ubuntu-${{ github.ref }}
jobs:
cross-build:
runs-on: ${{ matrix.os }}
strategy:
# Allow other runners in the matrix to continue if some fail
fail-fast: false
matrix:
# List of architectures that are supported by Ubuntu:
# https://canonical-ubuntu-packaging-guide.readthedocs-hosted.com/en/latest/reference/architectures/
arch: [armhf, ppc64el, s390x, riscv64]
include:
- arch: armhf
target-triple: arm-linux-gnueabihf
os: ubuntu-24.04-arm
ccache-max: 1G
qemu-user:
- arch: ppc64el
target-triple: powerpc64le-linux-gnu
os: ubuntu-24.04-arm
ccache-max: 1G
qemu-user: qemu-ppc64le
- arch: s390x
target-triple: s390x-linux-gnu
os: ubuntu-24.04
ccache-max: 1G
qemu-user: qemu-s390x
- arch: riscv64
target-triple: riscv64-linux-gnu
os: ubuntu-24.04-arm
ccache-max: 1.4G
qemu-user: qemu-riscv64
name: cross ${{ matrix.arch }}
env:
CC: ${{ matrix.target-triple }}-gcc
CXX: ${{ matrix.target-triple }}-g++
FC: ${{ matrix.target-triple }}-gfortran
steps:
- name: get CPU information
run: lscpu
- name: checkout repository
uses: actions/checkout@v7
- name: install toolchain for ${{ matrix.arch }}
run: |
sudo apt -qq update
sudo apt install -y \
g++-${{ matrix.target-triple }} \
gfortran-${{ matrix.target-triple }} \
cmake \
ccache \
${{ matrix.arch == 'armhf' && ' ' || 'qemu-user-binfmt' }}
- name: add repositories for ${{ matrix.arch }} packages
# deb822-style format:
# https://manpages.ubuntu.com/manpages/noble/man5/sources.list.5.html
run: |
sudo dpkg --add-architecture ${{ matrix.arch }}
case ${{ matrix.os }} in
"ubuntu-24.04-arm")
sudo bash -c 'cat - >/etc/apt/sources.list.d/ubuntu.sources' <<-EOF
Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Architectures: arm64 ${{ matrix.arch }}
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ports.ubuntu.com/ubuntu-ports/
Suites: noble-security
Components: main restricted universe multiverse
Architectures: arm64 ${{ matrix.arch }}
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
EOF
;;
"ubuntu-24.04")
sudo bash -c 'cat - >/etc/apt/sources.list.d/ubuntu.sources' <<-EOF
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Architectures: amd64
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Architectures: amd64
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Architectures: ${{ matrix.arch }}
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ports.ubuntu.com/ubuntu-ports/
Suites: noble-security
Components: main restricted universe multiverse
Architectures: ${{ matrix.arch }}
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
EOF
;;
esac
sudo apt update
- name: install dependencies for ${{ matrix.arch }}
run: |
sudo apt install -y \
openmpi-bin:${{ matrix.arch }} \
libblas-dev:${{ matrix.arch }} \
liblapack-dev:${{ matrix.arch }} \
libeigen3-dev:${{ matrix.arch }}
# Trying to install libopenmpi-dev for the cross-environment causes
# apt to complain about missing .mod file dependencies. Those .mod
# files are already installed with the cross-compiler. Ignore those
# bogus dependency errors and install the package manually.
apt-get download libopenmpi-dev:${{ matrix.arch }}
sudo dpkg -i --force-depends libopenmpi-dev_*_${{ matrix.arch }}.deb
- name: prepare ccache
# create key with human readable timestamp
# used in action/cache/restore and action/cache/save steps
id: ccache-prepare
run: |
echo "key=ccache:cross:${{ matrix.os }}:${{ matrix.arch }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
- name: restore ccache
# setup the github cache used to maintain the ccache from one job to the next
uses: actions/cache/restore@v6
with:
path: ~/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}
restore-keys: |
ccache:cross:${{ matrix.os }}:${{ matrix.arch }}:${{ github.ref }}
ccache:cross:${{ matrix.os }}:${{ matrix.arch }}:refs/heads/default
- name: configure ccache
env:
CCACHE_MAX: ${{ matrix.ccache-max }}
run: |
test -d ~/.ccache || mkdir ~/.ccache
echo "max_size = $CCACHE_MAX" >> ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
ccache -s
echo "/usr/lib/ccache" >> $GITHUB_PATH
- name: configure
run: |
echo $PATH
echo which ccache
which ccache
echo which $CC
which $CC
echo $CC --version
$CC --version
echo which $CXX
which $CXX
echo $CXX --version
$CXX --version
echo which $FC
which $FC
echo $FC --version
$FC --version
mkdir -p ${GITHUB_WORKSPACE}/build && cd ${GITHUB_WORKSPACE}/build
echo "::group::Configure with CMake"
cmake \
-DEXAMPLES=ON \
-DMPI=OFF \
-DICB=ON \
-DEIGEN=ON \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DBLA_VENDOR="Generic" \
..
echo "::endgroup::"
- name: build
run: |
cd ${GITHUB_WORKSPACE}/build
cmake --build .
- name: ccache status
continue-on-error: true
run: ccache -s
- name: save ccache
# Save the cache after we are done (successfully) building
uses: actions/cache/save@v6
with:
path: ~/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}
- name: test
env:
driver: ${{ matrix.qemu-user }}
run: |
cd ${GITHUB_WORKSPACE}/build
CTEST_OUTPUT_ON_FAILURE=1 ctest .
+359
View File
@@ -0,0 +1,359 @@
name: arpack-ng
on: [push, pull_request]
jobs:
ubuntu_latest_cmake:
runs-on: ubuntu-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Update OS
run: sudo apt-get update
- name: Install apt-get dependencies
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake
- name: Run job
run: |
mkdir build
cd build
cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DEIGEN=ON ..
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
make package_source
ubuntu_latest_cmake_install:
runs-on: ubuntu-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Update OS
run: sudo apt-get update
- name: Install apt-get dependencies
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake
- name: Run job
run: |
mkdir build
cd build
cmake ..
bash ./tstCMakeInstall.sh
bash ./tstCMakeInstall.sh 64-
bash ./tstCMakeInstall.sh -ILP64
bash ./tstCMakeInstall.sh 64-ILP64
ubuntu_latest_autotools:
runs-on: ubuntu-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Update OS
run: sudo apt-get update
- name: Install apt-get dependencies
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool
- name: Run job
run: |
./bootstrap
./configure --enable-mpi --enable-icb --enable-eigen
make all
make check
make distcheck
ubuntu_latest_autotools_install:
runs-on: ubuntu-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Update OS
run: sudo apt-get update
- name: Install apt-get dependencies
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool
- name: Run job
run: |
./bootstrap
./configure
bash ./tstAutotoolsInstall.sh
bash ./tstAutotoolsInstall.sh 64-
bash ./tstAutotoolsInstall.sh -ILP64
bash ./tstAutotoolsInstall.sh 64-ILP64
ubuntu_latest_cmake_python:
runs-on: ubuntu-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Update OS
run: sudo apt-get update
- name: Install apt-get dependencies
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev cmake libeigen3-dev
- name: Install python dependencies
run: sudo apt-get -y install python3-minimal python3-pip python3-numpy
- name: Build boost-python for python3 (not provided by apt-cache)
run : |
sudo apt-get -y install wget
wget https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.gz
tar -xf boost_1_79_0.tar.gz
cd boost_1_79_0
./bootstrap.sh --with-libraries=python --with-python=/usr/bin/python3 --with-toolset=gcc
sudo ./b2 toolset=gcc install
sudo apt-get install locate
sudo updatedb
- name: Run job
run: |
mkdir build
cd build
cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DEIGEN=ON -DPYTHON3=ON ..
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
ubuntu_latest_autotools_ilp64:
runs-on: ubuntu-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Update OS
run: sudo apt-get update
- name: Install apt-get dependencies
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev automake autoconf pkg-config libtool libeigen3-dev
- name: Install Intel MKL (ILP64 blas/lapack)
run: echo yes | sudo apt-get -y install intel-mkl libmkl-dev
- name: Run job
run: |
./bootstrap
./configure --enable-icb --with-blas=mkl_gf_ilp64 --with-lapack=mkl_gf_ilp64
make all
make check
env:
FFLAGS: "-DMKL_ILP64 -I/usr/include/mkl"
FCFLAGS: "-DMKL_ILP64 -I/usr/include/mkl"
LIBS: "-Wl,--no-as-needed -L/usr/lib/x86_64-linux-gnu -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
INTERFACE64: "1"
macos_latest_cmake:
runs-on: macos-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Install brew dependencies
run: |
brew reinstall gcc # brings gfortran on path
brew install cmake open-mpi eigen veclibfort
- name: Run job
run: |
mkdir -p build
cd build
export FC=mpif90 # Uses gfortran.
export CC=mpicc # Uses clang.
export CFLAGS="-Qunused-arguments"
export CXX=mpic++ # Uses clang++.
export CXXFLAGS="-Qunused-arguments"
export VECLIBFORT_PREFIX=$(brew --prefix veclibfort)
cmake \
-DBLAS_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \
-DLAPACK_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \
-DEXAMPLES=ON -DICB=ON -DEIGEN=ON -DMPI=ON ..
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
macos_latest_cmake_python:
runs-on: macos-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Install brew dependencies
run: |
# Unlink and re-link to prevent errors when github mac runner images
# install python outside of brew, for example:
# https://github.com/orgs/Homebrew/discussions/3895
# https://github.com/actions/setup-python/issues/577
# https://github.com/actions/runner-images/issues/6459
# https://github.com/actions/runner-images/issues/6507
# https://github.com/actions/runner-images/issues/2322
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done
brew reinstall gcc # brings gfortran on path
brew install cmake eigen boost-python3 python3 numpy veclibfort
- name: Run job
run: |
mkdir -p build
cd build
export FC=gfortran
export CC=clang
export CFLAGS="-Qunused-arguments"
export CXX=clang++
export CXXFLAGS="-Qunused-arguments"
export VECLIBFORT_PREFIX=$(brew --prefix veclibfort)
cmake \
-DBLAS_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \
-DLAPACK_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \
-DEXAMPLES=ON -DICB=ON -DEIGEN=ON -DPYTHON3=ON ..
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
macos_latest_autotools:
runs-on: macos-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Install brew dependencies
run: |
brew reinstall gcc # brings gfortran on path
brew install autoconf automake libtool pkgconfig open-mpi eigen veclibfort
- name: Run job
run: |
./bootstrap
export VECLIBFORT_PREFIX=$(brew --prefix veclibfort)
BLAS_LIBS="-L${VECLIBFORT_PREFIX}/lib -lvecLibFort" \
LAPACK_LIBS="-L${VECLIBFORT_PREFIX}/lib -lvecLibFort" \
./configure --enable-icb --enable-eigen --enable-mpi
make all
make check
windows_latest_cmake:
runs-on: windows-latest
name: MinGW-w64 ${{ matrix.msystem }} INTERFACE64=${{ matrix.int64 }}/MPI=${{ matrix.mpi }}
strategy:
fail-fast: false
matrix:
msystem: [UCRT64, CLANG64]
int64: [ON, OFF]
mpi: [ON, OFF]
exclude:
- int64: ON
mpi: ON
defaults:
run:
# Use MSYS2 as default shell
shell: msys2 {0}
steps:
- name: Install MSYS2 build environment
uses: msys2/setup-msys2@v2
with:
update: true
msystem: ${{ matrix.msystem }}
install: >-
base-devel
git
pacboy: >-
cmake:p
ninja:p
cc:p
fc:p
eigen3:p
- name: Install OpenBLAS and MS-MPI from MSYS2
run: |
if [[ ${{ matrix.int64 }} != ON ]]; then
pacboy -S openblas:p --noconfirm
else
pacboy -S openblas64:p --noconfirm
fi
if [[ ${{ matrix.mpi }} = ON ]]; then
# This installs only the link library.
# The actual library will be installed in the next step.
pacboy -S msmpi:p --noconfirm
fi
- name: Install MS-MPI (for mpiexec)
uses: mpi4py/setup-mpi@v1
- name: Clone and check out repository code
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Run job
run: |
mkdir -p build && cd build
echo "::group::Configure"
if [[ ${{ matrix.int64 }} == ON ]]; then
_blas_lib_flag="-DBLAS_LIBRARIES=openblas_64"
fi
cmake \
-GNinja \
-DICB=ON \
-DEIGEN=ON \
-DEXAMPLES=ON \
-DMPI=${{ matrix.mpi }} \
-DINTERFACE64=${{ matrix.int64 }} \
${_blas_lib_flag} \
..
echo "::endgroup::"
echo "::group::Build"
cmake --build . -v
echo "::endgroup::"
- name: Run tests
id: run-ctest
run: |
if [[ ${{ matrix.mpi }} == ON ]]; then
export PATH="/c/Program Files/Microsoft MPI/Bin":$PATH # add mpiexec to msys2 path
fi
cd build
ctest
- name: Re-run tests
if: always() && (steps.run-ctest.outcome == 'failure')
timeout-minutes: 60
run: |
if [[ ${{ matrix.mpi }} == ON ]]; then
export PATH="/c/Program Files/Microsoft MPI/Bin":$PATH # add mpiexec to msys2 path
fi
cd build
echo "::group::Re-run ctest"
ctest --rerun-failed --output-on-failure || true
echo "::endgroup::"
echo "::group::Log from these tests"
[ ! -f Testing/Temporary/LastTest.log ] || cat Testing/Temporary/LastTest.log
echo "::endgroup::"
echo "::group::Content of arpackmm.run.log"
[ ! -f EXAMPLES/MATRIX_MARKET/arpackmm.run.log ] || cat EXAMPLES/MATRIX_MARKET/arpackmm.run.log
echo "::endgroup::"
+5 -5
View File
@@ -15,13 +15,13 @@ config.log
config.status
libtool
.deps/
arpack.pc
parpack.pc
arpackSolver.pc
arpack*.pc
parpack*.pc
arpackdef.h
arpackicb.h
arpack-ng-config.cmake
arpack-ng-config-version.cmake
tstAutotoolsInstall.sh
cmake/arpackng-config-version.cmake
cmake/arpackng-config.cmake
# Generated by `make`
.dirstamp
-288
View File
@@ -1,288 +0,0 @@
sudo: true
language: c
compiler:
- gcc
addons:
apt:
packages:
- gfortran
- gcc
- g++
- openmpi-bin
- libopenmpi-dev
- cmake
- automake
- autoconf
- pkg-config
- libtool
- libblas-dev
- liblapack-dev
- diffutils
- findutils
- libeigen3-dev
services:
- docker
stages:
# order stages
- name: opensuse
- name: centos
- name: fedora
- name: osx
- name: ubuntu_precise
- name: ubuntu_trusty
- name: ubuntu_xenial
- name: ubuntu_bionic
- name: ubuntu_eoan
- name: ubuntu_focal
- name: coverage
- name: debian_interface64
jobs:
include:
# opensuse: "recent" systems with ICB
# note: when you PR, docker-cp provides, in the container, the branch associated with the PR (not master where there's nothing new)
# 1. docker create --name mobydick IMAGE CMD <=> create a container (= instance of image) but container is NOT yet started
# 2. docker cp -a ${TRAVIS_BUILD_DIR} mobydick:/tmp <=> copy git repository (CI worker, checkout-ed on PR branch) into the container
# note: docker-cp works only if copy from/to containers (not images)
# 3. docker start -a mobydick <=> start to run the container (initialized with docker-cp)
- stage: opensuse
dist: bionic
script: |
sudo docker pull opensuse/tumbleweed \
&& \
sudo docker create --name mobydick opensuse/tumbleweed /bin/bash -c \
"zypper install -y git gcc gcc-fortran gcc-c++ openmpi2-devel && \
zypper install -y cmake && \
zypper install -y blas-devel lapack-devel && \
cd /tmp && \
cd arpack-ng && \
git status && \
git log -2 && \
sed -e 's/mpirun /mpirun --allow-run-as-root --oversubscribe /' -i CMakeLists.txt && \
mkdir -p build && cd build && \
cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON .. && \
export PATH=/usr/lib64/mpi/gcc/openmpi2/bin:/usr/lib/mpi/gcc/openmpi2/bin/:$PATH && \
make all && make test" \
&& \
sudo docker cp -a ${TRAVIS_BUILD_DIR} mobydick:/tmp \
&& \
sudo docker start -a mobydick
# centos: "recent" systems with ICB
- stage: centos
dist: bionic
script: |
sudo docker pull centos \
&& \
sudo docker create --name mobydick centos /bin/bash -c \
"dnf install -y dnf-plugins-core epel-release && \
dnf upgrade -y && \
dnf config-manager --set-enabled PowerTools && \
dnf install -y git make gcc gcc-gfortran gcc-c++ environment-modules && \
dnf install -y cmake && \
dnf install -y mpich-devel && \
dnf --enablerepo=\"epel\" install -y openblas-devel lapack-devel && \
. /etc/profile.d/modules.sh && \
module avail && module load mpi && module list && \
cd /tmp && \
cd arpack-ng && \
git status && \
git log -2 && \
mkdir -p build && cd build && \
cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON .. && \
make all && make test" \
&& \
sudo docker cp -a ${TRAVIS_BUILD_DIR} mobydick:/tmp \
&& \
sudo docker start -a mobydick
# fedora (released fedora with openmpi)
- stage: fedora
name: "Fedora latest with openmpi"
dist: bionic
script: ./scripts/travis_fedora.sh setup openmpi latest
# fedora (with gcc 10 and mpich)
- stage: fedora
name: "Fedora rawhide with mpich"
dist: bionic
script: ./scripts/travis_fedora.sh setup mpich rawhide
# osx
- stage: osx
os: osx
osx_image: xcode12
before_install:
- brew list -1 | while read line; do brew unlink $line; done;
- brew list gcc || brew install gcc
- brew list autoconf || brew install autoconf
- brew list automake || brew install automake
- brew list mpich || brew install mpich
- brew list -1 | while read line; do brew link --overwrite $line; done;
- softwareupdate --install -a
# full build and testing with Accelerate framework (xcode provides vecLib which stands for BLAS/LAPACK)
# note: -ff2c to convert fortran code to C, -fno-second-underscore to force underscoring of external symbols to link
script: |
./bootstrap && LIBS="-framework Accelerate" FFLAGS="-ff2c -fno-second-underscore" FCFLAGS="-ff2c -fno-second-underscore" ./configure --enable-icb --enable-mpi && make VERBOSE=1 && make check
- stage: osx
os: osx
osx_image: xcode12
before_install:
- brew list -1 | while read line; do brew unlink $line; done;
- brew list gcc || brew install gcc
- brew list cmake || brew install cmake
- brew list openblas || brew install openblas
- brew list lapack || brew install lapack
- brew list mpich || brew install mpich
- brew list -1 | while read line; do brew link --overwrite $line; done;
# full build and testing with openblas and lapack
# note: -ff2c to convert fortran code to C, -fno-second-underscore to force underscoring of external symbols to link
script: |
mkdir -p build && cd build && FFLAGS="-ff2c -fno-second-underscore" FCFLAGS="-ff2c -fno-second-underscore" cmake -DEXAMPLES=ON -DICB=ON -DMPI=ON .. && make VERBOSE=1 && make test
- stage: osx
os: osx
osx_image: xcode11
before_install:
- brew list -1 | while read line; do brew unlink $line; done;
- brew list arpack || brew install arpack # Test osx formula
- brew list -1 | while read line; do brew link --overwrite $line; done;
script: ls # Need fake script.
- stage: osx
os: osx
osx_image: xcode12
before_install:
- brew list -1 | while read line; do brew unlink $line; done;
- brew list arpack || brew install arpack # Test osx formula
- brew list -1 | while read line; do brew link --overwrite $line; done;
script: ls # Need fake script.
# ubuntu_precise <=> test "older" systems, without ICB, without cmake (too old to be supported)
- stage: ubuntu_precise
dist: precise
script: ./bootstrap && ./configure && make VERBOSE=1 && make check && make distcheck;
- stage: ubuntu_precise
dist: precise
script: ./bootstrap && ./configure --enable-mpi && make VERBOSE=1 && make check && make distcheck;
# ubuntu_trusty <=> test "older" systems, without ICB
- stage: ubuntu_trusty
dist: trusty
script: mkdir -p build && cd build && cmake -D EXAMPLES=ON -D MPI=ON -D ICB=OFF .. && make VERBOSE=1 && make test && make package_source;
- stage: ubuntu_trusty
dist: trusty
script: ./bootstrap && ./configure --enable-mpi && make VERBOSE=1 && make check && make distcheck;
# ubuntu_xenial <=> test "recent" systems, with ICB
- stage: ubuntu_xenial
dist: xenial
script: mkdir -p build && cd build && cmake -D EXAMPLES=ON -D MPI=ON -D ICB=ON .. && make VERBOSE=1 && make test && make package_source;
- stage: ubuntu_xenial
dist: xenial
script: ./bootstrap && ./configure --enable-mpi --enable-icb && make VERBOSE=1 && make check && make distcheck;
# ubuntu_bionic <=> test "recent" systems, with ICB
- stage: ubuntu_bionic
dist: bionic
script: ./bootstrap && ./configure --enable-icb --enable-icb-exmm --enable-mpi && export VERBOSE=1 && make all && make check
- stage: ubuntu_bionic
dist: bionic
before_install:
- sudo apt-get -y install python3-minimal python3-pip python3-numpy
- sudo pip3 install --system numpy
# need to build boost-python from source for python 3 (repository package is built for python 2)
- sudo apt-get -y install wget
- wget https://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.gz
- tar -xf boost_1_67_0.tar.gz && cd boost_1_67_0
- ./bootstrap.sh --with-libraries=python --with-python=/usr/bin/python3
- sudo ./b2 install
- sudo apt-get install locate
- sudo updatedb
script: |
cd $TRAVIS_BUILD_DIR && mkdir -p build && cd build && \
cmake -DEXAMPLES=ON -DICB=ON -DICBEXMM=ON -DMPI=ON -DPYTHON3=ON -DBOOST_PYTHON_LIBSUFFIX='36' .. && \
export VERBOSE=1 && make all && make test
# ubuntu_eoan <=> test "recent" systems, with ICB
- stage: ubuntu_eoan
dist: bionic
script: ./scripts/travis_ubuntu.sh ubuntu :eoan
# ubuntu_focal <=> test "recent" systems, with ICB
- stage: ubuntu_focal
dist: bionic
script: ./scripts/travis_ubuntu.sh ubuntu :focal
# coverage: "recent" systems with ICB
- stage: coverage
dist: bionic
script: |
mkdir -p build && cd build \
&& \
cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DCOVERALLS=ON .. &> cmake.log \
&& \
tail -n 50 cmake.log \
&& \
make all &> compil.log \
&& \
tail -n 50 compil.log \
&& \
make test &> test.log \
&& \
tail -n 50 test.log \
&& \
make coveralls &> coveralls.log \
&& \
head -n 50 coveralls.log && tail -n 50 coveralls.log \
&& \
head -n 50 coveralls.json && tail -n 50 coveralls.json
# debian_interface64: "recent" systems with ICB + MKL + ILP64 (need debian/testing to get MKL-ILP64)
# note: when you PR, docker-cp provides, in the container, the branch associated with the PR (not master where there's nothing new)
# 1. docker create --name mobydick IMAGE CMD <=> create a container (= instance of image) but container is NOT yet started
# 2. docker cp -a ${TRAVIS_BUILD_DIR} mobydick:/tmp <=> copy git repository (CI worker, checkout-ed on PR branch) into the container
# note: docker-cp works only if copy from/to containers (not images)
# 3. docker start -a mobydick <=> start to run the container (initialized with docker-cp)
- stage: debian_interface64
dist: xenial
script: |
sudo docker pull debian \
&& \
sudo docker create --name mobydick debian /bin/bash -c \
"cat /etc/os-release && \
cat /etc/apt/sources.list && \
sed -e 's/stretch/testing/' -i /etc/apt/sources.list && \
sed -e 's/main/main non-free contrib/' -i /etc/apt/sources.list && \
sed -e '/security.debian.org/d' -i /etc/apt/sources.list && \
cat /etc/apt/sources.list && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get -y update && \
apt-get -y --allow-unauthenticated -o Dpkg::Options::=--force-confdef upgrade && \
apt-get -y --allow-unauthenticated -o Dpkg::Options::=--force-confdef dist-upgrade && \
cat /etc/os-release && \
apt-get -y install dialog && \
echo yes | apt-get -y install intel-mkl libmkl-dev && \
apt-get -y install build-essential && \
apt-get -y install git gfortran gcc g++ openmpi-bin libopenmpi-dev automake autoconf libtool pkg-config && \
apt-get -y install libeigen3-dev && \
cd /tmp && \
cd arpack-ng && \
git status && \
git log -2 && \
sed -e 's/LOG_FLAGS = /LOG_FLAGS = --allow-run-as-root --oversubscribe /' -i PARPACK/EXAMPLES/MPI/Makefile.am && \
sed -e 's/LOG_FLAGS = /LOG_FLAGS = --allow-run-as-root --oversubscribe /' -i PARPACK/TESTS/MPI/Makefile.am && \
./bootstrap && \
export FFLAGS='-DMKL_ILP64 -I/usr/include/mkl' && \
export FCFLAGS='-DMKL_ILP64 -I/usr/include/mkl' && \
export LIBS='-Wl,--no-as-needed -L/usr/lib/x86_64-linux-gnu -lmkl_sequential -lmkl_core -lpthread -lm -ldl' && \
export INTERFACE64=1 && \
./configure --with-blas=mkl_gf_ilp64 --with-lapack=mkl_gf_ilp64 --enable-mpi --enable-icb-exmm \
--disable-dependency-tracking && \
export VERBOSE=1 && \
make all && \
make check && \
find . -name test-suite.log | xargs tail -n 300" \
&& \
sudo docker cp -a ${TRAVIS_BUILD_DIR} mobydick:/tmp \
&& \
sudo docker start -a mobydick
after_failure:
# show build error or test log to know what is wrong if errors occured.
- if [[ -f $TRAVIS_BUILD_DIR/build/Testing/Temporary/LastTest.log ]]; then tail -n 300 $TRAVIS_BUILD_DIR/build/Testing/Temporary/LastTest.log; fi
- find . -name test-suite.log | xargs tail -n 300
- find . -name arpackmm.run.log | xargs tail -n 300
+130 -1
View File
@@ -1,3 +1,132 @@
arpack-ng - next
[ Evan Biederstedt ]
* Fix warnings for "Warning: Obsolescent feature: Old-style character length at (1)", compiled with `gfortran-16 -fpic -g -O2 -Wall -pedantic -mtune=native`
* Changed GitHub CI workflows for Mac OS to use 'brew install open-mpi', as `mpich` fails.
[ Theodore Chang ]
* CMake: Improve dependency linking, bump up minimum C++ standard version.
[ Franck Houssen ]
* [BUG FIX] Fix arpack solver to handle real and imag shifts.
* [BUG FIX] Make sure the restart file of the arpack solver i written.
* [BUG FIX] Change arpack solver API.
[ Henri Menke ]
* [BUG FIX] Add missing stdexcept header
[ Kyle Guinn ]
* Build PARPACK p[sd]lamch10.f with FFLAGS from ./configure instead of forcing -O0. Build all of PARPACK with AM_FFLAGS.
* [BUG FIX] Don't install pkg-config files for libraries that were not built.
[ Markus Mützel ]
* CMake: Fix running CTests on Windows.
* Use GNU Fortran ABI in CI tests on macOS.
* Initialize machine dependent constants only once in `PDNAITR`.
[ Szabolcs Horvát ]
* fix obsolescent character length warnings
-- TODO <TODO@users.noreply.github.com> DATE
arpack-ng - 3.9.1
[ Fabien Péan ]
* pyarpack: Ensure that the matrix properties (symmetric/hermitian) fit the solver (CG/LDL) with which they are used in the tests
* [BUG FIX] Tests for PARPACK with C/C++ bindings icb_parpack_c and icb_parpack_cpp are now really parallel and split the problem across MPI processes.
* Update arpackmm test suite: enable solving non-symmetric tests with BiCG solver
* README: Add details on Windows installation.
[ Szabolcs Horvát ]
* [BUG FIX] Ensure that LAPACK RNG state is propagated (regression in 3.9.0).
* [BUG FIX] Ensure that separate random seeds are used on different parallel thread in D and S versions of functions (issue from original ARPACK).
[ Ruoyu Feng ]
* ICB(arpackdef.h): distinct intel llvm compiler (icx with clang-cl) from msvc on windows
* ICB(arpackdef.h): Undef macro I if complex.h from msvc version is loaded, which is an usual name and causes issues on arpackSolver.
[ Franck Houssen ]
* [BUG FIX] Fix install: headers in /path/to/local/include/arpack for ICB samples
* [BUG FIX] Fix install: headers in /path/to/local/include/arpack
* arpackmm: allow for using LA/SA magnitudes.
* Rename icbexmm option into eigen option.
* README: document how to use ICB.
* [BUG FIX] arpackmm: fix restart.
* README: document where to find arpack user's guide.
-- Franck Houssen <fghoussen@users.noreply.github.com> Sat, 14 Oct 2023 13:37:37 +0200
[ Franck Houssen ]
* Add documentation on ILP64.
arpack-ng - 3.9.0
[ Vikas Sharma ]
* Improve README.
[ Fabien Péan ]
* CI: Enable job `windows_latest_cmake` to run all tests
* CMake: Fix BLAS and LAPACK static library order needed to consume the library on Windows with static linkage
* Fix using ARPACK on Windows with MSVC compiler from C++17 onwards
[ Zhentao Wang ]
* [BUG FIX] parpack.h and parpack.hpp: type of rwork should be real instead of complex.
* Allow ritz_option {"LR", "SR", "LI", "SI"} for complex eigenvalue problems in ICB.
[ Jose E. Roman ]
* Avoid using isnan() in tests, since is GNU-specific
[ Tom Payerle ]
* Change the continuation line format for stat.h, debug.h
[ John Doe ]
* Avoid calling [c|z]dotc for better portability on macOS
[ Dima Pasechnik ]
* [BUG FIX] autotools: replace obsolete AC_TRY_COMPILE macros.
* Support for NAG's nagfor Fortran compiler
[ Franck Houssen ]
* Create one .cmake file per arpack-ng flavor (32-bits, 64-bits, ILP64).
* Test autotools pkg-config (*.pc files) with/without LIBSUFFIX/ITF64SUFFIX.
* Test CMake find_package (*.cmake files) with/without LIBSUFFIX/ITF64SUFFIX.
* [BUG FIX] autotools: ICB must be checked first (MPI changes compilers).
* [BUG FIX] BLAS/LAPACK: allow suffixes in case BLAS/LAPACK can not provide ICB.
* [BUG FIX] Compile C programs with ICB.
* arpackmm: command line bug fix.
* arpackmm: restart bug fix.
* pyarpack: fix compilation warning, test on macos and latest boost-python (1.79).
* arpackSolver: fix error messages.
* [BUG FIX] Make sure iseed is always initialized to values allowed by lapack ?larnv.
* [BUG FIX] According to lapack doc of ?larnv, iseed(4) must be odd.
* [BUG FIX] Use MPI ICB types (mpi_f08) instead of integer(kind=i_int).
* parpack: no ILP64 support.
[ Haoyang Liu ]
* CMake: minimum required version changed to 3.0
* CMake: add C99 standard checking
* CI: Support for centos7 added.
* CI: Add `scripts/travis_centos.sh` for centos builds
[ Robert Schütz ]
* use CMAKE_INSTALL_FULL_<dir> in arpack.pc
[ Markus Mützel ]
* CMake: Handle libraries without "lib" prefix.
* CMake: Don't override BLAS/LAPACK/MPI flags. Directly use results from the Find* modules instead.
[ Juan José García-Ripoll ]
* Adapt the C/C++ interface to accept also MSVC's non-standard complex types.
* Propagate dependencies to CMake targets that use arpack-ng:
- Create CMake-generated targets and configuration files that keep track of
arpack's dependencies (libraries, directories) and expose them to users.
- Install those files under ${prefix}/lib/cmake/arpackng* so that arpack can be
found using 'find_package(arpackng)' from CMake files.
- Add code to the arpackng-config.cmake to find required dependencies when this
module is loaded by find_package(arpackng).
-- Sylvestre Ledru <sylvestre@debian.org> Mon, 07 Dec 2020 11:37:40 +0100
arpack-ng - 3.8.0
[ Myron Oikonomakis ]
@@ -129,7 +258,7 @@ arpack-ng - 3.5.0
* Improve cmake build system: disable C++ detection, set default build type.
[ Marco Atzeri]
* Use AC_PROG_FC instead of AC_PROG_F77 for proper inizialization
* Use AC_PROG_FC instead of AC_PROG_F77 for proper initialization
for the usage of AC_FC_LINE_LENGTH. Noted on Cygwin.
[ Denis Davydov ]
+441 -320
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.6)
cmake_minimum_required(VERSION 3.5)
if (NOT DEFINED CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
@@ -7,12 +7,16 @@ endif ()
project(arpack C Fortran)
set(arpack_ng_MAJOR_VERSION 3)
set(arpack_ng_MINOR_VERSION 8)
set(arpack_ng_PATCH_VERSION 0)
set(arpack_ng_MINOR_VERSION 9)
set(arpack_ng_PATCH_VERSION 1)
set(arpack_ng_VERSION ${arpack_ng_MAJOR_VERSION}.${arpack_ng_MINOR_VERSION}.${arpack_ng_PATCH_VERSION})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
# set C99 standard
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED True)
# Adopted from https://github.com/feymark/arpack.git
if (POLICY CMP0042)
@@ -23,28 +27,28 @@ endif ()
option(BUILD_SHARED_LIBS "Build shared libraries instead of static libraries" ON)
option(MPI "Enable parallel support" OFF)
option(ICB "Enable support for *[ae]upd_c with ISO_C_BINDING" OFF)
option(ICBEXMM "Enable support for matrix market example based on ICB" OFF)
option(EIGEN "Enable support for eigenvalue-problems solver based on ICB and eigen" OFF)
option(PYTHON3 "Enable python3 support" OFF)
set(BOOST_PYTHON_LIBSUFFIX "" CACHE STRING "suffix to add to custom boost python libs")
option(EXAMPLES "Compile ARPACK examples" OFF)
option(TESTS "Compile ARPACK tests" ON)
# Suffixes: LIBSUFFIX modify ONLY libraries names, ITF64SUFFIX modify BOTH libraries AND include directory names.
set(LIBSUFFIX ""
CACHE STRING "suffix to add to ARPACK libraries names")
set(ITF64SUFFIX ""
CACHE STRING "suffix to add to ARPACK include directory and libraries names (use with INTERFACE64)")
set(SYMBOLSUFFIX ""
CACHE STRING "suffix to add to ARPACK, BLAS and LAPACK function names")
option(INTERFACE64 "use the 64-bit integer interface (ILP64) for ARPACK, BLAS and LAPACK")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# 'make install' to the correct location, and also define
# paths for target_include_directories and target_link_libraries
include(GNUInstallDirs)
set(ARPACK_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/arpack${ITF64SUFFIX}")
set(ARPACK_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/arpackng${LIBSUFFIX}${ITF64SUFFIX}")
# We don't want this to run on every build.
option(COVERALLS "Generate coveralls data" OFF)
if (COVERALLS)
include(Coveralls)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
# The no space is by design: issue in cmake. See CMP0004.
set(EXTRA_LDFLAGS "${EXTRA_LDFLAGS}-lgcov")
endif()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
function(prefixlist list_name prefix)
set(${list_name}_TMP)
@@ -58,8 +62,8 @@ function(examples list_name)
foreach(l ${${list_name}})
get_filename_component(lwe ${l} NAME_WE)
add_executable(${lwe} ${arpackexample_DIR}/${l} ${examples_EXTRA_SRCS})
target_link_libraries(${lwe} arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(NAME "${lwe}_ex" COMMAND ${lwe} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
target_link_libraries(${lwe} arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(NAME "${lwe}_ex" COMMAND ${lwe})
endforeach()
endfunction(examples)
@@ -68,19 +72,25 @@ function(pexamples list_name)
get_filename_component(lwe ${l} NAME_WE)
add_executable(${lwe} ${parpackexample_DIR}/${l} )
target_link_libraries(${lwe} parpack arpack MPI::MPI_Fortran)
add_test(NAME "${lwe}_ex" COMMAND mpirun -n 2 ./${lwe} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
add_test(NAME "${lwe}_ex" COMMAND mpiexec -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${lwe})
endforeach()
endfunction(pexamples)
if (PYTHON3 OR EIGEN OR ICB)
enable_language(CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif ()
if (PYTHON3)
find_package(PythonInterp 3 REQUIRED)
find_package(PythonLibs 3 REQUIRED)
find_package(Boost COMPONENTS python${BOOST_PYTHON_LIBSUFFIX} numpy${BOOST_PYTHON_LIBSUFFIX} REQUIRED)
find_package(Boost 1.78 COMPONENTS python${BOOST_PYTHON_LIBSUFFIX} numpy${BOOST_PYTHON_LIBSUFFIX} REQUIRED)
set(ICBEXMM "ON")
set(EIGEN "ON")
endif ()
if (ICBEXMM)
if (EIGEN)
find_package(Eigen3 3.3 QUIET)
if (NOT EIGEN3_FOUND) # If not found, piggy-back pkg-config files.
message(WARNING "CMake didn't find the Eigen3 package. Try to look for pkg-config file...")
@@ -88,7 +98,6 @@ if (ICBEXMM)
pkg_check_modules(EIGEN3 REQUIRED eigen3>=3.3)
set(EIGEN3_INCLUDE_DIR ${EIGEN3_INCLUDE_DIRS})
endif ()
find_program (BASH_PROGRAM bash)
# Look for headers.
find_path(EIGEN3_ITERATIVE_SOLVER_DIR NAMES IterativeLinearSolvers PATHS ${EIGEN3_INCLUDE_DIR} PATH_SUFFIXES Eigen)
@@ -133,10 +142,6 @@ endif ()
# Enable language(s) before any find_package (in particular before MPI find_package).
if (ICB)
enable_language(C CXX) # For testing binding with c/c++.
set(CMAKE_CXX_STANDARD 11) # OK, since cmake-3.1 only.
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/PROG_ICB.f90
"
PROGRAM PROG_ICB
@@ -153,8 +158,154 @@ if (ICB)
message("-- Fortran compiler does support iso_c_binding.")
endif()
else()
# ICB saves you from old-fashion-boring-cumbersome-fortran/C crap...
# ICB saves you from old-fashion-boring-cumbersome-fortran/C crap... For arpack symbols (only).
if (SYMBOLSUFFIX)
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -ffixed-line-length-none")
elseif ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "LLVMFlang")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -ffixed-line-length=none")
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp -extend-source")
else ()
message(WARNING "build script does not know how to enable your Fortran compiler's preprocessor and support for lines longer than 72 characters: set them manually via FFLAGS.")
endif ()
set(SCALARFUNS naitr napps naup2 naupd nconv neigh neupd ngets statn saitr sapps saup2 saupd sconv seigt seupd sgets stats getv0 sortc sortr sesrt stqrb)
set(COMPLEXFUNS, naitr napps naup2 naupd neigh neupd ngets statn getv0 sortc)
foreach (f IN LISTS SCALARFUNS)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Ds${f}=s${f}${SYMBOLSUFFIX} -Dd${f}=d${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS COMPLEXFUNS)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Dc${f}=c${f}${SYMBOLSUFFIX} -Dz${f}=z${f}${SYMBOLSUFFIX}")
endforeach ()
set(CFUNS snaupd sneupd dnaupd dneupd)
foreach (f IN LISTS CFUNS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D${f}=${f}${SYMBOLSUFFIX}")
list(APPEND CFUNS_SUFFIXED ${f}${SYMBOLSUFFIX})
endforeach ()
include(FortranCInterface)
FortranCInterface_HEADER(FCMangle.h SYMBOLS ${CFUNS_SUFFIXED})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DINCLUDE_FCMANGLE")
FortranCInterface_VERIFY()
endif ()
endif ()
# Find MPI
if (MPI)
if (NOT TARGET MPI::MPI_Fortran) # Search only if not already found by upper CMakeLists.txt
include(FindMPI)
find_package(MPI REQUIRED COMPONENTS Fortran)
# MPI::MPI_* target was already created at this point by FindMPI.cmake if cmake version >= 3.9
if (NOT TARGET MPI::MPI_Fortran) # Create target "at hand" to ensure compatibility if cmake version < 3.9
add_library(MPI::MPI_Fortran INTERFACE IMPORTED)
set_target_properties(MPI::MPI_Fortran PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MPI_Fortran_INCLUDE_DIRS}")
set_target_properties(MPI::MPI_Fortran PROPERTIES INTERFACE_LINK_LIBRARIES "${MPI_Fortran_LIBRARIES}")
endif()
endif()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MPI_Fortran_COMPILE_FLAG}")
if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-invalid-boz")
endif()
# Check if we can use ISO_C_BINDING provided by MPI.
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/PROG_ICB.f90
"
PROGRAM PROG_ICB
USE :: mpi_f08
IMPLICIT NONE
type(MPI_Comm) comm
type(MPI_Status) status
END PROGRAM PROG_ICB
")
try_compile(COMPILE_ICB ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/PROG_ICB.f90 LINK_LIBRARIES MPI::MPI_Fortran)
if(NOT ${COMPILE_ICB})
message("-- MPI library does not support iso_c_binding.")
set(HAVE_MPI_ICB 0)
else()
message("-- MPI library does support iso_c_binding.")
set(HAVE_MPI_ICB 1)
add_compile_definitions(HAVE_MPI_ICB=1)
endif()
# As MPI can be used with or without ISO_C_BINDING (#ifdef), we need to preprocess code before compiling.
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp")
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp")
else ()
message(WARNING "build script does not know how to preprocess Fortran code: set it manually via FFLAGS.")
endif ()
if(ICB)
if (NOT TARGET MPI::MPI_C) # Search only if not already found by upper CMakeLists.txt
include(FindMPI)
find_package(MPI REQUIRED COMPONENTS C)
if (NOT TARGET MPI::MPI_C) # Create target "at hand" to ensure compatibility if cmake version < 3.9
add_library(MPI::MPI_C INTERFACE IMPORTED)
set_target_properties(MPI::MPI_C PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MPI_C_INCLUDE_DIRS}")
set_target_properties(MPI::MPI_C PROPERTIES INTERFACE_LINK_LIBRARIES "${MPI_C_LIBRARIES}")
endif()
endif()
if (NOT TARGET MPI::MPI_CXX) # Search only if not already found by upper CMakeLists.txt
include(FindMPI)
find_package(MPI REQUIRED COMPONENTS CXX)
if (NOT TARGET MPI::MPI_CXX) # Create target "at hand" to ensure compatibility if cmake version < 3.9
add_library(MPI::MPI_CXX INTERFACE IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MPI_CXX_INCLUDE_DIRS}")
set_target_properties(MPI::MPI_CXX PROPERTIES INTERFACE_LINK_LIBRARIES "${MPI_CXX_LIBRARIES}")
endif()
endif()
include(CheckSymbolExists)
check_symbol_exists(MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" MPI_Comm_c2f_FOUND)
if(NOT ${MPI_Comm_c2f_FOUND})
message(FATAL_ERROR "symbol MPI_Comm_c2f does not exist")
endif()
endif()
endif()
# Find BLAS
if (NOT TARGET BLAS::BLAS) # Search only if not already found by upper CMakeLists.txt
find_package(BLAS REQUIRED)
# BLAS::BLAS target was already created at this point by FindBLAS.cmake if cmake version >= 3.18
if (NOT TARGET BLAS::BLAS) # Create target "at hand" to ensure compatibility if cmake version < 3.18
add_library(BLAS::BLAS INTERFACE IMPORTED)
set_target_properties(BLAS::BLAS PROPERTIES INTERFACE_LINK_LIBRARIES "${BLAS_LIBRARIES}")
endif()
endif()
# Find LAPACK
if (NOT TARGET LAPACK::LAPACK) # Search only if not already found by upper CMakeLists.txt
find_package(LAPACK REQUIRED)
# LAPACK::LAPACK target was already created at this point by FindLAPACK.cmake if cmake version >= 3.18
if (NOT TARGET LAPACK::LAPACK) # Create target "at hand" to ensure compatibility if cmake version < 3.18
add_library(LAPACK::LAPACK INTERFACE IMPORTED)
set_target_properties(LAPACK::LAPACK PROPERTIES INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
endif()
endif()
set(LAPACK_BLAS_LIBS LAPACK::LAPACK BLAS::BLAS)
# As BLAS/LAPACK does not provide ICB, we may have to deal with symbols the old-fashion-boring-cumbersome-fortran/C way...
if (SYMBOLSUFFIX)
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -ffixed-line-length-none")
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
@@ -163,34 +314,29 @@ else()
message(WARNING "build script does not know how to enable your Fortran compiler's preprocessor and support for lines longer than 72 characters: set them manually via FFLAGS.")
endif ()
set(SCALARFUNS naitr napps naup2 naupd nconv neigh neupd ngets statn saitr sapps saup2 saupd sconv seigt seupd sgets stats getv0 sortc sortr sesrt stqrb)
set(COMPLEXFUNS, naitr napps naup2 naupd neigh neupd ngets statn getv0 sortc)
set(BLASFUNS1 axpy copy gemv geqr2 lacpy lae2 lahqr lanhs larnv lartg lascl laset lasrt scal trevc trmm trsen gbmv gbtrf gbtrs gttrf gttrs pttrf pttrs)
set(BLASFUNS2 dot ger labad laev2 lamch lanst lanv2 lapy2 larf larfg lasr nrm2 orm2r rot steqr swap)
set(BLASFUNS3 dotc geru unm2r)
set(BLASFUNS4 COPY LABAD LAMCH LANHS LANV2 LARFG ROT GEMV)
set(BLASFUNS5 scnrm2 dznrm2 csscal zdscal)
if (SYMBOLSUFFIX)
foreach (f IN LISTS SCALARFUNS BLASFUNS1 BLASFUNS2)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Ds${f}=s${f}${SYMBOLSUFFIX} -Dd${f}=d${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS BLASFUNS1 BLASFUNS2)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Ds${f}=s${f}${SYMBOLSUFFIX} -Dd${f}=d${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS COMPLEXFUNS BLASFUNS1 BLASFUNS3)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Dc${f}=c${f}${SYMBOLSUFFIX} -Dz${f}=z${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS BLASFUNS1 BLASFUNS3)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Dc${f}=c${f}${SYMBOLSUFFIX} -Dz${f}=z${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS BLASFUNS4)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DS${f}=S${f}${SYMBOLSUFFIX} -DD${f}=D${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS BLASFUNS4)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DS${f}=S${f}${SYMBOLSUFFIX} -DD${f}=D${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS BLASFUNS5)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D${f}=${f}${SYMBOLSUFFIX}")
endforeach ()
endif ()
foreach (f IN LISTS BLASFUNS5)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D${f}=${f}${SYMBOLSUFFIX}")
endforeach ()
set(CFUNS sgemm snaupd sneupd dnaupd dneupd cheev)
set(CFUNS sgemm cheev)
foreach (f IN LISTS CFUNS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D${f}=${f}${SYMBOLSUFFIX}")
list(APPEND CFUNS_SUFFIXED ${f}${SYMBOLSUFFIX})
@@ -204,69 +350,6 @@ else()
FortranCInterface_VERIFY()
endif ()
if (NOT TARGET BLAS::BLAS) # Search only if not already found by upper CMakeLists.txt
find_package(BLAS REQUIRED)
# BLAS::BLAS target was already created at this point by FindBLAS.cmake if cmake version >= 3.18
if (NOT TARGET BLAS::BLAS) # Create target "at hand" to ensure compatibility if cmake version < 3.18
add_library(BLAS::BLAS INTERFACE IMPORTED)
set_target_properties(BLAS::BLAS PROPERTIES INTERFACE_LINK_LIBRARIES "${BLAS_LIBRARIES}")
endif()
endif()
get_target_property(BLAS_LIBRARIES BLAS::BLAS INTERFACE_LINK_LIBRARIES) # Get variables from target (*.pc/cmake, msg).
if (MPI)
if (NOT TARGET MPI::MPI_Fortran) # Search only if not already found by upper CMakeLists.txt
include(FindMPI)
find_package(MPI REQUIRED)
# MPI::MPI_* target was already created at this point by FindMPI.cmake if cmake version >= 3.9
if (NOT TARGET MPI::MPI_Fortran) # Create target "at hand" to ensure compatibility if cmake version < 3.9
add_library(MPI::MPI_Fortran INTERFACE IMPORTED)
set_target_properties(MPI::MPI_Fortran PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MPI_Fortran_INCLUDE_DIRS}")
set_target_properties(MPI::MPI_Fortran PROPERTIES INTERFACE_LINK_LIBRARIES "${MPI_Fortran_LIBRARIES}")
endif()
if (NOT TARGET MPI::MPI_C) # Create target "at hand" to ensure compatibility if cmake version < 3.9
add_library(MPI::MPI_C INTERFACE IMPORTED)
set_target_properties(MPI::MPI_C PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MPI_C_INCLUDE_DIRS}")
set_target_properties(MPI::MPI_C PROPERTIES INTERFACE_LINK_LIBRARIES "${MPI_C_LIBRARIES}")
endif()
if (NOT TARGET MPI::MPI_CXX) # Create target "at hand" to ensure compatibility if cmake version < 3.9
add_library(MPI::MPI_CXX INTERFACE IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MPI_CXX_INCLUDE_DIRS}")
set_target_properties(MPI::MPI_CXX PROPERTIES INTERFACE_LINK_LIBRARIES "${MPI_CXX_LIBRARIES}")
endif()
endif()
get_target_property(MPI_Fortran_INCLUDE_DIRS MPI::MPI_Fortran INTERFACE_INCLUDE_DIRECTORIES) # Get variables from target (*.pc/cmake, msg).
get_target_property(MPI_Fortran_LIBRARIES MPI::MPI_Fortran INTERFACE_LINK_LIBRARIES) # Get variables from target (*.pc/cmake, msg).
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MPI_Fortran_COMPILE_FLAG}")
if(ICB)
get_target_property(MPI_C_INCLUDE_DIRS MPI::MPI_C INTERFACE_INCLUDE_DIRECTORIES) # Get variables from target (*.pc/cmake, msg).
get_target_property(MPI_C_LIBRARIES MPI::MPI_C INTERFACE_LINK_LIBRARIES) # Get variables from target (*.pc/cmake, msg).
get_target_property(MPI_CXX_INCLUDE_DIRS MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES) # Get variables from target (*.pc/cmake, msg).
get_target_property(MPI_CXX_LIBRARIES MPI::MPI_CXX INTERFACE_LINK_LIBRARIES) # Get variables from target (*.pc/cmake, msg).
include(CheckSymbolExists)
check_symbol_exists(MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" MPI_Comm_c2f_FOUND)
if(NOT ${MPI_Comm_c2f_FOUND})
message(FATAL_ERROR "symbol MPI_Comm_c2f does not exist")
endif()
endif()
endif()
if (NOT TARGET LAPACK::LAPACK) # Search only if not already found by upper CMakeLists.txt
find_package(LAPACK REQUIRED)
# LAPACK::LAPACK target was already created at this point by FindLAPACK.cmake if cmake version >= 3.18
if (NOT TARGET LAPACK::LAPACK) # Create target "at hand" to ensure compatibility if cmake version < 3.18
add_library(LAPACK::LAPACK INTERFACE IMPORTED)
set_target_properties(LAPACK::LAPACK PROPERTIES INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
endif()
endif()
get_target_property(LAPACK_LIBRARIES LAPACK::LAPACK INTERFACE_LINK_LIBRARIES) # Get variables from target (*.pc/cmake, msg).
if (MPI)
set(parpackutil_DIR ${arpack_SOURCE_DIR}/PARPACK/UTIL/)
set(parpacksrc_DIR ${arpack_SOURCE_DIR}/PARPACK/SRC/)
@@ -306,19 +389,38 @@ endif()
# use -DBUILD_SHARED_LIBS=ON|OFF to control static/shared
add_library(arpack ${arpackutil_STAT_SRCS} ${arpacksrc_STAT_SRCS} ${arpacksrc_ICB})
target_link_libraries(arpack BLAS::BLAS)
target_link_libraries(arpack LAPACK::LAPACK ${EXTRA_LDFLAGS})
set_target_properties(arpack PROPERTIES OUTPUT_NAME arpack${LIBSUFFIX})
target_link_libraries(arpack
PUBLIC
$<INSTALL_INTERFACE:$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,,LAPACK::LAPACK>>
$<INSTALL_INTERFACE:$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,,BLAS::BLAS>>
$<BUILD_INTERFACE:LAPACK::LAPACK>
$<BUILD_INTERFACE:BLAS::BLAS>
)
target_link_options(arpack PUBLIC "${EXTRA_LDFLAGS}")
set_target_properties(arpack PROPERTIES OUTPUT_NAME arpack${LIBSUFFIX}${ITF64SUFFIX})
set_target_properties(arpack PROPERTIES VERSION 2.1.0)
set_target_properties(arpack PROPERTIES SOVERSION 2)
target_include_directories(arpack
PUBLIC
# Exported location of headers
$<INSTALL_INTERFACE:${ARPACK_INSTALL_INCLUDEDIR}>
# Find arpackdef.h, arpackicb.h, stat*.h, debug*.h at build time
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
# For ICB interface
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/ICB>
)
if (MPI)
# use -DBUILD_SHARED_LIBS=ON|OFF to control static/shared
add_library(parpack ${parpacksrc_STAT_SRCS} ${parpackutil_STAT_SRCS} ${parpacksrc_ICB})
target_link_libraries(parpack MPI::MPI_Fortran)
target_link_libraries(parpack arpack)
set_target_properties(parpack PROPERTIES OUTPUT_NAME parpack${LIBSUFFIX})
target_link_libraries(parpack
PUBLIC
arpack
$<INSTALL_INTERFACE:$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,,MPI::MPI_Fortran>>
$<BUILD_INTERFACE:MPI::MPI_Fortran>
)
set_target_properties(parpack PROPERTIES OUTPUT_NAME parpack${LIBSUFFIX}${ITF64SUFFIX})
set_target_properties(parpack PROPERTIES VERSION 2.1.0)
set_target_properties(parpack PROPERTIES SOVERSION 2)
endif ()
@@ -327,13 +429,18 @@ set(PYINT "int32" CACHE STRING "int type to be used in python scripts") # PYINT
if (INTERFACE64)
set(PYINT "int64" CACHE STRING "int type to be used in python scripts") # PYINT : int used with python.
set(INTERFACE64 1)
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "LLVMFlang")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-integer-8")
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -i8")
else ()
message(WARNING "build script does not know how to make your Fortran compiler use 64-bit integers: set it manually via FFLAGS.")
endif ()
# TODO: this needs full re-write of parpack to support ILP64...
if (MPI)
message(FATAL_ERROR "Parallel arpack does not support ILP64.")
endif()
else ()
set(INTERFACE64 0)
endif ()
@@ -521,168 +628,203 @@ endif()
# TEST
############################
enable_testing()
function(add_test_with_rpath test_name)
# Add test which sets a current working directory that doesn't contain the
# libarpack library.
# Windows doesn't have a mechanism similar to RPATH on Linux or macOS.
# On Windows, if a test is running in a working directory that doesn't contain
# the ARPACK (and PARPACK) libraries, the path to these libraries has to be
# added to the PATH environment variable.
add_test(NAME ${test_name} ${ARGN})
if (WIN32 AND BUILD_SHARED_LIBS)
set_tests_properties(${test_name}
PROPERTIES
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:arpack>")
endif()
endfunction()
set(CMAKE_CTEST_COMMAND ctest -V)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/TESTS)
add_executable(dnsimp_test TESTS/dnsimp.f TESTS/mmio.f TESTS/debug.h)
set_target_properties( dnsimp_test PROPERTIES OUTPUT_NAME dnsimp )
target_link_libraries(dnsimp_test arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_custom_command(TARGET dnsimp_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/TESTS/testA.mtx testA.mtx
)
add_test(dnsimp_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dnsimp)
if (NOT ICB)
add_executable(bug_1315_single TESTS/bug_1315_single.c)
target_link_libraries(bug_1315_single arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(bug_1315_single_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_1315_single)
add_executable(bug_1315_double TESTS/bug_1315_double.c)
target_link_libraries(bug_1315_double arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(bug_1315_double_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_1315_double)
endif()
add_executable(bug_1323 TESTS/bug_1323.f)
target_link_libraries(bug_1323 arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(bug_1323_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_1323)
add_executable(bug_58_double TESTS/bug_58_double.f)
target_link_libraries(bug_58_double arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(bug_58_double_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_58_double)
add_executable(bug_79_double_complex TESTS/bug_79_double_complex.f)
target_link_libraries(bug_79_double_complex arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(bug_79_double_complex_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_79_double_complex)
add_executable(bug_142 TESTS/bug_142.f)
target_link_libraries(bug_142 arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(bug_142_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_142)
add_executable(bug_142_gen TESTS/bug_142_gen.f)
target_link_libraries(bug_142_gen arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(bug_142_gen_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_142_gen)
if(MPI)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/PARPACK/TESTS/MPI)
add_executable(issue46 PARPACK/TESTS/MPI/issue46.f)
target_link_libraries(issue46 parpack arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(issue46_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/issue46)
endif()
if(ICB)
function(build_tests)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/TESTS)
add_executable(icb_arpack_c TESTS/icb_arpack_c.c)
target_include_directories(icb_arpack_c PUBLIC ${PROJECT_SOURCE_DIR}/ICB) # Get arpack.h
target_link_libraries(icb_arpack_c arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(icb_arpack_c_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_arpack_c)
add_executable(dnsimp_test TESTS/dnsimp.f TESTS/mmio.f TESTS/debug.h)
set_target_properties( dnsimp_test PROPERTIES OUTPUT_NAME dnsimp )
target_link_libraries(dnsimp_test arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_custom_command(TARGET dnsimp_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/TESTS/testA.mtx testA.mtx
)
add_test(dnsimp_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dnsimp)
add_executable(icb_arpack_cpp TESTS/icb_arpack_cpp.cpp)
target_include_directories(icb_arpack_cpp PUBLIC ${PROJECT_SOURCE_DIR}/ICB) # Get arpack.hpp
target_link_libraries(icb_arpack_cpp arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(icb_arpack_cpp_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_arpack_cpp)
if (ICB)
add_executable(bug_1315_single TESTS/bug_1315_single.c)
target_include_directories(bug_1315_single PUBLIC ${PROJECT_SOURCE_DIR}/ICB) # Get arpack.h
target_link_libraries(bug_1315_single arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(bug_1315_single_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_1315_single)
if (ICBEXMM)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/EXAMPLES/MATRIX_MARKET)
add_executable(arpackmm EXAMPLES/MATRIX_MARKET/arpackmm.cpp)
target_include_directories(arpackmm PUBLIC ${PROJECT_SOURCE_DIR}/ICB ${EIGEN3_INCLUDE_DIR}) # Get arpack.h + eigen
target_link_libraries(arpackmm arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
configure_file(EXAMPLES/MATRIX_MARKET/As.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/As.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/An.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/An.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/Az.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Az.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/B.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/B.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/Bz.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Bz.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/arpackmm.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/arpackmm.sh)
add_test(NAME arpackmm_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${BASH_PROGRAM} arpackmm.sh)
add_executable(bug_1315_double TESTS/bug_1315_double.c)
target_include_directories(bug_1315_double PUBLIC ${PROJECT_SOURCE_DIR}/ICB) # Get arpack.h
target_link_libraries(bug_1315_double arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(bug_1315_double_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_1315_double)
endif()
if (PYTHON3)
python_add_module(pyarpack ${arpackutil_STAT_SRCS} ${arpacksrc_STAT_SRCS} ${arpacksrc_ICB} ${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpack.cpp)
target_compile_definitions(pyarpack PRIVATE PY_MAJOR_VERSION="3")
set(pyarpack_HDR ${PROJECT_SOURCE_DIR}/ICB ${PROJECT_SOURCE_DIR}/EXAMPLES/MATRIX_MARKET ${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK)
target_include_directories(pyarpack PUBLIC ${pyarpack_HDR} ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
target_link_libraries(pyarpack BLAS::BLAS LAPACK::LAPACK ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
install(TARGETS pyarpack
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/pyarpack
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/pyarpack)
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseBiCGDiag.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseBiCGDiag.py" @ONLY)
add_test(NAME pyarpackSparseBiCGDiag_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseBiCGDiag.py)
set_tests_properties(pyarpackSparseBiCGDiag_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseBiCGILU.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseBiCGILU.py" @ONLY)
add_test(NAME pyarpackSparseBiCGILU_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseBiCGILU.py)
set_tests_properties(pyarpackSparseBiCGILU_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseCGDiag.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseCGDiag.py" @ONLY)
add_test(NAME pyarpackSparseCGDiag_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseCGDiag.py)
set_tests_properties(pyarpackSparseCGDiag_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseCGILU.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseCGILU.py" @ONLY)
add_test(NAME pyarpackSparseCGILU_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseCGILU.py)
set_tests_properties(pyarpackSparseCGILU_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseLLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseLLT.py" @ONLY)
add_test(NAME pyarpackSparseLLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseLLT.py)
set_tests_properties(pyarpackSparseLLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseLDLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseLDLT.py" @ONLY)
add_test(NAME pyarpackSparseLDLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseLDLT.py)
set_tests_properties(pyarpackSparseLDLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseLU.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseLU.py" @ONLY)
add_test(NAME pyarpackSparseLU_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseLU.py)
set_tests_properties(pyarpackSparseLU_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseQR.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseQR.py" @ONLY)
add_test(NAME pyarpackSparseQR_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseQR.py)
set_tests_properties(pyarpackSparseQR_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLLT.py" @ONLY)
add_test(NAME pyarpackDenseLLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLLT.py)
set_tests_properties(pyarpackDenseLLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLDLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLDLT.py" @ONLY)
add_test(NAME pyarpackDenseLDLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLDLT.py)
set_tests_properties(pyarpackDenseLDLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLURR.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLURR.py" @ONLY)
add_test(NAME pyarpackDenseLURR_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLURR.py)
set_tests_properties(pyarpackDenseLURR_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseQRRR.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseQRRR.py" @ONLY)
add_test(NAME pyarpackDenseQRRR_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseQRRR.py)
set_tests_properties(pyarpackDenseQRRR_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLUPP.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLUPP.py" @ONLY)
add_test(NAME pyarpackDenseLUPP_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLUPP.py)
set_tests_properties(pyarpackDenseLUPP_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseQRPP.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseQRPP.py" @ONLY)
add_test(NAME pyarpackDenseQRPP_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseQRPP.py)
set_tests_properties(pyarpackDenseQRPP_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackRestart.py.in" "${CMAKE_BINARY_DIR}/pyarpackRestart.py" @ONLY)
add_test(NAME pyarpackRestart_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackRestart.py)
set_tests_properties(pyarpackRestart_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
endif()
add_executable(bug_1323 TESTS/bug_1323.f)
target_link_libraries(bug_1323 arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(bug_1323_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_1323)
if (MPI)
add_executable(bug_58_double TESTS/bug_58_double.f)
target_link_libraries(bug_58_double arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(bug_58_double_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_58_double)
add_executable(bug_79_double_complex TESTS/bug_79_double_complex.f)
target_link_libraries(bug_79_double_complex arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(bug_79_double_complex_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_79_double_complex)
add_executable(bug_142 TESTS/bug_142.f)
target_link_libraries(bug_142 arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(bug_142_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_142)
add_executable(bug_142_gen TESTS/bug_142_gen.f)
target_link_libraries(bug_142_gen arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(bug_142_gen_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bug_142_gen)
if(MPI)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/PARPACK/TESTS/MPI)
add_executable(icb_parpack_c PARPACK/TESTS/MPI/icb_parpack_c.c)
target_include_directories(icb_parpack_c PUBLIC ${PROJECT_SOURCE_DIR}/ICB MPI::MPI_C) # Get parpack.h mpi.h
target_link_libraries(icb_parpack_c parpack arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS} MPI::MPI_C)
add_test(icb_parpack_c_tst mpirun -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_c)
add_executable(icb_parpack_cpp PARPACK/TESTS/MPI/icb_parpack_cpp.cpp)
target_include_directories(icb_parpack_cpp PUBLIC ${PROJECT_SOURCE_DIR}/ICB MPI::MPI_CXX) # Get parpack.hpp mpi.h
target_link_libraries(icb_parpack_cpp parpack arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS} MPI::MPI_CXX)
add_test(icb_parpack_cpp_tst mpirun -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_cpp)
add_executable(issue46 PARPACK/TESTS/MPI/issue46.f)
target_link_libraries(issue46 parpack arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(issue46_tst mpiexec -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/issue46)
endif()
if(ICB)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/TESTS)
add_executable(icb_arpack_c TESTS/icb_arpack_c.c)
target_include_directories(icb_arpack_c PUBLIC ${PROJECT_SOURCE_DIR}/ICB) # Get arpack.h
target_link_libraries(icb_arpack_c arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(icb_arpack_c_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_arpack_c)
add_executable(icb_arpack_cpp TESTS/icb_arpack_cpp.cpp)
target_include_directories(icb_arpack_cpp PUBLIC ${PROJECT_SOURCE_DIR}/ICB) # Get arpack.hpp
target_link_libraries(icb_arpack_cpp arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
add_test(icb_arpack_cpp_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_arpack_cpp)
if (EIGEN)
find_program (BASH_PROGRAM bash)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/EXAMPLES/MATRIX_MARKET)
add_executable(arpackmm EXAMPLES/MATRIX_MARKET/arpackmm.cpp)
target_include_directories(arpackmm PUBLIC ${PROJECT_SOURCE_DIR}/ICB ${EIGEN3_INCLUDE_DIR}) # Get arpack.h + eigen
target_link_libraries(arpackmm arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS})
configure_file(EXAMPLES/MATRIX_MARKET/As.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/As.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/An.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/An.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/Az.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Az.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/B.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/B.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/Bz.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Bz.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/arpackmm.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/arpackmm.sh)
add_test_with_rpath(arpackmm_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${BASH_PROGRAM} arpackmm.sh)
configure_file(EXAMPLES/MATRIX_MARKET/issue401.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/issue401.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/issue401.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/issue401.sh)
add_test_with_rpath(issue401_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${BASH_PROGRAM} issue401.sh)
configure_file(EXAMPLES/MATRIX_MARKET/issue215.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/issue215.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/issue215.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/issue215.sh)
add_test_with_rpath(issue215_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${BASH_PROGRAM} issue215.sh)
endif()
if (PYTHON3)
python_add_module(pyarpack ${arpackutil_STAT_SRCS} ${arpacksrc_STAT_SRCS} ${arpacksrc_ICB} ${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpack.cpp)
target_include_directories(pyarpack
PRIVATE
${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/ICB
${PROJECT_SOURCE_DIR}/EXAMPLES/MATRIX_MARKET
${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK
${EIGEN3_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS})
target_link_libraries(pyarpack
${LAPACK_BLAS_LIBS} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
install(TARGETS pyarpack
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/pyarpack
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/pyarpack)
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseBiCGDiag.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseBiCGDiag.py" @ONLY)
add_test(NAME pyarpackSparseBiCGDiag_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseBiCGDiag.py)
set_tests_properties(pyarpackSparseBiCGDiag_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseBiCGILU.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseBiCGILU.py" @ONLY)
add_test(NAME pyarpackSparseBiCGILU_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseBiCGILU.py)
set_tests_properties(pyarpackSparseBiCGILU_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseCGDiag.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseCGDiag.py" @ONLY)
add_test(NAME pyarpackSparseCGDiag_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseCGDiag.py)
set_tests_properties(pyarpackSparseCGDiag_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseCGILU.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseCGILU.py" @ONLY)
add_test(NAME pyarpackSparseCGILU_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseCGILU.py)
set_tests_properties(pyarpackSparseCGILU_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseLLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseLLT.py" @ONLY)
add_test(NAME pyarpackSparseLLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseLLT.py)
set_tests_properties(pyarpackSparseLLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseLDLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseLDLT.py" @ONLY)
add_test(NAME pyarpackSparseLDLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseLDLT.py)
set_tests_properties(pyarpackSparseLDLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseLU.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseLU.py" @ONLY)
add_test(NAME pyarpackSparseLU_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseLU.py)
set_tests_properties(pyarpackSparseLU_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseQR.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseQR.py" @ONLY)
add_test(NAME pyarpackSparseQR_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseQR.py)
set_tests_properties(pyarpackSparseQR_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLLT.py" @ONLY)
add_test(NAME pyarpackDenseLLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLLT.py)
set_tests_properties(pyarpackDenseLLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLDLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLDLT.py" @ONLY)
add_test(NAME pyarpackDenseLDLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLDLT.py)
set_tests_properties(pyarpackDenseLDLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLURR.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLURR.py" @ONLY)
add_test(NAME pyarpackDenseLURR_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLURR.py)
set_tests_properties(pyarpackDenseLURR_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseQRRR.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseQRRR.py" @ONLY)
add_test(NAME pyarpackDenseQRRR_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseQRRR.py)
set_tests_properties(pyarpackDenseQRRR_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLUPP.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLUPP.py" @ONLY)
add_test(NAME pyarpackDenseLUPP_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLUPP.py)
set_tests_properties(pyarpackDenseLUPP_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseQRPP.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseQRPP.py" @ONLY)
add_test(NAME pyarpackDenseQRPP_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseQRPP.py)
set_tests_properties(pyarpackDenseQRPP_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackRestart.py.in" "${CMAKE_BINARY_DIR}/pyarpackRestart.py" @ONLY)
add_test(NAME pyarpackRestart_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackRestart.py)
set_tests_properties(pyarpackRestart_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
endif()
if (MPI)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/PARPACK/TESTS/MPI)
add_executable(icb_parpack_c PARPACK/TESTS/MPI/icb_parpack_c.c)
target_include_directories(icb_parpack_c PUBLIC ${PROJECT_SOURCE_DIR}/ICB MPI::MPI_C) # Get parpack.h mpi.h
target_link_libraries(icb_parpack_c parpack arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS} MPI::MPI_C)
add_test(icb_parpack_c_tst mpiexec -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_c)
add_executable(icb_parpack_cpp PARPACK/TESTS/MPI/icb_parpack_cpp.cpp)
target_include_directories(icb_parpack_cpp PUBLIC ${PROJECT_SOURCE_DIR}/ICB MPI::MPI_CXX) # Get parpack.hpp mpi.h
target_link_libraries(icb_parpack_cpp parpack arpack ${LAPACK_BLAS_LIBS} ${EXTRA_LDFLAGS} MPI::MPI_CXX)
add_test(icb_parpack_cpp_tst mpiexec -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_cpp)
endif()
endif()
endfunction(build_tests)
if(TESTS)
enable_testing()
set(CMAKE_CTEST_COMMAND ctest -V)
build_tests()
endif()
############################
# install
############################
# 'make install' to the correct location
include(GNUInstallDirs)
# Convert variable names to those expected by the .pc file.
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix \${prefix})
set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(PACKAGE_NAME ${PROJECT_NAME})
set(PACKAGE_VERSION ${arpack_ng_VERSION})
set(PACKAGE_URL "https://github.com/opencollab/arpack-ng/")
@@ -692,7 +834,7 @@ set(PACKAGE_URL "https://github.com/opencollab/arpack-ng/")
set(ARPACK_PC_LIBS_PRIVATE)
foreach(lib ${LAPACK_LIBRARIES})
get_filename_component(libname ${lib} NAME)
string(REGEX REPLACE "^lib([^.]+).*$" "-l\\1" libname ${libname})
string(REGEX REPLACE "^(lib)?([^.]+).*$" "-l\\2" libname ${libname})
list(APPEND ARPACK_PC_LIBS_PRIVATE "${libname}")
endforeach()
string(REPLACE ";" " " ARPACK_PC_LIBS_PRIVATE "${ARPACK_PC_LIBS_PRIVATE}")
@@ -700,68 +842,79 @@ string(REPLACE ";" " " ARPACK_PC_LIBS_PRIVATE "${ARPACK_PC_LIBS_PRIVATE}")
set(PARPACK_PC_LIBS_PRIVATE)
foreach(lib ${LAPACK_LIBRARIES} ${MPI_Fortran_LIBRARIES})
get_filename_component(libname ${lib} NAME)
string(REGEX REPLACE "^lib([^.]+).*$" "-l\\1" libname ${libname})
string(REGEX REPLACE "^(lib)?([^.]+).*$" "-l\\2" libname ${libname})
list(APPEND PARPACK_PC_LIBS_PRIVATE "${libname}")
endforeach()
string(REPLACE ";" " " PARPACK_PC_LIBS_PRIVATE "${PARPACK_PC_LIBS_PRIVATE}")
configure_file(SRC/arpack.pc.in "${PROJECT_BINARY_DIR}/SRC/arpack${LIBSUFFIX}.pc" @ONLY)
configure_file(PARPACK/SRC/MPI/parpack.pc.in "${PROJECT_BINARY_DIR}/PARPACK/SRC/MPI/parpack${LIBSUFFIX}.pc" @ONLY)
configure_file(EXAMPLES/MATRIX_MARKET/arpackSolver.pc.in "${PROJECT_BINARY_DIR}/EXAMPLES/MATRIX_MARKET/arpackSolver.pc" @ONLY)
configure_file(SRC/arpack.pc.in "${PROJECT_BINARY_DIR}/SRC/arpack${LIBSUFFIX}${ITF64SUFFIX}.pc" @ONLY)
configure_file(PARPACK/SRC/MPI/parpack.pc.in "${PROJECT_BINARY_DIR}/PARPACK/SRC/MPI/parpack${LIBSUFFIX}${ITF64SUFFIX}.pc" @ONLY)
install(TARGETS arpack
EXPORT arpackngTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES "${PROJECT_BINARY_DIR}/SRC/arpack${LIBSUFFIX}.pc"
install(FILES "${PROJECT_BINARY_DIR}/SRC/arpack${LIBSUFFIX}${ITF64SUFFIX}.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if (MPI)
install(TARGETS parpack
EXPORT arpackngTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES "${PROJECT_BINARY_DIR}/PARPACK/SRC/MPI/parpack${LIBSUFFIX}.pc"
install(FILES "${PROJECT_BINARY_DIR}/PARPACK/SRC/MPI/parpack${LIBSUFFIX}${ITF64SUFFIX}.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif ()
if(ICB)
install(FILES ICB/arpack.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES ICB/arpack.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES ICB/arpack.h DESTINATION "${ARPACK_INSTALL_INCLUDEDIR}")
install(FILES ICB/arpack.hpp DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
if (MPI)
install(FILES ICB/parpack.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES ICB/parpack.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES ICB/parpack.h DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
install(FILES ICB/parpack.hpp DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
endif()
if (ICBEXMM)
install(FILES EXAMPLES/MATRIX_MARKET/arpackSolver.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES "${PROJECT_BINARY_DIR}/EXAMPLES/MATRIX_MARKET/arpackSolver.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if (EIGEN)
install(FILES EXAMPLES/MATRIX_MARKET/arpackSolver.hpp DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
endif()
endif()
install(FILES debug.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES debug.h DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
install(FILES debugF90.h DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
if(ICB)
install(FILES ICB/debug_c.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES ICB/debug_c.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES ICB/debug_c.h DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
install(FILES ICB/debug_c.hpp DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
endif()
install(FILES stat.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES stat.h DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
install(FILES statF90.h DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
if(ICB)
install(FILES ICB/stat_c.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES ICB/stat_c.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES ICB/stat_c.h DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
install(FILES ICB/stat_c.hpp DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
endif()
configure_file(arpackdef.h.in "${PROJECT_BINARY_DIR}/arpackdef.h" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/arpackdef.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
install(FILES "${PROJECT_BINARY_DIR}/arpackdef.h" DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
configure_file(arpackicb.h.in "${PROJECT_BINARY_DIR}/arpackicb.h" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/arpackicb.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arpack)
if(ICB)
configure_file(arpackicb.h.in "${PROJECT_BINARY_DIR}/arpackicb.h" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/arpackicb.h" DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
endif()
install(EXPORT arpackngTargets
DESTINATION "${ARPACK_INSTALL_CMAKEDIR}"
)
# Provide find_package for arpack-ng to users.
configure_file(arpack-ng-config.cmake.in "${PROJECT_BINARY_DIR}/arpack-ng-config.cmake" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/arpack-ng-config.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/arpack-ng) # find_package(arpack-ng)
configure_file(arpack-ng-config-version.cmake.in "${PROJECT_BINARY_DIR}/arpack-ng-config-version.cmake" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/arpack-ng-config-version.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/arpack-ng)
configure_file(cmake/arpackng-config.cmake.in "${PROJECT_BINARY_DIR}/arpackng-config.cmake" @ONLY)
configure_file(cmake/arpackng-config-version.cmake.in "${PROJECT_BINARY_DIR}/arpackng-config-version.cmake" @ONLY)
install(
FILES
"${PROJECT_BINARY_DIR}/arpackng-config.cmake"
"${PROJECT_BINARY_DIR}/arpackng-config-version.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/arpackng${LIBSUFFIX}${ITF64SUFFIX}) # find_package(arpackng)
configure_file(cmake/tstCMakeInstall.sh.in ${PROJECT_BINARY_DIR}/tstCMakeInstall.sh @ONLY)
# Packaging: ease arpack-ng distribution (precompiled binaries and sources tarballs).
set(CPACK_VERSION_MAJOR "${arpack_ng_MAJOR_VERSION}")
@@ -771,38 +924,6 @@ set(CPACK_SOURCE_IGNORE_FILES "/BUILD/" "/Build/" "/build/" "/local/") # Do not
set(CPACK_SOURCE_PACKAGE_FILE_NAME "arpack-ng-${CPACK_VERSION_MAJOR}.${CPACK_VERSION_MINOR}.${CPACK_VERSION_PATCH}")
include(CPack)
if (COVERALLS)
set(arpack_TST_SRC
${arpack_SOURCE_DIR}/TESTS/bug_1323.f
${arpack_SOURCE_DIR}/TESTS/bug_142.f
${arpack_SOURCE_DIR}/TESTS/bug_142_gen.f
${arpack_SOURCE_DIR}/TESTS/bug_58_double.f
${arpack_SOURCE_DIR}/TESTS/bug_79_double_complex.f
${arpack_SOURCE_DIR}/TESTS/dnsimp.f
${arpack_SOURCE_DIR}/TESTS/mmio.f
${arpack_SOURCE_DIR}/TESTS/bug_1315_single.c
${arpack_SOURCE_DIR}/TESTS/bug_1315_double.c
${arpack_SOURCE_DIR}/TESTS/icb_arpack_c.c
${arpack_SOURCE_DIR}/TESTS/icb_arpack_cpp.cpp
)
file(GLOB_RECURSE arpack_EX_F_SRC "${arpack_SOURCE_DIR}/EXAMPLES/*/*.f")
set(arpack_EX_CPP_SRC ${arpack_SOURCE_DIR}/EXAMPLES/MATRIX_MARKET/arpackmm.cpp)
set(parpack_TST_SRC
${arpack_SOURCE_DIR}/PARPACK/TESTS/MPI/issue46.f
${arpack_SOURCE_DIR}/PARPACK/TESTS/MPI/icb_parpack_c.c
${arpack_SOURCE_DIR}/PARPACK/TESTS/MPI/icb_parpack_cpp.cpp
)
file(GLOB_RECURSE parpack_EX_F_SRC "${arpack_SOURCE_DIR}/PARPACK/EXAMPLES/MPI/*.f")
# Create the coveralls target.
# Also lists the c/cpp files for test purposes
coveralls_setup(
"${arpacksrc_STAT_SRCS} ${arpackutil_STAT_SRCS} ${arpacksrc_ICB} ${arpack_TST_SRC} ${arpack_EX_F_SRC} ${arpack_EX_CPP_SRC} ${parpacksrc_STAT_SRCS} ${parpackutil_STAT_SRCS} ${parpacksrc_ICB} ${parpack_TST_SRC} ${parpack_EX_F_SRC}" # The source files.
ON # If we should upload.
"${PROJECT_SOURCE_DIR}/cmake/") # (Optional) Alternate project cmake module path.
endif()
function(libsummary title include libraries)
message(" -- ${title}:")
foreach(inc ${include})
@@ -831,7 +952,7 @@ endfunction(cprsummary)
message("-- Configuration summary for arpack-ng-${arpack_ng_VERSION}:")
message(" -- prefix: ${CMAKE_INSTALL_PREFIX}")
message(" -- MPI: ${MPI}")
message(" -- MPI: ${MPI} (ICB provided ${HAVE_MPI_ICB})")
message(" -- ICB: ${ICB}")
message(" -- INTERFACE64: ${INTERFACE64}")
cprsummary("FC" "${CMAKE_Fortran_COMPILER}"
@@ -863,7 +984,7 @@ if (MPI)
endif()
libsummary("BLAS" "" "${BLAS_LIBRARIES}")
libsummary("LAPACK" "" "${LAPACK_LIBRARIES}")
if (ICBEXMM)
if (EIGEN)
libsummary("EIGEN3" "${EIGEN3_INCLUDE_DIR}" "")
endif()
if (PYTHON3)
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SSBDR = ssbdr1 ssbdr2 ssbdr3 ssbdr4 ssbdr5 ssbdr6
DSBDR = dsbdr1 dsbdr2 dsbdr3 dsbdr4 dsbdr5 dsbdr6
+1
View File
@@ -206,6 +206,7 @@ c
idiag = kl+ku+1
do 30 j = 1, n
a(idiag,j) = (4.0E+0, 0.0E+0) / h2
m(idiag,j) = (1.0E+0, 0.0E+0)
30 continue
c
c %-------------------------------------%
+1
View File
@@ -206,6 +206,7 @@ c
idiag = kl+ku+1
do 30 j = 1, n
a(idiag,j) = (4.0D+0, 0.0D+0) / h2
m(idiag,j) = (1.0D+0, 0.0D+0)
30 continue
c
c %-------------------------------------%
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
CNDRV = cndrv1 cndrv2 cndrv3 cndrv4
ZNDRV = zndrv1 zndrv2 zndrv3 zndrv4
+6 -8
View File
@@ -1,20 +1,18 @@
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX)$(ITF64SUFFIX).la
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)/ICB $(EIGEN3_CFLAGS)
pkgincludedir = $(includedir)/arpack
EXTRA_DIST = README
check_PROGRAMS = arpackmm
dist_check_SCRIPTS = arpackmm.sh
dist_check_DATA = An.mtx As.mtx Az.mtx B.mtx Bz.mtx
TESTS = arpackmm.sh
dist_check_SCRIPTS = arpackmm.sh issue401.sh issue215.sh
dist_check_DATA = An.mtx As.mtx Az.mtx B.mtx Bz.mtx issue401.mtx issue215.mtx
TESTS = arpackmm.sh issue401.sh issue215.sh
arpackmm_SOURCES = arpackmm.cpp
if ICBEXMM
pkgincludedir = $(includedir)/arpack@ITF64SUFFIX@
if EIGEN
pkginclude_HEADERS = arpackSolver.hpp
pkgconfig_DATA = arpackSolver.pc
endif
CLEANFILES = \
+2 -2
View File
@@ -34,6 +34,6 @@ To build this utility, you need:
- to have installed eigen3 (to deal with the RCI).
- to configure arpack-ng this way:
- autotools:
~arpack-ng> ./configure --enable-icb-exmm; make all check
~arpack-ng> ./configure --enable-eigen; make all check
- cmake:
~arpack-ng/build> cmake -D ICBEXMM=ON ..; make all test
~arpack-ng/build> cmake -D EIGEN=ON ..; make all test
+144 -76
View File
@@ -12,6 +12,9 @@
#include <cassert>
#include <vector>
#include <type_traits> // is_same.
#include <cmath> // abs
#include <complex>
#include <limits> // epsilon
#include <Eigen/Sparse>
#include <Eigen/IterativeLinearSolvers>
@@ -173,6 +176,7 @@ class arpackSolver {
int createMatrix(string const & fileName, Eigen::SparseMatrix<RC> & M) {
// Read matrix from file.
if (fileName.empty()) { cerr << "Error: matrix file missing" << endl; return 1; }
a_uint n = 0, m = 0;
vector<a_uint> i, j;
vector<RC> Mij;
@@ -229,6 +233,7 @@ class arpackSolver {
int solve(EM & A, EM const * B = nullptr) {
stdPb = !B ? true : false;
if (nbCV > A.cols()) nbCV = A.cols(); // Cut-off arpack workspace dim.
dumpParameters();
if (verbose == 3) {
@@ -244,14 +249,15 @@ class arpackSolver {
// If needed, transform the initial problem into a new one that arpack can handle.
auto eps = numeric_limits<double>::epsilon();
auto eps = numeric_limits<FD>::epsilon();
bool shiftReal = (fabs(sigmaReal) > eps) ? true : false;
bool shiftImag = (fabs(sigmaImag) > eps) ? true : false;
bool backTransform = false;
mode = 0;
if (stdPb) {
mode = 1;
if (shiftReal && !shiftImag) {
// CAUTION: back transform must be done only if mode = 1.
if (shiftReal || shiftImag) {
EM I(A.rows(), A.cols());
I.setIdentity();
RC sigma; makeSigma(sigma);
@@ -260,6 +266,7 @@ class arpackSolver {
}
}
else {
// CAUTION: back transform must NOT be done if mode > 1.
mode = 2;
if (shiftReal || shiftImag) mode = 3;
}
@@ -290,10 +297,7 @@ class arpackSolver {
return 0;
};
int checkEigVec(EM const & A, EM const * B = nullptr, double const * diffTol = nullptr) {
stdPb = !B ? true : false;
double dTol = !diffTol ? sqrt(tol) : *diffTol;
int checkEigVec(EM const & A, EM const * B = nullptr, double const maxResNorm = 1.e-3) const {
// Check eigen vectors.
string rs = schur ? "Schur" : "Ritz";
@@ -315,26 +319,18 @@ class arpackSolver {
}
}
EigVecZ left = A.template cast<complex<double>>() * V;
EigVecZ right = stdPb ? V : B->template cast<complex<double>>() * V;
right *= lambda;
EigVecZ diff = left - right;
if (diff.norm() > dTol) {
cerr << endl << "Error: bad vector " << setw(3) << i << " (norm " << V.norm() << "):" << endl;
cerr << endl << V << endl;
cerr << endl << "Error: left side (A*V - norm " << left.norm() << "):" << endl;
cerr << endl << left << endl;
cerr << endl << "Error: right side (lambda*" << (stdPb ? "" : "B*") << "V - norm " << right.norm() << "):" << endl;
cerr << endl << right << endl;
cerr << endl << "Error: diff (norm " << diff.norm() << ", tol " << dTol << "):" << endl;
cerr << endl << diff << endl;
double resNorm = computeResidualNorm(i, A, B);
if (resNorm > maxResNorm) {
cout << endl << "arpackSolver:" << endl;
cout << endl << rs << " value/vector " << setw(3) << i << ": check KO";
cout << ", residual (norm " << resNorm << ", maxResNorm " << maxResNorm << ")" << endl;
return 1;
}
else {
if (verbose >= 1) {
cout << endl << "arpackSolver:" << endl;
cout << endl << rs << " value/vector " << setw(3) << i << ": check OK";
cout << ", diff (norm " << diff.norm() << ", tol " << dTol << ")" << endl;
cout << ", residual (norm " << resNorm << ", maxResNorm " << maxResNorm << ")" << endl;
}
}
}
@@ -342,17 +338,33 @@ class arpackSolver {
return 0;
};
double computeResidualNorm(size_t const & idx, EM const & A, EM const * B = nullptr) const {
// Check eigen value index.
if (idx >= val.size()) return -1.; // Error.
if (idx >= vec.size()) return -1.; // Error.
// Compute residual norm.
EigVecZ V = vec[idx];
complex<double> lambda = val[idx];
EigVecZ left = A.template cast<complex<double>>() * V;
EigVecZ right = stdPb ? V : B->template cast<complex<double>>() * V;
right *= lambda;
EigVecZ residual = left - right;
return residual.norm();
};
// Private methods.
private:
void makeZero( float & zero) {zero = 0.f;};
void makeConstant( float & cst, float const & val) {cst = val;};
void makeZero( double & zero) {zero = 0.;};
void makeConstant( double & cst, double const & val) {cst = val;};
void makeZero(complex< float> & zero) {zero = complex<double>(0.f, 0.f);};
void makeConstant(complex< float> & cst, float const & val) {cst = complex<float>(val, val);};
void makeZero(complex<double> & zero) {zero = complex<double>(0., 0.);};
void makeConstant(complex<double> & cst, double const & val) {cst = complex<double>(val, val);};
int readMatrixMarket(string const & fileName,
a_uint & n, a_uint & m, vector<a_uint> & i, vector<a_uint> & j, vector<RC> & Mij) {
@@ -368,7 +380,7 @@ class arpackSolver {
string inpLine; getline(inp, inpLine); l++;
while (isspace(*inpLine.begin())) inpLine.erase(inpLine.begin()); // Suppress leading white spaces.
if (inpLine.length() == 0) continue; // Empty line.
if (inpLine[0] == '%') continue; // Comments skipped, begin reading.
if (inpLine[0] == '%' || inpLine[0] == '#') continue; // Comments skipped, begin reading.
// Read matrix market file.
@@ -378,7 +390,13 @@ class arpackSolver {
if (!inpSS) {cerr << "Error: bad header (n, m)" << endl; return 1;}
if (nnz == 0) {
inpSS >> nnz;
if (inpSS) { // OK, (optional) nnz has been provided.
if (inpSS && nnz > 0) { // OK, (optional) nnz has been provided.
i.reserve(nnz);
j.reserve(nnz);
Mij.reserve(nnz);
}
else {
nnz = n*m;
i.reserve(nnz);
j.reserve(nnz);
Mij.reserve(nnz);
@@ -387,7 +405,7 @@ class arpackSolver {
}
else { // Body.
a_uint k = 0, l = 0;
RC zero; makeZero(zero);
RC zero; makeConstant(zero, 0.);
RC Mkl = zero;
inpSS >> k >> l >> Mkl;
if (!inpSS) {cerr << "Error: bad line (" << fileName << ", line " << l << ")" << endl; return 1;}
@@ -400,10 +418,20 @@ class arpackSolver {
// Handle 1-based -> 0-based.
nnz = i.size(); // In case nnz was not provided.
if (*max_element(begin(i), end(i)) == n || *max_element(begin(j), end(j)) == m) {
for (size_t k = 0; k < nnz; k++) i[k] -= 1;
for (size_t k = 0; k < nnz; k++) j[k] -= 1;
if (!i.empty() && !j.empty()) {
if (*max_element(begin(i), end(i)) == n && *max_element(begin(j), end(j)) == m) {
for (size_t k = 0; k < i.size(); k++) { if (i[k] > 0) i[k] -= 1; }
for (size_t k = 0; k < j.size(); k++) { if (j[k] > 0) j[k] -= 1; }
}
}
// Checking indices.
for (size_t k = 0; k < i.size(); k++) {
if (i[k] >= n) {cerr << "Error: bad index (" << fileName << ", i " << i[k] << ")" << endl; return 1;};
}
for (size_t k = 0; k < j.size(); k++) {
if (j[k] >= m) {cerr << "Error: bad index (" << fileName << ", j " << j[k] << ")" << endl; return 1;};
}
return 0;
@@ -437,18 +465,18 @@ class arpackSolver {
a_int ldv, a_int * iparam, a_int * ipntr, complex<float> * workd, complex<float> * workl, a_int lworkl, float * & rwork,
a_int * info) {
if (!rwork) rwork = new float[nbCV];
cnaupd_c(ido, bMat, nbDim, which, nbEV, tol, reinterpret_cast<_Complex float*>(resid), nbCV,
reinterpret_cast<_Complex float*>(v), ldv, iparam, ipntr, reinterpret_cast<_Complex float*>(workd),
reinterpret_cast<_Complex float*>(workl), lworkl, rwork, info);
cnaupd_c(ido, bMat, nbDim, which, nbEV, tol, reinterpret_cast<a_fcomplex*>(resid), nbCV,
reinterpret_cast<a_fcomplex*>(v), ldv, iparam, ipntr, reinterpret_cast<a_fcomplex*>(workd),
reinterpret_cast<a_fcomplex*>(workl), lworkl, rwork, info);
};
void aupd(a_int * ido, char const * bMat, a_int nbDim, char const * which, complex<double> * resid, complex<double> * v,
a_int ldv, a_int * iparam, a_int * ipntr, complex<double> * workd, complex<double> * workl, a_int lworkl, double * & rwork,
a_int * info) {
if (!rwork) rwork = new double[nbCV];
znaupd_c(ido, bMat, nbDim, which, nbEV, tol, reinterpret_cast<_Complex double*>(resid), nbCV,
reinterpret_cast<_Complex double*>(v), ldv, iparam, ipntr, reinterpret_cast<_Complex double*>(workd),
reinterpret_cast<_Complex double*>(workl), lworkl, rwork, info);
znaupd_c(ido, bMat, nbDim, which, nbEV, tol, reinterpret_cast<a_dcomplex*>(resid), nbCV,
reinterpret_cast<a_dcomplex*>(v), ldv, iparam, ipntr, reinterpret_cast<a_dcomplex*>(workd),
reinterpret_cast<a_dcomplex*>(workl), lworkl, rwork, info);
};
void spectrum(RC * d, RC * z, a_int nbDim, a_int * iparam) {
@@ -517,8 +545,8 @@ class arpackSolver {
sseupd_c(rvec, howmny, select, d, z, ldz, sigmaReal,
bMat, nbDim, which, nbEV, tol, resid, nbCV, v, ldv, iparam, ipntr, workd, workl, lworkl, &info);
if (info == -14) cerr << "Error: dseupd - KO: dsaupd did not find any eigenvalues to sufficient accuracy" << endl;
if (info < 0 && info != -14 /*-14: don't break*/) {cerr << "Error: dseupd - KO with info " << info << endl; return 1;}
if (info == -14) cerr << "Error: sseupd - KO: ssaupd did not find any eigenvalues to sufficient accuracy" << endl;
if (info < 0 && info != -14 /*-14: don't break*/) {cerr << "Error: sseupd - KO with info " << info << endl; return 1;}
spectrum(d, z, nbDim, iparam);
@@ -531,8 +559,8 @@ class arpackSolver {
sneupd_c(rvec, howmny, select, dr, di, z, ldz, sigmaReal, sigmaImag, workev,
bMat, nbDim, which, nbEV, tol, resid, nbCV, v, ldv, iparam, ipntr, workd, workl, lworkl, &info);
if (info == -14) cerr << "Error: dneupd - KO: [dz]naupd did not find any eigenvalues to sufficient accuracy" << endl;
if (info < 0 && info != -14 /*-14: don't break*/) {cerr << "Error: dneupd - KO with info " << info << endl; return 1;}
if (info == -14) cerr << "Error: sneupd - KO: snaupd did not find any eigenvalues to sufficient accuracy" << endl;
if (info < 0 && info != -14 /*-14: don't break*/) {cerr << "Error: sneupd - KO with info " << info << endl; return 1;}
halfSpectrum(dr, di, z, nbDim, iparam);
@@ -568,7 +596,7 @@ class arpackSolver {
dneupd_c(rvec, howmny, select, dr, di, z, ldz, sigmaReal, sigmaImag, workev,
bMat, nbDim, which, nbEV, tol, resid, nbCV, v, ldv, iparam, ipntr, workd, workl, lworkl, &info);
if (info == -14) cerr << "Error: dneupd - KO: [dz]naupd did not find any eigenvalues to sufficient accuracy" << endl;
if (info == -14) cerr << "Error: dneupd - KO: dnaupd did not find any eigenvalues to sufficient accuracy" << endl;
if (info < 0 && info != -14 /*-14: don't break*/) {cerr << "Error: dneupd - KO with info " << info << endl; return 1;}
halfSpectrum(dr, di, z, nbDim, iparam);
@@ -589,13 +617,13 @@ class arpackSolver {
complex<float> * workev = new complex<float>[2*nbCV];
complex<float> sigma = complex<float>((float) sigmaReal, (float) sigmaImag);
cneupd_c(rvec, howmny, select, reinterpret_cast<_Complex float*>(d), reinterpret_cast<_Complex float*>(z), ldz,
reinterpret_cast<_Complex float &>(sigma), reinterpret_cast<_Complex float*>(workev),
bMat, nbDim, which, nbEV, tol, reinterpret_cast<_Complex float*>(resid), nbCV,
reinterpret_cast<_Complex float*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex float*>(workd), reinterpret_cast<_Complex float*>(workl), lworkl, rwork, &info);
if (info == -14) cerr << "Error: zneupd - KO: dsaupd did not find any eigenvalues to sufficient accuracy" << endl;
if (info < 0 && info != -14 /*-14: don't break*/) {cerr << "Error: zneupd - KO with info " << info << endl; return 1;}
cneupd_c(rvec, howmny, select, reinterpret_cast<a_fcomplex*>(d), reinterpret_cast<a_fcomplex*>(z), ldz,
reinterpret_cast<a_fcomplex &>(sigma), reinterpret_cast<a_fcomplex*>(workev),
bMat, nbDim, which, nbEV, tol, reinterpret_cast<a_fcomplex*>(resid), nbCV,
reinterpret_cast<a_fcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_fcomplex*>(workd), reinterpret_cast<a_fcomplex*>(workl), lworkl, rwork, &info);
if (info == -14) cerr << "Error: cneupd - KO: cnaupd did not find any eigenvalues to sufficient accuracy" << endl;
if (info < 0 && info != -14 /*-14: don't break*/) {cerr << "Error: cneupd - KO with info " << info << endl; return 1;}
spectrum(d, z, nbDim, iparam);
@@ -613,12 +641,12 @@ class arpackSolver {
complex<double> * workev = new complex<double>[2*nbCV];
complex<double> sigma = complex<double>(sigmaReal, sigmaImag);
zneupd_c(rvec, howmny, select, reinterpret_cast<_Complex double*>(d), reinterpret_cast<_Complex double*>(z), ldz,
reinterpret_cast<_Complex double &>(sigma), reinterpret_cast<_Complex double*>(workev),
bMat, nbDim, which, nbEV, tol, reinterpret_cast<_Complex double*>(resid), nbCV,
reinterpret_cast<_Complex double*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex double*>(workd), reinterpret_cast<_Complex double*>(workl), lworkl, rwork, &info);
if (info == -14) cerr << "Error: zneupd - KO: dsaupd did not find any eigenvalues to sufficient accuracy" << endl;
zneupd_c(rvec, howmny, select, reinterpret_cast<a_dcomplex*>(d), reinterpret_cast<a_dcomplex*>(z), ldz,
reinterpret_cast<a_dcomplex &>(sigma), reinterpret_cast<a_dcomplex*>(workev),
bMat, nbDim, which, nbEV, tol, reinterpret_cast<a_dcomplex*>(resid), nbCV,
reinterpret_cast<a_dcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_dcomplex*>(workd), reinterpret_cast<a_dcomplex*>(workl), lworkl, rwork, &info);
if (info == -14) cerr << "Error: zneupd - KO: znaupd did not find any eigenvalues to sufficient accuracy" << endl;
if (info < 0 && info != -14 /*-14: don't break*/) {cerr << "Error: zneupd - KO with info " << info << endl; return 1;}
spectrum(d, z, nbDim, iparam);
@@ -654,22 +682,48 @@ class arpackSolver {
return rc;
};
void restartSolve(string const & fileName,
a_int const & nbDim, RC * rv, bool readNbCV) {
if (restartFromFile) {
ifstream ifs(fileName.c_str());
if (ifs.is_open()) {
a_int nbCV = 1; if (readNbCV) {ifs >> nbCV; if (nbCV < nbCV) nbCV = nbCV;}
for (a_int n = 0; rv && n < nbDim*nbCV; n++) ifs >> rv[n];
if (verbose >= 1) {
cout << endl << "arpackSolver:" << endl;
cout << endl << fileName << ": restart OK" << endl;
if (verbose >= 2) {
for (a_int n = 0; rv && n < nbDim; n++) cout << rv[n] << endl;
}
template <typename T>
int saveSolve(string const & fileName,
a_int const & nbDim, T * rv) {
ofstream ofs(fileName.c_str(), ofstream::trunc);
if (ofs.is_open()) {
ofs << nbDim << endl;
for (a_int n = 0; rv && n < nbDim; n++) ofs << rv[n] << endl;
ofs.close(); // Make sure the file is written.
}
return 0;
};
template <typename T>
int restartSolve(string const & fileName,
a_int const & nbDim, T * rv,
bool allowZero = true) {
ifstream ifs(fileName.c_str());
if (ifs.is_open()) {
a_int nDim = 0;
ifs >> nDim;
if (nDim != nbDim) {cerr << "Error: bad dim - restart KO" << endl; return 1;}
for (a_int n = 0; rv && n < nbDim; n++) {
RC val; makeConstant(val, 0.);
ifs >> val;
if (abs(val) < 1.e-6 && !allowZero) {
// Do NOT let residual be zero: this stops arpack to iterate (info = -9).
auto eps = numeric_limits<FD>::epsilon();
RC epsilon; makeConstant(epsilon, eps);
val = epsilon;
}
rv[n] = val;
}
if (verbose >= 1) {
cout << endl << "arpackSolver:" << endl;
cout << endl << fileName << ": restart OK" << endl;
if (verbose >= 2) {
for (a_int n = 0; rv && n < nbDim; n++) cout << rv[n] << endl;
}
}
}
return 0;
};
int initPointerSize(a_int & iparamSz, a_int & ipntrSz, string const & aeupd) {
@@ -702,18 +756,20 @@ class arpackSolver {
char const * gMat = "G";
char const * bMat = (mode == 1) ? iMat : gMat;
a_int nbDim = A.rows();
RC zero; makeZero(zero);
auto eps = numeric_limits<FD>::epsilon();
RC epsilon; makeConstant(epsilon, eps);
if (!resid) {
resid = new RC[nbDim];
for (a_int n = 0; n < nbDim; n++) resid[n] = zero; // Avoid "bad" starting vector.
// Do NOT let residual be zero: this stops arpack to iterate (info = -9).
for (a_int n = 0; n < nbDim; n++) resid[n] = epsilon;
};
restartSolve("arpackSolver.resid.out", nbDim, resid, false);
a_int ldv = nbDim;
RC cst; makeConstant(cst, 10.);
RC v0 = cst * epsilon; // Start with something close to zero but *not* exactly zero.
if (!v) {
v = new RC[ldv*nbCV];
for (a_int n = 0; n < ldv*nbCV; n++) v[n] = zero; // Avoid "bad" starting vector.
for (a_int n = 0; n < ldv*nbCV; n++) v[n] = v0;
};
restartSolve("arpackSolver.v.out", ldv, v, true);
a_int iparamSz = 0, ipntrSz = 0;
int rc = initPointerSize(iparamSz, ipntrSz, "aupd");
if (rc != 0) {cerr << "Error: bad iparam/ipntr initialization for aupd" << endl; return rc;}
@@ -723,12 +779,22 @@ class arpackSolver {
iparamAupd[3] = 1; // Block size.
iparamAupd[4] = 0; // Number of ev found by arpack.
iparamAupd[6] = mode;
RC zero; makeConstant(zero, 0.);
vector<a_int> ipntrAupd(ipntrSz, 0);
RC * workd = new RC[3*nbDim]; for (a_int n = 0; n < 3*nbDim; n++) workd[n] = zero; // Avoid "bad" X/Y vector.
a_int lworkl = symPb ? nbCV*nbCV + 8*nbCV : 3*nbCV*nbCV + 6*nbCV;
RC * workl = new RC[lworkl];
a_int info = 0; // Use random initial residual vector.
if (restartFromFile) info = 1;
// Handling restart.
if (restartFromFile) {
info = 1; // Restart.
rc = restartSolve("arpackSolver.resid.out", nbDim, resid, false);
if (rc != 0) {cerr << "Error: bad restart (resid)" << endl; return rc;}
rc = restartSolve("arpackSolver.v.out", ldv*nbCV, v);
if (rc != 0) {cerr << "Error: bad restart (v)" << endl; return rc;}
}
// Initialize solver.
@@ -822,9 +888,11 @@ class arpackSolver {
rc = eupd(rvec, howmny, select, z, ldz, bMat, nbDim, which, resid, v, ldv, iparamEupd.data(), ipntrEupd.data(), workd, workl, lworkl, rwork, info);
if (rc != 0) {cerr << "Error: bad arpack eupd" << endl; return rc;}
// Save solve (dump results to file) to allow later restart.
if (dumpToFile) {
ofstream rfs("arpackSolver.resid.out"); for (a_int n = 0; n < nbDim; n++) rfs << resid[n] << endl;
ofstream vfs("arpackSolver.v.out"); vfs << nbCV << endl; for (a_int n = 0; n < ldv*nbCV; n++) vfs << v[n] << endl;
saveSolve("arpackSolver.resid.out", nbDim, resid);
saveSolve("arpackSolver.v.out", ldv*nbCV, v);
}
// Clean.
-10
View File
@@ -1,10 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
Name: arpackSolver
Description: Utility to test arpack with matrix market files
Version: @PACKAGE_VERSION@
URL: @PACKAGE_URL@
Requires: arpack, eigen3 >= 3.3
Cflags: -I${includedir}/arpack
+173 -92
View File
@@ -1,4 +1,9 @@
#include <iostream>
#include <exception>
#include <sstream>
#include <chrono>
#include <vector>
#include <tuple>
#include "arpackSolver.hpp"
#include "debug_c.hpp"
@@ -9,8 +14,8 @@ using namespace std;
class options {
public:
options() {
fileA = "A.mtx";
fileB = "N.A."; // Not available.
fileA = "";
fileB = "";
dense = false;
denseRR = true;
nbEV = 1;
@@ -28,6 +33,7 @@ class options {
invert =
false; // Eigen value invertion: look for 1./lambda instead of lambda.
tol = 1.e-06;
maxResNorm = 1.e-3;
maxIt = 100;
schur = false; // Compute Ritz vectors.
slv = "BiCG";
@@ -44,27 +50,39 @@ class options {
};
int readCmdLine(int argc, char** argv) {
// Convert command line to stream.
stringstream ssIP; // Independent parameters.
for (int a = 1; argv && a < argc; a++) {
ssIP << argv[a] << " ";
}
// Check for command line independent parameters.
for (int a = 1; argv && a < argc; a++) {
string clo = argv[a]; // Command line option.
if (clo == "--help") return usage(0);
string clo; // Command line option.
while (ssIP >> clo) {
if (clo == "--help" || clo == "-h") return usage();
if (clo.find("--") == std::string::npos) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
return usage();
}
if (clo == "--A") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
fileA = argv[a];
fileA = clo;
}
if (clo == "--dense") {
dense = true;
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
string rr(argv[a]);
string rr = clo;
if (rr != "true" && rr != "false") {
cerr << "Error: bad " << clo << " - bad argument" << endl;
return usage();
@@ -72,12 +90,12 @@ class options {
denseRR = (rr == "true") ? true : false;
}
if (clo == "--nbEV") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream nEV(argv[a]);
stringstream nEV(clo);
nEV >> nbEV;
if (!nEV) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -85,10 +103,6 @@ class options {
}
nbCV = 2 * nbEV + 1;
}
if (clo == "--genPb") {
stdPb = false;
fileB = "B.mtx";
}
if (clo == "--nonSymPb") symPb = false;
if (clo == "--cpxPb") {
symPb = false;
@@ -96,15 +110,15 @@ class options {
}
if (clo == "--simplePrec") simplePrec = true;
if (clo == "--mag") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
mag = argv[a]; // small mag (likely poor perf) <=> large mag + invert
mag = clo; // small mag (likely poor perf) <=> large mag + invert
// (likely good perf).
bool ok = (mag == "LM" || mag == "SM" || mag == "LR" || mag == "SR" ||
mag == "LI" || mag == "SI")
mag == "LA" || mag == "SA" || mag == "LI" || mag == "SI")
? true
: false;
if (!ok) {
@@ -114,12 +128,12 @@ class options {
}
if (clo == "--shiftReal") {
shiftReal = true;
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream s(argv[a]);
stringstream s(clo);
s >> sigmaReal;
if (!s) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -128,12 +142,12 @@ class options {
}
if (clo == "--shiftImag") {
shiftImag = true;
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream s(argv[a]);
stringstream s(clo);
s >> sigmaImag;
if (!s) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -142,47 +156,62 @@ class options {
}
if (clo == "--invert") invert = true;
if (clo == "--tol") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream t(argv[a]);
stringstream t(clo);
t >> tol;
if (!t) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
return usage();
}
}
if (clo == "--maxIt") {
a++;
if (a >= argc) {
if (clo == "--maxResNorm") {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream mi(argv[a]);
stringstream mrn(clo);
mrn >> maxResNorm;
if (!mrn) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
return usage();
}
}
if (clo == "--maxIt") {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream mi(clo);
mi >> maxIt;
if (!mi) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
return usage();
}
}
if (clo == "--schur") {
schur = true;
}
if (clo == "--slv") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
slv = argv[a];
slv = clo;
}
if (clo == "--slvItrTol") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream t(argv[a]);
double tol = 0.;
stringstream t(clo);
t >> slvItrTol;
if (!t) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -190,12 +219,12 @@ class options {
}
}
if (clo == "--slvItrMaxIt") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream mi(argv[a]);
stringstream mi(clo);
int maxIt = 0;
mi >> slvItrMaxIt;
if (!mi) {
@@ -204,12 +233,12 @@ class options {
}
}
if (clo == "--slvItrPC") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream pc(argv[a]);
stringstream pc(clo);
pc >> slvItrPC;
if (!pc) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -217,12 +246,12 @@ class options {
}
}
if (clo == "--slvDrtPivot") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream pv(argv[a]);
stringstream pv(clo);
pv >> slvDrtPivot;
if (!pv) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -230,12 +259,12 @@ class options {
}
}
if (clo == "--slvDrtOffset") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream of(argv[a]);
stringstream of(clo);
of >> slvDrtOffset;
if (!of) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -243,12 +272,12 @@ class options {
}
}
if (clo == "--slvDrtScale") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream sc(argv[a]);
stringstream sc(clo);
sc >> slvDrtScale;
if (!sc) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -257,12 +286,12 @@ class options {
}
if (clo == "--noCheck") check = false;
if (clo == "--verbose") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream vb(argv[a]);
stringstream vb(clo);
vb >> verbose;
if (!vb) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -270,12 +299,12 @@ class options {
}
}
if (clo == "--debug") {
a++;
if (a >= argc) {
ssIP >> clo;
if (!ssIP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream dbg(argv[a]);
stringstream dbg(clo);
dbg >> debug;
if (!dbg) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -287,19 +316,29 @@ class options {
debug, debug, debug, debug, debug);
}
if (clo == "--restart") restart = true;
// Skip dependent parameters.
if (clo == "--nbCV") { ssIP >> clo; continue; }
if (clo == "--B") { ssIP >> clo; continue; }
}
// Convert command line to stream.
stringstream ssDP; // Dependent parameters.
for (int a = 1; argv && a < argc; a++) {
ssDP << argv[a] << " ";
}
// Check for command line dependent parameters.
for (int a = 1; argv && a < argc; a++) {
string clo = argv[a]; // Command line option.
while (ssDP >> clo) {
if (clo == "--nbCV") {
a++;
if (a >= argc) {
ssDP >> clo;
if (!ssDP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
stringstream nCV(argv[a]);
stringstream nCV(clo);
nCV >> nbCV;
if (!nCV) {
cerr << "Error: bad " << clo << " - bad argument" << endl;
@@ -307,19 +346,20 @@ class options {
}
}
if (clo == "--B") {
a++;
if (a >= argc) {
ssDP >> clo;
if (!ssDP) {
cerr << "Error: bad " << clo << " - need argument" << endl;
return usage();
}
fileB = argv[a];
fileB = clo;
stdPb = false; // Generalized problem.
}
}
return 0;
};
int usage(int rc = 1) {
int usage() {
cout << "Usage: running arpack with matrix market files to check for eigen "
"values/vectors."
<< endl;
@@ -364,8 +404,6 @@ class options {
cout << " default: 1" << endl;
cout << " --nbCV: number of columns of the matrix V." << endl;
cout << " default: 2*nbEV+1" << endl;
cout << " --genPb: generalized problem." << endl;
cout << " default: standard problem" << endl;
cout << " --nonSymPb: non symmetric problem (<=> use dn[ae]upd)."
<< endl;
cout << " default: symmetric problem (<=> use ds[ae]upd)"
@@ -381,7 +419,7 @@ class options {
"[dz]*upd)"
<< endl;
cout << " --mag M: set magnitude of eigen values to look for "
"(LM, SM, LR, SR, LI, SI)."
"(LM, SM, LR, SR, LA, SA, LI, SI)."
<< endl;
cout << " default: large magnitude (LM)" << endl;
cout << " --shiftReal S: real shift where sigma = S (look for lambda+S "
@@ -398,6 +436,8 @@ class options {
cout << " default: no invert" << endl;
cout << " --tol T: tolerance T." << endl;
cout << " default: 1.e-06" << endl;
cout << " --maxResNorm R: maximum residual norm R." << endl;
cout << " default: 1.e-3" << endl;
cout << " --maxIt M: maximum iterations M." << endl;
cout << " default: 100" << endl;
cout << " --schur: compute Schur vectors." << endl;
@@ -490,8 +530,7 @@ class options {
"computed during a previous run."
<< endl;
cout << " default: false" << endl;
if (rc == 0) exit(0);
return rc;
return 1;
};
friend ostream& operator<<(ostream& ostr, options const& opt);
@@ -512,6 +551,7 @@ class options {
// lambda+sigma instead of lambda.
bool invert; // Eigen value invertion: look for 1./lambda instead of lambda.
double tol;
double maxResNorm;
int maxIt;
bool schur;
string slv;
@@ -528,7 +568,8 @@ class options {
};
ostream& operator<<(ostream& ostr, options const& opt) {
ostr << "OPT: A " << opt.fileA << ", B " << opt.fileB;
ostr << "OPT: A " << opt.fileA;
if (!opt.fileB.empty()) ostr << ", B " << opt.fileB;
if (opt.dense && opt.denseRR)
ostr << ", dense yes (RR true)";
else if (opt.dense && !opt.denseRR)
@@ -546,14 +587,25 @@ ostream& operator<<(ostream& ostr, options const& opt) {
ostr << ", shiftImag " << (opt.shiftImag ? "yes" : "no") << ", sigmaImag "
<< opt.sigmaImag;
ostr << ", invert " << (opt.invert ? "yes" : "no") << ", tol " << opt.tol
<< ", maxIt " << opt.maxIt;
<< ", maxResNorm " << opt.maxResNorm << ", maxIt " << opt.maxIt;
ostr << ", " << (opt.schur ? "Schur" : "Ritz") << " vectors" << endl;
ostr << "OPT: slv " << opt.slv << ", slvItrPC " << opt.slvItrPC
<< ", slvItrTol " << opt.slvItrTol;
ostr << ", slvItrMaxIt " << opt.slvItrMaxIt << ", slvDrtPivot "
<< opt.slvDrtPivot;
ostr << ", slvDrtOffset " << opt.slvDrtOffset << ", slvDrtScale "
<< opt.slvDrtScale << endl;
ostr << "OPT: slv " << opt.slv;
bool itrSlv = true; // Use iterative solvers.
if (opt.slv.find("LU") != string::npos ||
opt.slv.find("QR") != string::npos ||
opt.slv.find("LLT") != string::npos ||
opt.slv.find("LDLT") != string::npos)
itrSlv = false;
if (itrSlv) {
ostr << ", slvItrPC " << opt.slvItrPC;
ostr << ", slvItrTol " << opt.slvItrTol;
ostr << ", slvItrMaxIt " << opt.slvItrMaxIt;
} else {
ostr << ", slvDrtPivot " << opt.slvDrtPivot;
ostr << ", slvDrtOffset " << opt.slvDrtOffset;
ostr << ", slvDrtScale " << opt.slvDrtScale;
}
ostr << endl;
ostr << "OPT: check " << (opt.check ? "yes" : "no") << ", verbose "
<< opt.verbose << ", debug " << opt.debug;
ostr << ", restart " << (opt.restart ? "yes" : "no") << endl;
@@ -575,6 +627,7 @@ class output {
int nbIt; // Arpack number of iterations.
double imsTime; // Init mode solver time.
double rciTime; // Reverse communication interface time.
vector<tuple<double, double>> res; // Results: eigen values and associated residual.
};
template <typename RC, typename FD, typename EM, typename SLV>
@@ -615,8 +668,6 @@ int itrSolve(options& opt, output& out, double const& slvItrILUDropTol,
cout << endl;
cout << "INP: create A " << readATime << " s" << endl;
if (opt.nbCV > A.cols()) opt.nbCV = A.cols(); /* Cut-off */
EM B;
if (!opt.stdPb) {
start = chrono::high_resolution_clock::now();
@@ -650,7 +701,7 @@ int itrSolve(options& opt, output& out, double const& slvItrILUDropTol,
return rc;
}
if (opt.check) {
rc = as.checkEigVec(A, opt.stdPb ? nullptr : &B);
rc = as.checkEigVec(A, opt.stdPb ? nullptr : &B, opt.maxResNorm);
if (rc != 0) {
cerr << "Error: check KO" << endl;
return rc;
@@ -664,6 +715,11 @@ int itrSolve(options& opt, output& out, double const& slvItrILUDropTol,
out.nbIt = as.nbIt;
out.imsTime = as.imsTime;
out.rciTime = as.rciTime;
for (auto idx = 0; idx < as.val.size(); idx++) {
double val = norm(as.val[idx]);
double res = as.computeResidualNorm(idx, A, opt.stdPb ? nullptr : &B);
out.res.push_back(tuple<double, double>{val, res});
}
return 0;
}
@@ -704,8 +760,6 @@ int drtSolve(options& opt, output& out) {
cout << endl;
cout << "INP: create A " << readATime << " s" << endl;
if (opt.nbCV > A.cols()) opt.nbCV = A.cols(); /* Cut-off */
EM B;
if (!opt.stdPb) {
start = chrono::high_resolution_clock::now();
@@ -739,7 +793,7 @@ int drtSolve(options& opt, output& out) {
return rc;
}
if (opt.check) {
rc = as.checkEigVec(A, opt.stdPb ? nullptr : &B);
rc = as.checkEigVec(A, opt.stdPb ? nullptr : &B, opt.maxResNorm);
if (rc != 0) {
cerr << "Error: check KO" << endl;
return rc;
@@ -753,6 +807,11 @@ int drtSolve(options& opt, output& out) {
out.nbIt = as.nbIt;
out.imsTime = as.imsTime;
out.rciTime = as.rciTime;
for (auto idx = 0; idx < as.val.size(); idx++) {
double val = norm(as.val[idx]);
double res = as.computeResidualNorm(idx, A, opt.stdPb ? nullptr : &B);
out.res.push_back(tuple<double, double>{val, res});
}
return 0;
}
@@ -815,7 +874,7 @@ int itrSolve(options& opt, output& out) {
return rc;
}
int main(int argc, char** argv) {
int run(int argc, char** argv) {
// Check for options.
options opt;
@@ -844,6 +903,7 @@ int main(int argc, char** argv) {
if (opt.dense) {
if (itrSlv) {
cerr << "Error: dense matrices does not support iterative solvers"
<< ", specify --slv XX with XX being a direct solver"
<< endl;
return 1;
}
@@ -965,9 +1025,30 @@ int main(int argc, char** argv) {
cout << "STAT: total number of restart steps "
<< nrstrt << endl;
// Output eigen values and residuals.
cout << endl;
for (auto idx = 0; idx < out.res.size(); idx++) {
tuple<double, double> res = out.res[idx];
cout << "RES: eigen value " << idx << ": norm " << get<0>(res);
cout << " (residual norm " << get<1>(res) << ")";
cout << endl;
}
return 0;
}
int main(int argc, char** argv) {
int rc = 1;
try {
rc = run(argc, argv);
}
catch (exception& e) {
cout << "Error - exception:" << e.what() << endl;
}
return rc;
}
// Local Variables:
// mode: c++
// c-file-style:"stroustrup"
+71 -67
View File
@@ -1,90 +1,94 @@
#!/bin/bash -eu
export CMD="./arpackmm --help" # For coverage
echo "$CMD"
eval "$CMD &> arpackmm.run.log"
echo ""
echo "========================================================================================"
echo ""
trap 'catch' ERR
catch() {
grep OPT arpackmm.run.log
grep Error arpackmm.run.log
exit 1
}
for eigPb in "--A As.mtx" "--nonSymPb --A An.mtx" "--nonSymPb --cpxPb --A Az.mtx --B Bz.mtx"
# For all these eigen problems, the first eigen value is about 382 or (382, 0.).
for stdPb in "--A As.mtx" "--nonSymPb --A An.mtx" "--nonSymPb --cpxPb --A Az.mtx"
do
for genPb in "" "--genPb"
# Choose B matrix according to A.
export fileB=""
if [[ "$stdPb" == *cpxPb* ]]; then
export fileB="--B Bz.mtx"
else
export fileB="--B B.mtx"
fi
for genPb in "" "$fileB"
do
for smallMag in "" "--mag SM --noCheck" # SM is known to be difficult to converge.
# SM may not converge so we can not apply checks.
# LM + invert is equivalent to SM and does converge.
# Note: this is expected as "power-like" methods are designed to find largest eigen values.
for magOpt in "--mag LM" "--mag SM --noCheck"
do
export shiftOpt=""
if [[ "$eigPb" == *nonSymPb* ]]; then
if [[ "$genPb" == *genPb* ]]; then
continue # Skip to ensure stable test: tricky to convergence.
else
export shiftOpt="--shiftReal 100.0 --shiftImag 100.0"
fi
export mrn="--maxResNorm 1.e-1" # Relax residual check to get stable tests.
# Shift slightly to avoid the zero-vector starting problem.
export shiftZV=""
if [[ "$stdPb" == *cpxPb* ]]; then
export shiftZV="--shiftReal 1.0 --shiftImag 1.0"
else
if [[ "$genPb" == *genPb* ]]; then
continue # Skip to ensure stable test: tricky to convergence.
else
export shiftOpt="--shiftReal 100.0"
fi
export shiftZV="--shiftReal 1.0"
fi
for shiftRI in "" "$shiftOpt"
# Shift according to the estimation of the eigen value we may have.
export shiftEV=""
if [[ "$stdPb" == *cpxPb* ]]; then
export shiftEV="--shiftReal 380.0 --shiftImag 1.0"
else
export shiftEV="--shiftReal 380.0"
fi
for shiftRI in "$shiftZV" "$shiftEV"
do
for invert in "" "--invert"
do
for tol in "" "--tol 1.e-5"
# Choose solver according to the sym/non-sym type of the problem.
export cgSlv=""
if [[ "$stdPb" == *nonSymPb* ]]; then
export cgSlv="BiCG"
else
export cgSlv="CG"
fi
for slv in "--slv $cgSlv" "--slv LU"
do
for slv in "--slv BiCG --slvItrTol 1.e-06 --slvItrMaxIt 150" "--slv CG --slvItrTol 1.e-06 --slvItrMaxIt 150" \
"--slv BiCG --slvItrPC ILU" "--slv CG --slvItrPC ILU#1.e-06#2" \
"--slv LU" "--slv QR --slvDrtPivot 1.e-06" \
"--slv LLT" "--slv LLT --slvDrtOffset 0." \
"--slv LDLT" "--slv LDLT --slvDrtScale 1."
for rs in "" "--schur"
do
for rs in "" "--schur"
for dsPrec in "" "--simplePrec"
do
for dsPrec in "" "--simplePrec"
for dsMat in "" "--dense true"
do
for dsMat in "" "--dense false" "--dense true"
do
export extraGenPb=""
if [[ "$genPb" == *genPb* ]]; then
export extraGenPb="$shiftOpt" # Force shift if genPb.
fi
# Skip not supported cases.
if [[ "$dsMat" == *dense* ]]; then
if [[ "$slv" == *CG* ]]; then
if [[ "$eigPb" == *nonSymPb* ]]; then
continue # Skip CG that could fail (CG is meant to deal with sym matrices).
fi
continue # Iterative solvers are not allowed when using dense matrices.
fi
fi
if [[ "$slv" == *LLT* ]] || [[ "$slv" == *LDLT* ]]; then
if [[ "$eigPb" == *nonSymPb* ]] || [[ "$genPb" == *genPb* ]]; then
continue # Skip LLT/LDLT that could fail (LLT/LDLT are meant to deal with SPD matrices).
fi
fi
export easeCV="--nbCV 6 --maxIt 200" # Use --nbCV 6 and --maxIt 200 to ease convergence.
echo "CLI: ./arpackmm $stdPb $genPb $magOpt $mrn $shiftRI $invert $slv $rs $dsPrec $dsMat $easeCV"
echo "----------------------------------------------------------------------------------------"
if [[ "$dsMat" == *dense* ]]; then
if [[ "$slv" == *CG* ]]; then
continue # Iterative solvers are not allowed when using dense matrices.
fi
fi
# Run arpackmm.
./arpackmm "$stdPb" "$genPb" "$magOpt" "$mrn" "$shiftRI" "$invert" "$slv" "$rs" "$dsPrec" "$dsMat" \
"$easeCV" --verbose 3 &> arpackmm.run.log
grep OPT arpackmm.run.log
grep OUT arpackmm.run.log
echo "----------------------------------------------------------------------------------------"
# Run arpackmm: use --nbCV 6 and --maxIt 200 to ease convergence, and, --verbose 3 for debug.
export CMD="./arpackmm $eigPb $genPb $smallMag $shiftRI $invert $tol $slv $rs $dsPrec $dsMat $extraGenPb --nbCV 6 --maxIt 200 --verbose 3 --debug 3"
echo "$CMD"
eval "$CMD &> arpackmm.run.log"
echo ""
echo "========================================================================================"
echo ""
# Run arpackmm: re-run with restart.
export CMD="$CMD --restart"
echo "$CMD"
eval "$CMD &> arpackmm.run.log"
echo ""
echo "========================================================================================"
echo ""
done
# Run arpackmm: re-run with restart always with small shift to avoid the zero-starting vector problem.
./arpackmm "$stdPb" "$genPb" "$magOpt" "$mrn" "$shiftZV" "$invert" "$slv" "$rs" "$dsPrec" "$dsMat" \
--restart \
"$easeCV" --verbose 3 &> arpackmm.run.log
grep OPT arpackmm.run.log
grep OUT arpackmm.run.log
echo "========================================================================================"
done
done
done
@@ -95,4 +99,4 @@ do
done
done
echo "OK"
echo "arpackmm: OK"
+6
View File
@@ -0,0 +1,6 @@
%% MatrixMarket matrix coordinate double symmetric
% 4x4 matrix filled with zero
%
4 4 0
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash -eu
# Note: need to shift slightly as eigen value is zero.
./arpackmm --A issue215.mtx --mag LM --nbEV 1 --nbCV 4 --shiftReal 0.1
if [ "$?" -ne "0" ]; then exit 1; fi
./arpackmm --A issue215.mtx --mag LM --nbEV 1 --nbCV 4 --shiftReal 0.1 --restart
if [ "$?" -ne "0" ]; then exit 1; fi
echo "OK"
+8
View File
@@ -0,0 +1,8 @@
%% MatrixMarket matrix coordinate double symmetric
% 10x10 matrix with 2 non-zero values
%
10 10 2
0 1 1.
1 0 1.
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash -eu
./arpackmm --A issue401.mtx --mag LA --nbEV 1 --nbCV 5
if [ "$?" -ne "0" ]; then exit 1; fi
./arpackmm --A issue401.mtx --mag LA --nbEV 1 --nbCV 5 --restart
if [ "$?" -ne "0" ]; then exit 1; fi
./arpackmm --A issue401.mtx --mag LA --nbEV 1 --nbCV 5 --restart --shiftReal 0.9
if [ "$?" -ne "0" ]; then exit 1; fi
echo "OK"
+1 -1
View File
@@ -1,5 +1,5 @@
SUBDIRS = BAND COMPLEX NONSYM SIMPLE SVD SYM
if ICBEXMM
if EIGEN
SUBDIRS += MATRIX_MARKET
endif
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SNDRV = sndrv1 sndrv2 sndrv3 sndrv4 sndrv5 sndrv6
DNDRV = dndrv1 dndrv2 dndrv3 dndrv4 dndrv5 dndrv6
+8 -1
View File
@@ -5,11 +5,18 @@ Installation:
Python3: ~/arpack-ng/build> cmake -DCMAKE_INSTALL_PREFIX=/tmp/local -DPYTHON3=ON -DBOOST_PYTHON_LIBSUFFIX="3" ..
~/arpack-ng/build> make all test
~/arpack-ng/build> make install
Note: Boost must have been compiled for Python3.
Note: installation will install libpyarpack.so in the install directory.
Note: python3 minimal packages must be installed (apt-get install python3-minimal python3-pip).
numpy must be installed (apt-get install python3-numpy) as the A/B matrices used by arpack
solver must be numpy arrays.
Usage:
------
PYTHONPATH must include the directory where libpyarpack.so has been installed.
>> export PYTHONPATH="/tmp/local/lib/pyarpack:${PYTHONPATH}"
>> python
>> import pyarpack
@@ -45,7 +52,7 @@ Note:
1.1. create numpy arrays specifying explicitly the type:
>> Aij = np.array([], dtype='complex128')
1.2. filling numpy arrays casting value on append:
>> Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
>> Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
1.3. calling the solver flavor which is consistent with the numpy array data type:
>> arpackSlv = pyarpackSlv.complexDouble() # Caution: complexDouble <=> np.array(..., dtype='complex128')
note: NO data type check can be done at C++ side, the pyarpack user MUST insure data consistency.
+10 -7
View File
@@ -29,8 +29,9 @@ void exportArpackSparseItr(bp::scope& pySlv, std::string const& dtype) {
.def("checkEigVec",
&pyarpackSparseItrSolver<RC, FD, EM, SLV>::checkEigVec,
(bp::arg("A"), bp::arg("B") = bp::tuple(),
bp::arg("diffTol") = 1.e-3),
"check eigen vectors accuracy where A and B must be sparse and "
bp::arg("maxResNorm") = 1.e-3),
"check eigen vectors accuracy (according to max allowed residual norm) "
"where A and B must be sparse and "
"provided in coo format: (dimension, row-indice array, "
"column-indice array, matrice-value array) tuple")
ARPACKSOLVERMEMBER(pyarpackSparseItrSolver)
@@ -69,8 +70,9 @@ void exportArpackSparseDrt(bp::scope& pySlv, std::string const& dtype) {
.def("checkEigVec",
&pyarpackSparseDrtSolver<RC, FD, EM, SLV>::checkEigVec,
(bp::arg("A"), bp::arg("B") = bp::tuple(),
bp::arg("diffTol") = 1.e-3),
"check eigen vectors accuracy where A and B must be sparse and "
bp::arg("maxResNorm") = 1.e-3),
"check eigen vectors accuracy (according to max allowed residual norm) "
"where A and B must be sparse and "
"provided in coo format: (dimension, row-indice array, "
"column-indice array, matrice-value array) tuple")
ARPACKSOLVERMEMBER(pyarpackSparseDrtSolver)
@@ -103,8 +105,9 @@ void exportArpackDenseDrt(bp::scope& pySlv, std::string const& dtype) {
.def("checkEigVec",
&pyarpackDenseDrtSolver<RC, FD, EM, SLV>::checkEigVec,
(bp::arg("A"), bp::arg("B") = bp::tuple(),
bp::arg("diffTol") = 1.e-3),
"check eigen vectors accuracy where A and B must be dense and "
bp::arg("maxResNorm") = 1.e-3),
"check eigen vectors accuracy (according to max allowed residual norm) "
"where A and B must be dense and "
"provided in raw format: (n-squared matrice-value array, row or "
"column ordered boolean)")
ARPACKSOLVERMEMBER(pyarpackDenseDrtSolver)
@@ -194,7 +197,7 @@ BOOST_PYTHON_MODULE(pyarpack) {
doc << " 1.1. create numpy arrays specifying explicitly the type:" << std::endl;
doc << " >> Aij = np.array([], dtype='complex128')" << std::endl;
doc << " 1.2. filling numpy arrays casting value on append:" << std::endl;
doc << " >> Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type." << std::endl;
doc << " >> Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type." << std::endl;
doc << " 1.3. calling the solver flavor which is consistent with the numpy array data type:" << std::endl;
doc << " >> arpackSlv = pyarpackSlv.complexDouble() # Caution: complexDouble <=> np.array(..., dtype='complex128')" << std::endl;
doc << " note: NO data type check can be done at C++ side, the pyarpack user MUST insure data consistency." << std::endl;
+18 -23
View File
@@ -6,24 +6,22 @@ from pyarpack import denseLDLT as pyarpackSlv
# Build laplacian.
n = 4
Aij = np.array([], dtype='complex128')
Aij = np.array([], dtype='float64')
for k in range(n):
for l in range(n):
if l == k:
Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1:
Aij = np.append(Aij, np.complex128(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k+1:
Aij = np.append(Aij, np.complex128(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.float64( 200.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1 or l == k+1:
Aij = np.append(Aij, np.float64(-100.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
else:
Aij = np.append(Aij, np.complex128(np.complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.float64( 0.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
for idx, val in enumerate(Aij):
print("A[", idx, "] =", val)
A = (Aij, False) # raw format: Aij values, row ordered (or not).
# Get and tune arpack solver.
arpackSlv = pyarpackSlv.complexDouble() # Caution: complexDouble <=> np.array(..., dtype='complex128')
arpackSlv = pyarpackSlv.double() # Caution: double <=> np.array(..., dtype='float64')
arpackSlv.verbose = 3 # Set to 0 to get a quiet solve.
arpackSlv.debug = 1 # Set to 0 to get a quiet solve.
arpackSlv.nbEV = 1
@@ -32,7 +30,7 @@ arpackSlv.mag = 'LM'
arpackSlv.maxIt = 200
arpackSlv.slvOffset = 0.
arpackSlv.slvScale = 1.
arpackSlv.symPb = False
arpackSlv.symPb = True
# Solve eigen problem.
@@ -60,22 +58,19 @@ print("\n#######################################################################
# Build laplacian.
n = 8
Aij = np.array([], dtype='complex64')
Bij = np.array([], dtype='complex64')
Aij = np.array([], dtype='float32')
Bij = np.array([], dtype='float32')
for k in range(n):
for l in range(n):
if l == k:
Aij = np.append(Aij, np.complex64(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1:
Aij = np.append(Aij, np.complex64(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k+1:
Aij = np.append(Aij, np.complex64(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.float32( 200.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 33.3)) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1 or l == k+1:
Aij = np.append(Aij, np.float32(-100.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 16.6)) # Casting value on append is MANDATORY or C++ won't get the expected type.
else:
Aij = np.append(Aij, np.complex64(np.complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.float32( 0.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 0.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
for idx, val in enumerate(Aij):
print("A[", idx, "] =", val)
for idx, val in enumerate(Bij):
@@ -85,7 +80,7 @@ B = (Bij, True) # raw format: Bij values, row ordered (or not).
# Get and tune arpack solver.
arpackSlv = pyarpackSlv.complexFloat() # Caution: complexFloat <=> np.array(..., dtype='complex64')
arpackSlv = pyarpackSlv.float() # Caution: float <=> np.array(..., dtype='float32')
arpackSlv.verbose = 3 # Set to 0 to get a quiet solve.
arpackSlv.debug = 1 # Set to 0 to get a quiet solve.
arpackSlv.nbEV = 2
@@ -95,7 +90,7 @@ arpackSlv.maxIt = 200
arpackSlv.slvOffset = 0.
arpackSlv.slvScale = 1.
arpackSlv.sigmaReal = 1
arpackSlv.symPb = False
arpackSlv.symPb = True
# Solve eigen problem.
+23 -16
View File
@@ -6,22 +6,24 @@ from pyarpack import denseLUPP as pyarpackSlv
# Build laplacian.
n = 4
Aij = np.array([], dtype='float64')
Aij = np.array([], dtype='complex128')
for k in range(n):
for l in range(n):
if l == k:
Aij = np.append(Aij, np.float64( 200.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1 or l == k+1:
Aij = np.append(Aij, np.float64(-100.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1:
Aij = np.append(Aij, np.complex128(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k+1:
Aij = np.append(Aij, np.complex128(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
else:
Aij = np.append(Aij, np.float64( 0.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for idx, val in enumerate(Aij):
print("A[", idx, "] =", val)
A = (Aij, False) # raw format: Aij values, row ordered (or not).
# Get and tune arpack solver.
arpackSlv = pyarpackSlv.double() # Caution: double <=> np.array(..., dtype='float64')
arpackSlv = pyarpackSlv.complexDouble() # Caution: complexDouble <=> np.array(..., dtype='complex128')
arpackSlv.verbose = 3 # Set to 0 to get a quiet solve.
arpackSlv.debug = 1 # Set to 0 to get a quiet solve.
arpackSlv.nbEV = 1
@@ -29,6 +31,7 @@ arpackSlv.nbCV = 2*arpackSlv.nbEV + 1
arpackSlv.mag = 'LM'
arpackSlv.maxIt = 200
arpackSlv.slvPvtThd = 1.e-6
arpackSlv.symPb = False
# Solve eigen problem.
@@ -56,19 +59,22 @@ print("\n#######################################################################
# Build laplacian.
n = 8
Aij = np.array([], dtype='float32')
Bij = np.array([], dtype='float32')
Aij = np.array([], dtype='complex64')
Bij = np.array([], dtype='complex64')
for k in range(n):
for l in range(n):
if l == k:
Aij = np.append(Aij, np.float32( 200.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 33.3)) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1 or l == k+1:
Aij = np.append(Aij, np.float32(-100.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 16.6)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1:
Aij = np.append(Aij, np.complex64(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k+1:
Aij = np.append(Aij, np.complex64(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
else:
Aij = np.append(Aij, np.float32( 0.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 0.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for idx, val in enumerate(Aij):
print("A[", idx, "] =", val)
for idx, val in enumerate(Bij):
@@ -78,7 +84,7 @@ B = (Bij, True) # raw format: Bij values, row ordered (or not).
# Get and tune arpack solver.
arpackSlv = pyarpackSlv.float() # Caution: float <=> np.array(..., dtype='float32')
arpackSlv = pyarpackSlv.complexFloat() # Caution: complexFloat <=> np.array(..., dtype='complex64')
arpackSlv.verbose = 3 # Set to 0 to get a quiet solve.
arpackSlv.debug = 1 # Set to 0 to get a quiet solve.
arpackSlv.nbEV = 2
@@ -87,6 +93,7 @@ arpackSlv.mag = 'LM'
arpackSlv.maxIt = 200
arpackSlv.slvPvtThd = 1.e-6
arpackSlv.sigmaReal = 1
arpackSlv.symPb = False
# Solve eigen problem.
+12 -12
View File
@@ -10,13 +10,13 @@ Aij = np.array([], dtype='complex128')
for k in range(n):
for l in range(n):
if l == k:
Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1:
Aij = np.append(Aij, np.complex128(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k+1:
Aij = np.append(Aij, np.complex128(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
else:
Aij = np.append(Aij, np.complex128(np.complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for idx, val in enumerate(Aij):
print("A[", idx, "] =", val)
A = (Aij, False) # raw format: Aij values, row ordered (or not).
@@ -64,17 +64,17 @@ Bij = np.array([], dtype='complex64')
for k in range(n):
for l in range(n):
if l == k:
Aij = np.append(Aij, np.complex64(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1:
Aij = np.append(Aij, np.complex64(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k+1:
Aij = np.append(Aij, np.complex64(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
else:
Aij = np.append(Aij, np.complex64(np.complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for idx, val in enumerate(Aij):
print("A[", idx, "] =", val)
for idx, val in enumerate(Bij):
+12 -12
View File
@@ -10,13 +10,13 @@ Aij = np.array([], dtype='complex128')
for k in range(n):
for l in range(n):
if l == k:
Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1:
Aij = np.append(Aij, np.complex128(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k+1:
Aij = np.append(Aij, np.complex128(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
else:
Aij = np.append(Aij, np.complex128(np.complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for idx, val in enumerate(Aij):
print("A[", idx, "] =", val)
A = (Aij, False) # raw format: Aij values, row ordered (or not).
@@ -64,17 +64,17 @@ Bij = np.array([], dtype='complex64')
for k in range(n):
for l in range(n):
if l == k:
Aij = np.append(Aij, np.complex64(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k-1:
Aij = np.append(Aij, np.complex64(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
elif l == k+1:
Aij = np.append(Aij, np.complex64(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
else:
Aij = np.append(Aij, np.complex64(np.complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 0., 0.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for idx, val in enumerate(Aij):
print("A[", idx, "] =", val)
for idx, val in enumerate(Bij):
+4 -4
View File
@@ -44,7 +44,7 @@ class pyarpackSparseDrtSolver: public arpackDrtSolver<RC, FD, EM, SLV> {
return arpackDrtSolver<RC, FD, EM, SLV>::solve(M, (stdPb ? NULL : &N));
};
int checkEigVec(bp::tuple const & A, bp::tuple const B = bp::tuple(), double const diffTol = 1.e-3) {
int checkEigVec(bp::tuple const & A, bp::tuple const B = bp::tuple(), double const maxResNorm = 1.e-3) {
ARPACKSOLVERDEBUGSTAT();
EM M;
int rc = pyarpackServices<RC, EM>::buildSparseMatrice(A, M, debug, "A");
@@ -55,7 +55,7 @@ class pyarpackSparseDrtSolver: public arpackDrtSolver<RC, FD, EM, SLV> {
rc = pyarpackServices<RC, EM>::buildSparseMatrice(B, N, debug, "B");
if (rc != 0) {pyarpackThrowError("build matrice from B KO"); return rc;}
}
return arpackDrtSolver<RC, FD, EM, SLV>::checkEigVec(M, (stdPb ? NULL : &N), &diffTol);
return arpackDrtSolver<RC, FD, EM, SLV>::checkEigVec(M, (stdPb ? NULL : &N), maxResNorm);
};
// Public members.
@@ -101,7 +101,7 @@ class pyarpackDenseDrtSolver: public arpackDrtSolver<RC, FD, EM, SLV> {
return arpackDrtSolver<RC, FD, EM, SLV>::solve(M, (stdPb ? NULL : &N));
};
int checkEigVec(bp::tuple const & A, bp::tuple const B = bp::tuple(), double const diffTol = 1.e-3) {
int checkEigVec(bp::tuple const & A, bp::tuple const B = bp::tuple(), double const maxResNorm = 1.e-3) {
ARPACKSOLVERDEBUGSTAT();
EM M;
int rc = pyarpackServices<RC, EM>::buildDenseMatrice(A, M, debug, "A");
@@ -112,7 +112,7 @@ class pyarpackDenseDrtSolver: public arpackDrtSolver<RC, FD, EM, SLV> {
rc = pyarpackServices<RC, EM>::buildDenseMatrice(B, N, debug, "B");
if (rc != 0) {pyarpackThrowError("build matrice from B KO"); return rc;}
}
return arpackDrtSolver<RC, FD, EM, SLV>::checkEigVec(M, (stdPb ? NULL : &N), &diffTol);
return arpackDrtSolver<RC, FD, EM, SLV>::checkEigVec(M, (stdPb ? NULL : &N), maxResNorm);
};
// Public members.
+2 -2
View File
@@ -43,7 +43,7 @@ class pyarpackSparseItrSolver: public arpackItrSolver<RC, FD, EM, SLV> {
return arpackItrSolver<RC, FD, EM, SLV>::solve(M, (stdPb ? NULL : &N));
};
int checkEigVec(bp::tuple const & A, bp::tuple const B = bp::tuple(), double const diffTol = 1.e-3) {
int checkEigVec(bp::tuple const & A, bp::tuple const B = bp::tuple(), double const maxResNorm = 1.e-3) {
ARPACKSOLVERDEBUGSTAT();
EM M;
int rc = pyarpackServices<RC, EM>::buildSparseMatrice(A, M, debug, "A");
@@ -54,7 +54,7 @@ class pyarpackSparseItrSolver: public arpackItrSolver<RC, FD, EM, SLV> {
rc = pyarpackServices<RC, EM>::buildSparseMatrice(B, N, debug, "B");
if (rc != 0) {pyarpackThrowError("build matrice from B KO"); return rc;}
}
return arpackItrSolver<RC, FD, EM, SLV>::checkEigVec(M, (stdPb ? NULL : &N), &diffTol);
return arpackItrSolver<RC, FD, EM, SLV>::checkEigVec(M, (stdPb ? NULL : &N), maxResNorm);
};
// Public members.
@@ -16,11 +16,11 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex128(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex128(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
A = (n, i, j, Aij) # coo format: dimension, i 0-based indices, j 0-based indices, Aij values.
@@ -77,14 +77,14 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.complex64(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex64(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex64(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
for k, l, Bkl in zip(i, j, Bij):
+8 -15
View File
@@ -16,11 +16,11 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex128(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex(-100., -100.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex128(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( -100., 100.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
A = (n, i, j, Aij) # coo format: dimension, i 0-based indices, j 0-based indices, Aij values.
@@ -69,7 +69,6 @@ n = 8
i = np.array([], dtype='@PYINT@')
j = np.array([], dtype='@PYINT@')
Aij = np.array([], dtype='complex64')
Bij = np.array([], dtype='complex64')
for k in range(n):
for l in [k-1, k, k+1]:
if l < 0 or l > n-1:
@@ -77,20 +76,14 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.complex64(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex64(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex(-100., -100.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex64(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( -100., 100.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
for k, l, Bkl in zip(i, j, Bij):
print("B[", k, ",", l, "] =", Bkl)
A = (n, i, j, Aij) # coo format: dimension, i 1-based indices, j 1-based indices, Aij values.
B = (n, i, j, Bij) # coo format: dimension, i 1-based indices, j 1-based indices, Bij values.
# Get and tune arpack solver.
@@ -111,9 +104,9 @@ arpackSlv.symPb = False
# Solve eigen problem.
rc = arpackSlv.solve(A, B)
rc = arpackSlv.solve(A)
assert rc == 0, "bad solve"
rc = arpackSlv.checkEigVec(A, B, 1.)
rc = arpackSlv.checkEigVec(A)
assert rc == 0, "bad checkEigVec"
# Print out results (mode selected, eigen vectors, eigen values, ...).
+15 -21
View File
@@ -8,7 +8,7 @@ from pyarpack import sparseLDLT as pyarpackSlv
n = 4
i = np.array([], dtype='@PYINT@')
j = np.array([], dtype='@PYINT@')
Aij = np.array([], dtype='complex128')
Aij = np.array([], dtype='float64')
for k in range(n):
for l in [k-1, k, k+1]:
if l < 0 or l > n-1:
@@ -16,18 +16,16 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex128(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex128(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.float64( 200.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1 or l == k+1:
Aij = np.append(Aij, np.float64(-100.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
A = (n, i, j, Aij) # coo format: dimension, i 0-based indices, j 0-based indices, Aij values.
# Get and tune arpack solver.
arpackSlv = pyarpackSlv.complexDouble() # Caution: complexDouble <=> np.array(..., dtype='complex128')
arpackSlv = pyarpackSlv.double() # Caution: double <=> np.array(..., dtype='float64')
arpackSlv.verbose = 3 # Set to 0 to get a quiet solve.
arpackSlv.debug = 1 # Set to 0 to get a quiet solve.
arpackSlv.nbEV = 1
@@ -36,7 +34,7 @@ arpackSlv.mag = 'LM'
arpackSlv.maxIt = 200
arpackSlv.slvOffset = 0.
arpackSlv.slvScale = 1.
arpackSlv.symPb = False
arpackSlv.symPb = True
# Solve eigen problem.
@@ -66,8 +64,8 @@ print("\n#######################################################################
n = 8
i = np.array([], dtype='@PYINT@')
j = np.array([], dtype='@PYINT@')
Aij = np.array([], dtype='complex64')
Bij = np.array([], dtype='complex64')
Aij = np.array([], dtype='float32')
Bij = np.array([], dtype='float32')
for k in range(n):
for l in [k-1, k, k+1]:
if l < 0 or l > n-1:
@@ -75,14 +73,11 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.complex64(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex64(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex64(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.float32( 200.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 33.3)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1 or l == k+1:
Aij = np.append(Aij, np.float32(-100.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 16.6)) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
for k, l, Bkl in zip(i, j, Bij):
@@ -92,7 +87,7 @@ B = (n, i, j, Bij) # coo format: dimension, i 1-based indices, j 1-based indices
# Get and tune arpack solver.
arpackSlv = pyarpackSlv.complexFloat() # Caution: complexFloat <=> np.array(..., dtype='complex64')
arpackSlv = pyarpackSlv.float() # Caution: float <=> np.array(..., dtype='float32')
arpackSlv.verbose = 3 # Set to 0 to get a quiet solve.
arpackSlv.debug = 1 # Set to 0 to get a quiet solve.
arpackSlv.nbEV = 2
@@ -102,8 +97,7 @@ arpackSlv.maxIt = 200
arpackSlv.slvOffset = 0.
arpackSlv.slvScale = 1.
arpackSlv.sigmaReal = 1
arpackSlv.sigmaImag = 1
arpackSlv.symPb = False
arpackSlv.symPb = True
# Solve eigen problem.
+21 -14
View File
@@ -2,13 +2,12 @@
import numpy as np
from pyarpack import sparseLU as pyarpackSlv
# Build laplacian.
n = 4
i = np.array([], dtype='@PYINT@')
j = np.array([], dtype='@PYINT@')
Aij = np.array([], dtype='float64')
Aij = np.array([], dtype='complex128')
for k in range(n):
for l in [k-1, k, k+1]:
if l < 0 or l > n-1:
@@ -16,16 +15,18 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.float64( 200.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1 or l == k+1:
Aij = np.append(Aij, np.float64(-100.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex128(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex128(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
A = (n, i, j, Aij) # coo format: dimension, i 0-based indices, j 0-based indices, Aij values.
# Get and tune arpack solver.
arpackSlv = pyarpackSlv.double() # Caution: double <=> np.array(..., dtype='float64')
arpackSlv = pyarpackSlv.complexDouble() # Caution: complexDouble <=> np.array(..., dtype='complex128')
arpackSlv.verbose = 3 # Set to 0 to get a quiet solve.
arpackSlv.debug = 1 # Set to 0 to get a quiet solve.
arpackSlv.nbEV = 1
@@ -33,6 +34,7 @@ arpackSlv.nbCV = 2*arpackSlv.nbEV + 1
arpackSlv.mag = 'LM'
arpackSlv.maxIt = 200
arpackSlv.slvPvtThd = 1.e-6
arpackSlv.symPb = False
# Solve eigen problem.
@@ -62,8 +64,8 @@ print("\n#######################################################################
n = 8
i = np.array([], dtype='@PYINT@')
j = np.array([], dtype='@PYINT@')
Aij = np.array([], dtype='float32')
Bij = np.array([], dtype='float32')
Aij = np.array([], dtype='complex64')
Bij = np.array([], dtype='complex64')
for k in range(n):
for l in [k-1, k, k+1]:
if l < 0 or l > n-1:
@@ -71,11 +73,14 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.float32( 200.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 33.3)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1 or l == k+1:
Aij = np.append(Aij, np.float32(-100.)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.float32( 16.6)) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex64(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex64(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
for k, l, Bkl in zip(i, j, Bij):
@@ -85,7 +90,7 @@ B = (n, i, j, Bij) # coo format: dimension, i 1-based indices, j 1-based indices
# Get and tune arpack solver.
arpackSlv = pyarpackSlv.float() # Caution: float <=> np.array(..., dtype='float32')
arpackSlv = pyarpackSlv.complexFloat() # Caution: complexFloat <=> np.array(..., dtype='complex64')
arpackSlv.verbose = 3 # Set to 0 to get a quiet solve.
arpackSlv.debug = 1 # Set to 0 to get a quiet solve.
arpackSlv.nbEV = 2
@@ -94,6 +99,8 @@ arpackSlv.mag = 'LM'
arpackSlv.maxIt = 200
arpackSlv.slvPvtThd = 1.e-6
arpackSlv.sigmaReal = 1
arpackSlv.sigmaImag = 1
arpackSlv.symPb = False
# Solve eigen problem.
+9 -9
View File
@@ -16,11 +16,11 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex128(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex128(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex128(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
A = (n, i, j, Aij) # coo format: dimension, i 0-based indices, j 0-based indices, Aij values.
@@ -74,14 +74,14 @@ for k in range(n):
i = np.append(i, np.@PYINT@(k+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
j = np.append(j, np.@PYINT@(l+1)) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k:
Aij = np.append(Aij, np.complex64(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 33.3, 33.3))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k-1:
Aij = np.append(Aij, np.complex64(np.complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
if l == k+1:
Aij = np.append(Aij, np.complex64(np.complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(np.complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Aij = np.append(Aij, np.complex64(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
for k, l, Akl in zip(i, j, Aij):
print("A[", k, ",", l, "] =", Akl)
for k, l, Bkl in zip(i, j, Bij):
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SIMPLE = sssimp dssimp snsimp dnsimp cnsimp znsimp
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SVD = ssvd dsvd
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SSDRV = ssdrv1 ssdrv2 ssdrv3 ssdrv4 ssdrv5 ssdrv6
DSDRV = dsdrv1 dsdrv2 dsdrv3 dsdrv4 dsdrv5 dsdrv6
+1 -2
View File
@@ -1,7 +1,6 @@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
pkgincludedir = $(includedir)/arpack
pkgincludedir = $(includedir)/arpack@ITF64SUFFIX@
pkginclude_HEADERS = debug_c.h debug_c.hpp
pkginclude_HEADERS += stat_c.h stat_c.hpp
pkginclude_HEADERS += arpack.h arpack.hpp
+4 -4
View File
@@ -7,8 +7,8 @@
extern "C" {
#endif
void cnaupd_c(a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, float _Complex* resid, a_int ncv, float _Complex* v, a_int ldv, a_int* iparam, a_int* ipntr, float _Complex* workd, float _Complex* workl, a_int lworkl, float* rwork, a_int* info);
void cneupd_c(a_int rvec, char const* howmny, a_int const* select, float _Complex* d, float _Complex* z, a_int ldz, float _Complex sigma, float _Complex* workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, float _Complex* resid, a_int ncv, float _Complex* v, a_int ldv, a_int* iparam, a_int* ipntr, float _Complex* workd, float _Complex* workl, a_int lworkl, float* rwork, a_int* info);
void cnaupd_c(a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, a_fcomplex* resid, a_int ncv, a_fcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_fcomplex* workd, a_fcomplex* workl, a_int lworkl, float* rwork, a_int* info);
void cneupd_c(a_int rvec, char const* howmny, a_int const* select, a_fcomplex* d, a_fcomplex* z, a_int ldz, a_fcomplex sigma, a_fcomplex* workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, a_fcomplex* resid, a_int ncv, a_fcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_fcomplex* workd, a_fcomplex* workl, a_int lworkl, float* rwork, a_int* info);
void dnaupd_c(a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void dneupd_c(a_int rvec, char const* howmny, a_int const* select, double* dr, double* di, double* z, a_int ldz, double sigmar, double sigmai, double * workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void dsaupd_c(a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
@@ -17,8 +17,8 @@ void snaupd_c(a_int* ido, char const* bmat, a_int n, char const* which, a_int ne
void sneupd_c(a_int rvec, char const* howmny, a_int const* select, float* dr, float* di, float* z, a_int ldz, float sigmar, float sigmai, float * workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void ssaupd_c(a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void sseupd_c(a_int rvec, char const* howmny, a_int const* select, float* d, float* z, a_int ldz, float sigma, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void znaupd_c(a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double _Complex* resid, a_int ncv, double _Complex* v, a_int ldv, a_int* iparam, a_int* ipntr, double _Complex* workd, double _Complex* workl, a_int lworkl, double* rwork, a_int* info);
void zneupd_c(a_int rvec, char const* howmny, a_int const* select, double _Complex* d, double _Complex* z, a_int ldz, double _Complex sigma, double _Complex* workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, double _Complex* resid, a_int ncv, double _Complex* v, a_int ldv, a_int* iparam, a_int* ipntr, double _Complex* workd, double _Complex* workl, a_int lworkl, double* rwork, a_int* info);
void znaupd_c(a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, a_dcomplex* resid, a_int ncv, a_dcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_dcomplex* workd, a_dcomplex* workl, a_int lworkl, double* rwork, a_int* info);
void zneupd_c(a_int rvec, char const* howmny, a_int const* select, a_dcomplex* d, a_dcomplex* z, a_int ldz, a_dcomplex sigma, a_dcomplex* workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, a_dcomplex* resid, a_int ncv, a_dcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_dcomplex* workd, a_dcomplex* workl, a_int lworkl, double* rwork, a_int* info);
#ifdef __cplusplus
}
+48 -24
View File
@@ -16,6 +16,14 @@ enum class which : int {
largest_magnitude,
/// 'SM' - compute the NEV smallest (in magnitude) eigenvalues.
smallest_magnitude,
/// 'LR' - compute the NEV largest (real part) eigenvalues.
largest_real,
/// 'SR' - compute the NEV smallest (real part) eigenvalues.
smallest_real,
/// 'LI' - compute the NEV largest (imaginary part) eigenvalues.
largest_imaginary,
/// 'SI' - compute the NEV smallest (imaginary part) eigenvalues.
smallest_imaginary,
/// 'BE' - compute NEV eigenvalues, half from each end of the
/// spectrum. When NEV is odd, compute one more from the
/// high end than from the low end.
@@ -60,6 +68,22 @@ inline char const* convert_to_char(which const option) {
return "SM";
break;
}
case which::largest_real: {
return "LR";
break;
}
case which::smallest_real: {
return "SR";
break;
}
case which::largest_imaginary: {
return "LI";
break;
}
case which::smallest_imaginary: {
return "SI";
break;
}
case which::both_ends: {
return "BE";
break;
@@ -186,10 +210,10 @@ inline void naupd(a_int& ido, bmat const bmat_option, a_int n,
float* rwork, a_int& info) {
internal::cnaupd_c(&ido, internal::convert_to_char(bmat_option), n,
internal::convert_to_char(ritz_option), nev, tol,
reinterpret_cast<_Complex float*>(resid), ncv,
reinterpret_cast<_Complex float*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex float*>(workd),
reinterpret_cast<_Complex float*>(workl), lworkl,
reinterpret_cast<a_fcomplex*>(resid), ncv,
reinterpret_cast<a_fcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_fcomplex*>(workd),
reinterpret_cast<a_fcomplex*>(workl), lworkl,
rwork, &info);
}
@@ -203,16 +227,16 @@ inline void neupd(a_int rvec, howmny const howmny_option, a_int* select,
a_int lworkl, float* rwork, a_int& info) {
std::complex<float> sigma2 = sigma;
internal::cneupd_c(rvec, internal::convert_to_char(howmny_option), select,
reinterpret_cast<_Complex float*>(d),
reinterpret_cast<_Complex float*>(z), ldz,
*reinterpret_cast<_Complex float*>(&sigma2),
reinterpret_cast<_Complex float*>(workev),
reinterpret_cast<a_fcomplex*>(d),
reinterpret_cast<a_fcomplex*>(z), ldz,
*reinterpret_cast<a_fcomplex*>(&sigma2),
reinterpret_cast<a_fcomplex*>(workev),
internal::convert_to_char(bmat_option), n,
internal::convert_to_char(ritz_option), nev, tol,
reinterpret_cast<_Complex float*>(resid), ncv,
reinterpret_cast<_Complex float*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex float*>(workd),
reinterpret_cast<_Complex float*>(workl), lworkl,
reinterpret_cast<a_fcomplex*>(resid), ncv,
reinterpret_cast<a_fcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_fcomplex*>(workd),
reinterpret_cast<a_fcomplex*>(workl), lworkl,
rwork, &info);
}
@@ -224,10 +248,10 @@ inline void naupd(a_int& ido, bmat const bmat_option, a_int n,
double* rwork, a_int& info) {
internal::znaupd_c(&ido, internal::convert_to_char(bmat_option), n,
internal::convert_to_char(ritz_option), nev, tol,
reinterpret_cast<_Complex double*>(resid), ncv,
reinterpret_cast<_Complex double*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex double*>(workd),
reinterpret_cast<_Complex double*>(workl), lworkl,
reinterpret_cast<a_dcomplex*>(resid), ncv,
reinterpret_cast<a_dcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_dcomplex*>(workd),
reinterpret_cast<a_dcomplex*>(workl), lworkl,
rwork, &info);
}
@@ -241,16 +265,16 @@ inline void neupd(a_int rvec, howmny const howmny_option, a_int* select,
a_int lworkl, double* rwork, a_int& info) {
std::complex<double> sigma2 = sigma;
internal::zneupd_c(rvec, internal::convert_to_char(howmny_option), select,
reinterpret_cast<_Complex double*>(d),
reinterpret_cast<_Complex double*>(z), ldz,
*reinterpret_cast<_Complex double*>(&sigma2),
reinterpret_cast<_Complex double*>(workev),
reinterpret_cast<a_dcomplex*>(d),
reinterpret_cast<a_dcomplex*>(z), ldz,
*reinterpret_cast<a_dcomplex*>(&sigma2),
reinterpret_cast<a_dcomplex*>(workev),
internal::convert_to_char(bmat_option), n,
internal::convert_to_char(ritz_option), nev, tol,
reinterpret_cast<_Complex double*>(resid), ncv,
reinterpret_cast<_Complex double*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex double*>(workd),
reinterpret_cast<_Complex double*>(workl), lworkl,
reinterpret_cast<a_dcomplex*>(resid), ncv,
reinterpret_cast<a_dcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_dcomplex*>(workd),
reinterpret_cast<a_dcomplex*>(workl), lworkl,
rwork, &info);
}
} // namespace arpack
+1 -1
View File
@@ -12,7 +12,7 @@ subroutine debug_c(logfil_c, ndigit_c, mgetv0_c,
integer(kind=i_int), value, intent(in) :: msaupd_c, msaup2_c, msaitr_c, mseigt_c, msapps_c, msgets_c, mseupd_c
integer(kind=i_int), value, intent(in) :: mnaupd_c, mnaup2_c, mnaitr_c, mneigh_c, mnapps_c, mngets_c, mneupd_c
integer(kind=i_int), value, intent(in) :: mcaupd_c, mcaup2_c, mcaitr_c, mceigh_c, mcapps_c, mcgets_c, mceupd_c
include 'debug.h'
include 'debugF90.h'
logfil = logfil_c
ndigit = ndigit_c
mgetv0 = mgetv0_c
+15 -10
View File
@@ -14,18 +14,23 @@
extern "C" {
#endif
void pcnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, float _Complex* resid, a_int ncv, float _Complex* v, a_int ldv, a_int* iparam, a_int* ipntr, float _Complex* workd, float _Complex* workl, a_int lworkl, float _Complex* rwork, a_int* info);
void pcneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, float _Complex* d, float _Complex* z, a_int ldz, float _Complex sigma, float _Complex* workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, float _Complex* resid, a_int ncv, float _Complex* v, a_int ldv, a_int* iparam, a_int* ipntr, float _Complex* workd, float _Complex* workl, a_int lworkl, float _Complex* rwork, a_int* info);
void pdnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void pdneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, double* dr, double* di, double* z, a_int ldz, double sigmar, double sigmai, double * workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void pdsaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void pdseupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, double* d, double* z, a_int ldz, double sigma, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void psnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void psneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, float* dr, float* di, float* z, a_int ldz, float sigmar, float sigmai, float * workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void pssaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void psseupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, float* d, float* z, a_int ldz, float sigma, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void pznaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double _Complex* resid, a_int ncv, double _Complex* v, a_int ldv, a_int* iparam, a_int* ipntr, double _Complex* workd, double _Complex* workl, a_int lworkl, double _Complex* rwork, a_int* info);
void pzneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, double _Complex* d, double _Complex* z, a_int ldz, double _Complex sigma, double _Complex* workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, double _Complex* resid, a_int ncv, double _Complex* v, a_int ldv, a_int* iparam, a_int* ipntr, double _Complex* workd, double _Complex* workl, a_int lworkl, double _Complex* rwork, a_int* info);
void pdsaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void pdseupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, double* d, double* z, a_int ldz, double sigma, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void psnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void psneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, float* dr, float* di, float* z, a_int ldz, float sigmar, float sigmai, float * workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, float* resid, a_int ncv, float* v, a_int ldv, a_int* iparam, a_int* ipntr, float* workd, float* workl, a_int lworkl, a_int* info);
void pdnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void pdneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, double* dr, double* di, double* z, a_int ldz, double sigmar, double sigmai, double * workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, double* resid, a_int ncv, double* v, a_int ldv, a_int* iparam, a_int* ipntr, double* workd, double* workl, a_int lworkl, a_int* info);
void pcnaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, float tol, a_fcomplex* resid, a_int ncv, a_fcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_fcomplex* workd, a_fcomplex* workl, a_int lworkl, float* rwork, a_int* info);
void pcneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, a_fcomplex* d, a_fcomplex* z, a_int ldz, a_fcomplex sigma, a_fcomplex* workev, char const* bmat, a_int n, char const* which, a_int nev, float tol, a_fcomplex* resid, a_int ncv, a_fcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_fcomplex* workd, a_fcomplex* workl, a_int lworkl, float* rwork, a_int* info);
void pznaupd_c(MPI_Fint comm, a_int* ido, char const* bmat, a_int n, char const* which, a_int nev, double tol, a_dcomplex* resid, a_int ncv, a_dcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_dcomplex* workd, a_dcomplex* workl, a_int lworkl, double* rwork, a_int* info);
void pzneupd_c(MPI_Fint comm, a_int rvec, char const* howmny, a_int const* select, a_dcomplex* d, a_dcomplex* z, a_int ldz, a_dcomplex sigma, a_dcomplex* workev, char const* bmat, a_int n, char const* which, a_int nev, double tol, a_dcomplex* resid, a_int ncv, a_dcomplex* v, a_int ldv, a_int* iparam, a_int* ipntr, a_dcomplex* workd, a_dcomplex* workl, a_int lworkl, double* rwork, a_int* info);
#ifdef __cplusplus
}
+32 -32
View File
@@ -111,14 +111,14 @@ inline void naupd(MPI_Fint comm, a_int& ido, bmat const bmat_option, a_int n,
std::complex<float>* resid, a_int ncv, std::complex<float>* v,
a_int ldv, a_int* iparam, a_int* ipntr, std::complex<float>* workd,
std::complex<float>* workl, a_int lworkl,
std::complex<float>* rwork, a_int& info) {
float* rwork, a_int& info) {
internal::pcnaupd_c(comm, &ido, internal::convert_to_char(bmat_option), n,
internal::convert_to_char(which_option), nev, tol,
reinterpret_cast<_Complex float*>(resid), ncv,
reinterpret_cast<_Complex float*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex float*>(workd),
reinterpret_cast<_Complex float*>(workl), lworkl,
reinterpret_cast<_Complex float*>(rwork), &info);
reinterpret_cast<a_fcomplex*>(resid), ncv,
reinterpret_cast<a_fcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_fcomplex*>(workd),
reinterpret_cast<a_fcomplex*>(workl), lworkl,
rwork, &info);
}
inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
@@ -129,22 +129,22 @@ inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
std::complex<float>* resid, a_int ncv, std::complex<float>* v,
a_int ldv, a_int* iparam, a_int* ipntr, std::complex<float>* workd,
std::complex<float>* workl, a_int lworkl,
std::complex<float>* rwork, a_int& info)
float* rwork, a_int& info)
{
std::complex<float> sigma2 = sigma;
internal::pcneupd_c(comm, rvec, internal::convert_to_char(howmny_option),
select, reinterpret_cast<_Complex float*>(d),
reinterpret_cast<_Complex float*>(z), ldz,
*reinterpret_cast<_Complex float*>(&sigma2),
reinterpret_cast<_Complex float*>(workev),
select, reinterpret_cast<a_fcomplex*>(d),
reinterpret_cast<a_fcomplex*>(z), ldz,
*reinterpret_cast<a_fcomplex*>(&sigma2),
reinterpret_cast<a_fcomplex*>(workev),
internal::convert_to_char(bmat_option), n,
internal::convert_to_char(which_option), nev, tol,
reinterpret_cast<_Complex float*>(resid), ncv,
reinterpret_cast<_Complex float*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex float*>(workd),
reinterpret_cast<_Complex float*>(workl), lworkl,
reinterpret_cast<_Complex float*>(rwork), &info);
reinterpret_cast<a_fcomplex*>(resid), ncv,
reinterpret_cast<a_fcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_fcomplex*>(workd),
reinterpret_cast<a_fcomplex*>(workl), lworkl,
rwork, &info);
}
inline void naupd(MPI_Fint comm, a_int& ido, bmat const bmat_option, a_int n,
@@ -152,14 +152,14 @@ inline void naupd(MPI_Fint comm, a_int& ido, bmat const bmat_option, a_int n,
std::complex<double>* resid, a_int ncv, std::complex<double>* v,
a_int ldv, a_int* iparam, a_int* ipntr, std::complex<double>* workd,
std::complex<double>* workl, a_int lworkl,
std::complex<double>* rwork, a_int& info) {
double* rwork, a_int& info) {
internal::pznaupd_c(comm, &ido, internal::convert_to_char(bmat_option), n,
internal::convert_to_char(which_option), nev, tol,
reinterpret_cast<_Complex double*>(resid), ncv,
reinterpret_cast<_Complex double*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex double*>(workd),
reinterpret_cast<_Complex double*>(workl), lworkl,
reinterpret_cast<_Complex double*>(rwork), &info);
reinterpret_cast<a_dcomplex*>(resid), ncv,
reinterpret_cast<a_dcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_dcomplex*>(workd),
reinterpret_cast<a_dcomplex*>(workl), lworkl,
rwork, &info);
}
inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
@@ -170,20 +170,20 @@ inline void neupd(MPI_Fint comm, a_int rvec, howmny const howmny_option,
std::complex<double>* resid, a_int ncv, std::complex<double>* v,
a_int ldv, a_int* iparam, a_int* ipntr, std::complex<double>* workd,
std::complex<double>* workl, a_int lworkl,
std::complex<double>* rwork, a_int& info) {
double* rwork, a_int& info) {
std::complex<double> sigma2 = sigma;
internal::pzneupd_c(comm, rvec, internal::convert_to_char(howmny_option),
select, reinterpret_cast<_Complex double*>(d),
reinterpret_cast<_Complex double*>(z), ldz,
*reinterpret_cast<_Complex double*>(&sigma2),
reinterpret_cast<_Complex double*>(workev),
select, reinterpret_cast<a_dcomplex*>(d),
reinterpret_cast<a_dcomplex*>(z), ldz,
*reinterpret_cast<a_dcomplex*>(&sigma2),
reinterpret_cast<a_dcomplex*>(workev),
internal::convert_to_char(bmat_option), n,
internal::convert_to_char(which_option), nev, tol,
reinterpret_cast<_Complex double*>(resid), ncv,
reinterpret_cast<_Complex double*>(v), ldv, iparam, ipntr,
reinterpret_cast<_Complex double*>(workd),
reinterpret_cast<_Complex double*>(workl), lworkl,
reinterpret_cast<_Complex double*>(rwork), &info);
reinterpret_cast<a_dcomplex*>(resid), ncv,
reinterpret_cast<a_dcomplex*>(v), ldv, iparam, ipntr,
reinterpret_cast<a_dcomplex*>(workd),
reinterpret_cast<a_dcomplex*>(workl), lworkl,
rwork, &info);
}
} // namespace arpack
#endif
+1 -1
View File
@@ -32,7 +32,7 @@ subroutine stat_c( nopx_c, nbx_c, nrorth_c, nitref_c, nrstrt_c,
tnaupd_c, tnaup2_c, tnaitr_c, tneigh_c, tngets_c, tnapps_c, tnconv_c,&
tcaupd_c, tcaup2_c, tcaitr_c, tceigh_c, tcgets_c, tcapps_c, tcconv_c,&
tmvopx_c, tmvbx_c, tgetv0_c, titref_c, trvec_c
include 'stat.h'
include 'statF90.h'
nopx_c = nopx
nbx_c = nbx
nrorth_c = nrorth
+7 -5
View File
@@ -1,7 +1,7 @@
ACLOCAL_AMFLAGS = -I m4
pkgincludedir = $(includedir)/arpack
pkginclude_HEADERS = debug.h stat.h arpackdef.h
pkgincludedir = $(includedir)/arpack@ITF64SUFFIX@
pkginclude_HEADERS = debug.h stat.h debugF90.h statF90.h arpackdef.h
AM_DISTCHECK_CONFIGURE_FLAGS =
if MPI
@@ -9,9 +9,10 @@ AM_DISTCHECK_CONFIGURE_FLAGS += --enable-mpi
endif
if ICB
AM_DISTCHECK_CONFIGURE_FLAGS += --enable-icb
pkginclude_HEADERS += arpackicb.h
endif
if ICBEXMM
AM_DISTCHECK_CONFIGURE_FLAGS += --enable-icb-exmm
if EIGEN
AM_DISTCHECK_CONFIGURE_FLAGS += --enable-eigen
endif
SUBDIRS = .
@@ -27,4 +28,5 @@ EXTRA_DIST = README.md PARPACK_CHANGES CHANGES DOCUMENTS VISUAL_STUDIO \
detect_arpack_bug.m4 CMakeLists.txt
cmakedir = $(libdir)/cmake/arpack-ng
cmake_DATA = arpack-ng-config.cmake arpack-ng-config-version.cmake
cmake_DATA = cmake/arpackng-config-version.cmake \
cmake/arpackng-config.cmake
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/PARPACK/SRC/BLACS/libparpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
LDADD = $(top_builddir)/PARPACK/SRC/BLACS/libparpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SNDRV = psndrv1 psndrv3
DNDRV = pdndrv1 pdndrv3
+1 -1
View File
@@ -1,5 +1,5 @@
F77 = $(MPIF77)
LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SNDRV = psndrv1 psndrv3
DNDRV = pdndrv1 pdndrv3
+5 -5
View File
@@ -14,10 +14,10 @@ ZSRC = pznaitr.f pznapps.f pznaup2.f pznaupd.f pzneigh.f pzneupd.f pzngets.f \
EXTRA_DIST = debug.h stat.h
lib_LTLIBRARIES = libparpack@LIBSUFFIX@.la
libparpack@LIBSUFFIX@_la_SOURCES = $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libparpack@LIBSUFFIX@_la_LIBADD = \
lib_LTLIBRARIES = libparpack@LIBSUFFIX@@ITF64SUFFIX@.la
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_SOURCES = $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_LIBADD = \
$(top_builddir)/PARPACK/UTIL/BLACS/libparpackutil.la \
$(top_builddir)/SRC/libarpack@LIBSUFFIX@.la \
$(top_builddir)/SRC/libarpack@LIBSUFFIX@@ITF64SUFFIX@.la \
$(LAPACK_LIBS) $(BLAS_LIBS)
libparpack@LIBSUFFIX@_la_LDFLAGS = -no-undefined -version-info 3:0:1
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_LDFLAGS = -no-undefined -version-info 3:0:1
+4 -4
View File
@@ -197,8 +197,8 @@ c
Real
& pscnorm2, slapy2
Complex
& cdotc
external cdotc, pscnorm2, slapy2
& ccdotc
external ccdotc, pscnorm2, slapy2
c
c %-----------------%
c | Data Statements |
@@ -335,7 +335,7 @@ c
c
first = .FALSE.
if (bmat .eq. 'G') then
cnorm = cdotc (n, resid, 1, workd, 1)
cnorm = ccdotc (n, resid, 1, workd, 1)
call cgsum2d( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
rnorm0 = sqrt(slapy2(real (cnorm),aimag(cnorm)))
else if (bmat .eq. 'I') then
@@ -394,7 +394,7 @@ c
end if
c
if (bmat .eq. 'G') then
cnorm = cdotc (n, resid, 1, workd, 1)
cnorm = ccdotc (n, resid, 1, workd, 1)
call cgsum2d( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
rnorm = sqrt(slapy2(real (cnorm),aimag(cnorm)))
else if (bmat .eq. 'I') then
+5 -5
View File
@@ -303,10 +303,10 @@ c | External Functions |
c %--------------------%
c
Complex
& cdotc
& ccdotc
Real
& pslamch, pscnorm2, clanhs, slapy2
external cdotc, pscnorm2, clanhs, pslamch, slapy2
external ccdotc, pscnorm2, clanhs, pslamch, slapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -573,7 +573,7 @@ c | Compute the B-norm of OP*v_{j}. |
c %-------------------------------------%
c
if (bmat .eq. 'G') then
cnorm = cdotc (n, resid, 1, workd(ipj), 1)
cnorm = ccdotc (n, resid, 1, workd(ipj), 1)
call cgsum2d( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
wnorm = sqrt( slapy2(real(cnorm),aimag(cnorm)) )
else if (bmat .eq. 'I') then
@@ -647,7 +647,7 @@ c | Compute the B-norm of r_{j}. |
c %------------------------------%
c
if (bmat .eq. 'G') then
cnorm = cdotc (n, resid, 1, workd(ipj), 1)
cnorm = ccdotc (n, resid, 1, workd(ipj), 1)
call cgsum2d( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
rnorm = sqrt( slapy2(real(cnorm),aimag(cnorm)) )
else if (bmat .eq. 'I') then
@@ -749,7 +749,7 @@ c | Compute the B-norm of the corrected residual r_{j}. |
c %-----------------------------------------------------%
c
if (bmat .eq. 'G') then
cnorm = cdotc (n, resid, 1, workd(ipj), 1)
cnorm = ccdotc (n, resid, 1, workd(ipj), 1)
call cgsum2d( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
rnorm1 = sqrt( slapy2(real(cnorm),aimag(cnorm)) )
else if (bmat .eq. 'I') then
+3 -3
View File
@@ -254,10 +254,10 @@ c | External functions |
c %--------------------%
c
Complex
& cdotc
& ccdotc
Real
& pscnorm2, pslamch, slapy2
external cdotc, pscnorm2, pslamch, slapy2
external ccdotc, pscnorm2, pslamch, slapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -767,7 +767,7 @@ c
end if
c
if (bmat .eq. 'G') then
cmpnorm = cdotc (n, resid, 1, workd, 1)
cmpnorm = ccdotc (n, resid, 1, workd, 1)
call cgsum2d( comm, 'All', ' ', 1, 1, cmpnorm, 1, -1, -1 )
rnorm = sqrt(slapy2(real(cmpnorm),aimag(cmpnorm)))
else if (bmat .eq. 'I') then
+3 -3
View File
@@ -340,8 +340,8 @@ c
external scnrm2,pslamch,slapy2
c
Complex
& cdotc
external cdotc
& ccdotc
external ccdotc
c
c %---------------------%
c | Intrinsic Functions |
@@ -743,7 +743,7 @@ c | upper triangular, thus the length of the |
c | inner product can be set to j. |
c %------------------------------------------%
c
workev(j) = cdotc(j, workl(ihbds), 1,
workev(j) = ccdotc(j, workl(ihbds), 1,
& workl(invsub+(j-1)*ldq), 1)
40 continue
c
+1 -1
View File
@@ -114,7 +114,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+1 -1
View File
@@ -120,7 +120,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+1 -1
View File
@@ -117,7 +117,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+1 -1
View File
@@ -120,7 +120,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+1 -1
View File
@@ -117,7 +117,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+4 -4
View File
@@ -197,8 +197,8 @@ c
Double precision
& pdznorm2 , dlapy2
Complex*16
& zdotc
external zdotc , pdznorm2 , dlapy2
& zzdotc
external zzdotc , pdznorm2 , dlapy2
c
c %-----------------%
c | Data Statements |
@@ -335,7 +335,7 @@ c
c
first = .FALSE.
if (bmat .eq. 'G') then
cnorm = zdotc (n, resid, 1, workd, 1)
cnorm = zzdotc (n, resid, 1, workd, 1)
call zgsum2d ( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
rnorm0 = sqrt(dlapy2 (dble (cnorm),dimag (cnorm)))
else if (bmat .eq. 'I') then
@@ -394,7 +394,7 @@ c
end if
c
if (bmat .eq. 'G') then
cnorm = zdotc (n, resid, 1, workd, 1)
cnorm = zzdotc (n, resid, 1, workd, 1)
call zgsum2d ( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
rnorm = sqrt(dlapy2 (dble (cnorm),dimag (cnorm)))
else if (bmat .eq. 'I') then
+5 -5
View File
@@ -303,10 +303,10 @@ c | External Functions |
c %--------------------%
c
Complex*16
& zdotc
& zzdotc
Double precision
& pdlamch, pdznorm2, zlanhs, dlapy2
external zdotc, pdznorm2, zlanhs, pdlamch, dlapy2
external zzdotc, pdznorm2, zlanhs, pdlamch, dlapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -573,7 +573,7 @@ c | Compute the B-norm of OP*v_{j}. |
c %-------------------------------------%
c
if (bmat .eq. 'G') then
cnorm = zdotc (n, resid, 1, workd(ipj), 1)
cnorm = zzdotc (n, resid, 1, workd(ipj), 1)
call zgsum2d( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
wnorm = sqrt( dlapy2(dble(cnorm),dimag(cnorm)) )
else if (bmat .eq. 'I') then
@@ -647,7 +647,7 @@ c | Compute the B-norm of r_{j}. |
c %------------------------------%
c
if (bmat .eq. 'G') then
cnorm = zdotc (n, resid, 1, workd(ipj), 1)
cnorm = zzdotc (n, resid, 1, workd(ipj), 1)
call zgsum2d( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
rnorm = sqrt( dlapy2(dble(cnorm),dimag(cnorm)) )
else if (bmat .eq. 'I') then
@@ -749,7 +749,7 @@ c | Compute the B-norm of the corrected residual r_{j}. |
c %-----------------------------------------------------%
c
if (bmat .eq. 'G') then
cnorm = zdotc (n, resid, 1, workd(ipj), 1)
cnorm = zzdotc (n, resid, 1, workd(ipj), 1)
call zgsum2d( comm, 'All', ' ', 1, 1, cnorm, 1, -1, -1 )
rnorm1 = sqrt( dlapy2(dble(cnorm),dimag(cnorm)) )
else if (bmat .eq. 'I') then
+3 -3
View File
@@ -254,10 +254,10 @@ c | External functions |
c %--------------------%
c
Complex*16
& zdotc
& zzdotc
Double precision
& pdznorm2, pdlamch, dlapy2
external zdotc, pdznorm2, pdlamch, dlapy2
external zzdotc, pdznorm2, pdlamch, dlapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -767,7 +767,7 @@ c
end if
c
if (bmat .eq. 'G') then
cmpnorm = zdotc (n, resid, 1, workd, 1)
cmpnorm = zzdotc (n, resid, 1, workd, 1)
call zgsum2d( comm, 'All', ' ', 1, 1, cmpnorm, 1, -1, -1 )
rnorm = sqrt(dlapy2(dble(cmpnorm),dimag(cmpnorm)))
else if (bmat .eq. 'I') then
+3 -3
View File
@@ -340,8 +340,8 @@ c
external dznrm2,pdlamch,dlapy2
c
Complex*16
& zdotc
external zdotc
& zzdotc
external zzdotc
c
c %---------------------%
c | Intrinsic Functions |
@@ -743,7 +743,7 @@ c | upper triangular, thus the length of the |
c | inner product can be set to j. |
c %------------------------------------------%
c
workev(j) = zdotc(j, workl(ihbds), 1,
workev(j) = zzdotc(j, workl(ihbds), 1,
& workl(invsub+(j-1)*ldq), 1)
40 continue
c
+1 -1
View File
@@ -114,7 +114,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+14 -21
View File
@@ -1,17 +1,15 @@
AUTOMAKE_OPTIONS = subdir-objects # Needed as debug/stat* are not in current directory.
F77 = $(MPIF77)
FFLAGS_SAV = @FFLAGS@
FFLAGS =
PSRC = pcontext.f
SSRC = psnaitr.f psnapps.f psnaup2.f psnaupd.f psneigh.f psneupd.f psngets.f \
pssaitr.f pssapps.f pssaup2.f pssaupd.f psseigt.f psseupd.f pssgets.f \
psgetv0.f pslarnv.f psnorm2.f
psgetv0.f pslarnv.f psnorm2.f pslamch10.f
DSRC = pdnaitr.f pdnapps.f pdnaup2.f pdnaupd.f pdneigh.f pdneupd.f pdngets.f \
pdsaitr.f pdsapps.f pdsaup2.f pdsaupd.f pdseigt.f pdseupd.f pdsgets.f \
pdgetv0.f pdlarnv.f pdnorm2.f
pdgetv0.f pdlarnv.f pdnorm2.f pdlamch10.f
CSRC = pcnaitr.f pcnapps.f pcnaup2.f pcnaupd.f pcneigh.f pcneupd.f pcngets.f \
pcgetv0.f pclarnv.f pscnorm2.f
@@ -28,26 +26,21 @@ endif
EXTRA_DIST = debug.h stat.h pcontext.h
noinst_LTLIBRARIES = libparpack@LIBSUFFIX@_noopt.la
libparpack@LIBSUFFIX@_noopt_la_SOURCES = pslamch10.f pdlamch10.f
libparpack@LIBSUFFIX@_noopt_la_FFLAGS = -O0
lib_LTLIBRARIES = libparpack@LIBSUFFIX@.la
libparpack@LIBSUFFIX@_la_SOURCES = $(PSRC) $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libparpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/dbgini.f
libparpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/staini.f
libparpack@LIBSUFFIX@_la_FFLAGS = $(FFLAGS_SAV)
libparpack@LIBSUFFIX@_la_LIBADD = libparpack@LIBSUFFIX@_noopt.la \
lib_LTLIBRARIES = libparpack@LIBSUFFIX@@ITF64SUFFIX@.la
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_SOURCES = $(PSRC) $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_SOURCES += $(top_builddir)/dbgini.f
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_SOURCES += $(top_builddir)/staini.f
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_LIBADD = \
$(top_builddir)/PARPACK/UTIL/MPI/libparpackutil.la \
$(top_builddir)/SRC/libarpack@LIBSUFFIX@.la \
$(top_builddir)/SRC/libarpack@LIBSUFFIX@@ITF64SUFFIX@.la \
$(LAPACK_LIBS) $(BLAS_LIBS) $(MPI_Fortran_LIBS)
libparpack@LIBSUFFIX@_la_LDFLAGS = -no-undefined -version-info 3:0:1
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_LDFLAGS = -no-undefined -version-info 3:0:1
if ICB
libparpack@LIBSUFFIX@_la_LIBADD += $(top_builddir)/ICB/libdbgicb.la $(top_builddir)/ICB/libstaicb.la
libparpack@LIBSUFFIX@_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_LIBADD += $(top_builddir)/ICB/libdbgicb.la $(top_builddir)/ICB/libstaicb.la
libparpack@LIBSUFFIX@@ITF64SUFFIX@_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)
endif
pkgconfig_DATA = parpack@LIBSUFFIX@.pc
pkgconfig_DATA = parpack@LIBSUFFIX@@ITF64SUFFIX@.pc
# Due to the LIBSUFFIX, configure doesn't automatically clean this file:
DISTCLEANFILES = parpack@LIBSUFFIX@.pc
# Due to the LIBSUFFIX/ITF64SUFFIX, configure doesn't automatically clean this file:
DISTCLEANFILES = parpack@LIBSUFFIX@@ITF64SUFFIX@.pc
+16 -2
View File
@@ -4,9 +4,16 @@ subroutine pcnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, rwork, info) &
bind(c, name="pcnaupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), intent(inout) :: ido
character(kind=c_char), intent(in) :: bmat
integer(kind=i_int), value, intent(in) :: n
@@ -22,7 +29,7 @@ subroutine pcnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
complex(kind=c_float_complex),dimension(3*n), intent(out) :: workd
complex(kind=c_float_complex),dimension(lworkl), intent(out) :: workl
integer(kind=i_int), value, intent(in) :: lworkl
complex(kind=c_float_complex),dimension(ncv), intent(out) :: rwork
real(kind=c_float), dimension(ncv), intent(out) :: rwork
integer(kind=i_int), intent(inout) :: info
character(len=2):: w
@@ -41,9 +48,16 @@ subroutine pcneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
iparam, ipntr, workd, workl, lworkl, rwork, info) &
bind(c, name="pcneupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), value, intent(in) :: rvec
character(kind=c_char), intent(in) :: howmny
integer(kind=i_int), dimension(ncv), intent(in) :: select
@@ -66,7 +80,7 @@ subroutine pcneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
complex(kind=c_float_complex),dimension(3*n), intent(out) :: workd
complex(kind=c_float_complex),dimension(lworkl), intent(out) :: workl
integer(kind=i_int), value, intent(in) :: lworkl
complex(kind=c_float_complex),dimension(ncv), intent(out) :: rwork
real(kind=c_float), dimension(ncv), intent(out) :: rwork
integer(kind=i_int), intent(inout) :: info
! convert parameters if needed.
+14
View File
@@ -4,9 +4,16 @@ subroutine pdnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pdnaupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), intent(inout) :: ido
character(kind=c_char), intent(in) :: bmat
integer(kind=i_int), value, intent(in) :: n
@@ -41,9 +48,16 @@ subroutine pdneupd_c(comm, rvec, howmny, select, &
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pdneupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), value, intent(in) :: rvec
character(kind=c_char), intent(in) :: howmny
integer(kind=i_int), dimension(ncv), intent(in) :: select
+14
View File
@@ -4,9 +4,16 @@ subroutine pdsaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pdsaupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), intent(inout) :: ido
character(kind=c_char), intent(in) :: bmat
integer(kind=i_int), value, intent(in) :: n
@@ -40,9 +47,16 @@ subroutine pdseupd_c(comm, rvec, howmny, select, d, z, ldz, sigma,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pdseupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), value, intent(in) :: rvec
character(kind=c_char), intent(in) :: howmny
integer(kind=i_int), dimension(ncv), intent(in) :: select
+14
View File
@@ -4,9 +4,16 @@ subroutine psnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="psnaupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), intent(inout) :: ido
character(kind=c_char), intent(in) :: bmat
integer(kind=i_int), value, intent(in) :: n
@@ -41,9 +48,16 @@ subroutine psneupd_c(comm, rvec, howmny, select, &
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="psneupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), value, intent(in) :: rvec
character(kind=c_char), intent(in) :: howmny
integer(kind=i_int), dimension(ncv), intent(in) :: select
+14
View File
@@ -4,9 +4,16 @@ subroutine pssaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pssaupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), intent(inout) :: ido
character(kind=c_char), intent(in) :: bmat
integer(kind=i_int), value, intent(in) :: n
@@ -40,9 +47,16 @@ subroutine psseupd_c(comm, rvec, howmny, select, d, z, ldz, sigma,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="psseupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), value, intent(in) :: rvec
character(kind=c_char), intent(in) :: howmny
integer(kind=i_int), dimension(ncv), intent(in) :: select
+16 -2
View File
@@ -4,9 +4,16 @@ subroutine pznaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, rwork, info) &
bind(c, name="pznaupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), intent(inout) :: ido
character(kind=c_char), intent(in) :: bmat
integer(kind=i_int), value, intent(in) :: n
@@ -22,7 +29,7 @@ subroutine pznaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
complex(kind=c_double_complex), dimension(3*n), intent(out) :: workd
complex(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=i_int), value, intent(in) :: lworkl
complex(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
real(kind=c_double), dimension(ncv), intent(out) :: rwork
integer(kind=i_int), intent(inout) :: info
character(len=2):: w
@@ -41,9 +48,16 @@ subroutine pzneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
iparam, ipntr, workd, workl, lworkl, rwork, info) &
bind(c, name="pzneupd_c")
use :: iso_c_binding
#ifdef HAVE_MPI_ICB
use :: mpi_f08
#endif
implicit none
#include "arpackicb.h"
#ifdef HAVE_MPI_ICB
type(MPI_Comm), value, intent(in) :: comm
#else
integer(kind=i_int), value, intent(in) :: comm
#endif
integer(kind=i_int), value, intent(in) :: rvec
character(kind=c_char), intent(in) :: howmny
integer(kind=i_int), dimension(ncv), intent(in) :: select
@@ -66,7 +80,7 @@ subroutine pzneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
complex(kind=c_double_complex), dimension(3*n), intent(out) :: workd
complex(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=i_int), value, intent(in) :: lworkl
complex(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
real(kind=c_double), dimension(ncv), intent(out) :: rwork
integer(kind=i_int), intent(inout) :: info
! convert parameters if needed.
+4 -2
View File
@@ -1,11 +1,13 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: @PACKAGE_NAME@
Description: Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems
Version: @PACKAGE_VERSION@
URL: @PACKAGE_URL@
Requires.private: arpack@LIBSUFFIX@
Libs: -L${libdir} -lparpack@LIBSUFFIX@
Requires.private: arpack@LIBSUFFIX@@ITF64SUFFIX@
Libs: -L${libdir} -lparpack@LIBSUFFIX@@ITF64SUFFIX@
Libs.private: @PARPACK_PC_LIBS_PRIVATE@
Cflags: -I${includedir}/arpack@ITF64SUFFIX@
+4 -4
View File
@@ -200,8 +200,8 @@ c
Real
& pscnorm2, slapy2
Complex
& cdotc
external cdotc, pscnorm2, slapy2
& ccdotc
external ccdotc, pscnorm2, slapy2
c
c %-----------------%
c | Data Statements |
@@ -331,7 +331,7 @@ c
c
first = .FALSE.
if (bmat .eq. 'G') then
cnorm_buf = cdotc (n, resid, 1, workd, 1)
cnorm_buf = ccdotc (n, resid, 1, workd, 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_COMPLEX, MPI_SUM, comm, ierr )
cnorm = buf2(1)
@@ -393,7 +393,7 @@ c
end if
c
if (bmat .eq. 'G') then
cnorm_buf = cdotc (n, resid, 1, workd, 1)
cnorm_buf = ccdotc (n, resid, 1, workd, 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_COMPLEX, MPI_SUM, comm, ierr )
cnorm = buf2(1)
+5 -5
View File
@@ -307,10 +307,10 @@ c | External Functions |
c %--------------------%
c
Complex
& cdotc
& ccdotc
Real
& pslamch10, pscnorm2, clanhs, slapy2
external cdotc, pscnorm2, clanhs, pslamch10, slapy2
external ccdotc, pscnorm2, clanhs, pslamch10, slapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -576,7 +576,7 @@ c | Compute the B-norm of OP*v_{j}. |
c %-------------------------------------%
c
if (bmat .eq. 'G') then
cnorm_buf = cdotc (n, resid, 1, workd(ipj), 1)
cnorm_buf = ccdotc (n, resid, 1, workd(ipj), 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_COMPLEX, MPI_SUM, comm, ierr )
cnorm = buf2(1)
@@ -653,7 +653,7 @@ c | Compute the B-norm of r_{j}. |
c %------------------------------%
c
if (bmat .eq. 'G') then
cnorm_buf = cdotc (n, resid, 1, workd(ipj), 1)
cnorm_buf = ccdotc (n, resid, 1, workd(ipj), 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_COMPLEX, MPI_SUM, comm, ierr )
cnorm = buf2(1)
@@ -758,7 +758,7 @@ c | Compute the B-norm of the corrected residual r_{j}. |
c %-----------------------------------------------------%
c
if (bmat .eq. 'G') then
cnorm_buf = cdotc (n, resid, 1, workd(ipj), 1)
cnorm_buf = ccdotc (n, resid, 1, workd(ipj), 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_COMPLEX, MPI_SUM, comm, ierr )
cnorm = buf2(1)
+3 -3
View File
@@ -257,10 +257,10 @@ c | External functions |
c %--------------------%
c
Complex
& cdotc
& ccdotc
Real
& pscnorm2, pslamch10, slapy2
external cdotc, pscnorm2, pslamch10, slapy2
external ccdotc, pscnorm2, pslamch10, slapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -770,7 +770,7 @@ c
end if
c
if (bmat .eq. 'G') then
cmpnorm_buf = cdotc (n, resid, 1, workd, 1)
cmpnorm_buf = ccdotc (n, resid, 1, workd, 1)
call MPI_ALLREDUCE( [cmpnorm_buf], buf2, 1,
& MPI_COMPLEX, MPI_SUM, comm, ierr )
cmpnorm = buf2(1)
+12 -12
View File
@@ -54,11 +54,11 @@ c COMM MPI Communicator for the processor grid. (INPUT)
c
c IDO Integer. (INPUT/OUTPUT)
c Reverse communication flag. IDO must be zero on the first
c call to pcnaupd. IDO will be set internally to
c call to pcnaupd. IDO will be set internally to
c indicate the type of operation to be performed. Control is
c then given back to the calling routine which has the
c responsibility to carry out the requested operation and call
c pcnaupd with the result. The operand is given in
c pcnaupd with the result. The operand is given in
c WORKD(IPNTR(1)), the result must be put in WORKD(IPNTR(2)).
c -------------------------------------------------------------
c IDO = 0: first call to the reverse communication interface
@@ -312,7 +312,7 @@ c\Data Distribution Note:
c
c Fortran-D syntax:
c ================
c Complex resid(n), v(ldv,ncv), workd(3*n), workl(lworkl)
c Complex resid(n), v(ldv,ncv), workd(3*n), workl(lworkl)
c decompose d1(n), d2(n,ncv)
c align resid(i) with d1(i)
c align v(i,j) with d2(i,j)
@@ -324,7 +324,7 @@ c replicated workl(lworkl)
c
c Cray MPP syntax:
c ===============
c Complex resid(n), v(ldv,ncv), workd(n,3), workl(lworkl)
c Complex resid(n), v(ldv,ncv), workd(n,3), workl(lworkl)
c shared resid(block), v(block,:), workd(block,:)
c replicated workl(lworkl)
c
@@ -354,13 +354,13 @@ c _Real_ Matrices", Linear Algebra and its Applications, vol 88/89,
c pp 575-595, (1987).
c
c\Routines called:
c pcnaup2 Parallel ARPACK routine that implements the Implicitly Restarted
c Arnoldi Iteration.
c cstatn ARPACK routine that initializes the timing variables.
c pivout Parallel ARPACK utility routine that prints integers.
c pcvout Parallel ARPACK utility routine that prints vectors.
c arscnd ARPACK utility routine for timing.
c pslamch10 ScaLAPACK routine that determines machine constants.
c pcnaup2 Parallel ARPACK routine that implements the Implicitly Restarted
c Arnoldi Iteration.
c cstatn ARPACK routine that initializes the timing variables.
c pivout Parallel ARPACK utility routine that prints integers.
c pcvout Parallel ARPACK utility routine that prints vectors.
c arscnd ARPACK utility routine for timing.
c pslamch10 ScaLAPACK routine that determines machine constants.
c
c\Author
c Danny Sorensen Phuong Vu
@@ -389,7 +389,7 @@ c
& ( comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,
& iparam, ipntr, workd, workl, lworkl, rwork, info )
c
include 'pcontext.h'
include 'pcontext.h'
include 'mpif.h'
c
c %------------------%
+3 -3
View File
@@ -340,8 +340,8 @@ c
external scnrm2,pslamch10,slapy2
c
Complex
& cdotc
external cdotc
& ccdotc
external ccdotc
c
c %---------------------%
c | Intrinsic Functions |
@@ -743,7 +743,7 @@ c | upper triangular, thus the length of the |
c | inner product can be set to j. |
c %------------------------------------------%
c
workev(j) = cdotc(j, workl(ihbds), 1,
workev(j) = ccdotc(j, workl(ihbds), 1,
& workl(invsub+(j-1)*ldq), 1)
40 continue
c
+1 -1
View File
@@ -114,7 +114,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+23 -6
View File
@@ -178,7 +178,7 @@ c | Local Scalars & Arrays |
c %------------------------%
c
logical first, inits, orth
integer idist, iseed(4), iter, msglvl, jj
integer idist, iseed(4), iter, msglvl, jj, myid, igen
Double precision
& rnorm0, buf2(1)
save first, iseed, inits, iter, msglvl, orth, rnorm0
@@ -223,11 +223,28 @@ c | random number generator |
c %-----------------------------------%
c
if (inits) then
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
inits = .false.
c
c %-----------------------------------%
c | Generate a seed on each processor |
c | using process id (myid). |
c | Note: the seed must be between 1 |
c | and 4095. iseed(4) must be odd. |
c %-----------------------------------%
c
call MPI_COMM_RANK(comm, myid, ierr)
igen = 1000 + 2*myid + 1
if (igen .gt. 4095) then
write(0,*) 'Error in p_getv0: seed exceeds 4095!'
end if
c
iseed(1) = igen/1000
igen = mod(igen,1000)
iseed(2) = igen/100
igen = mod(igen,100)
iseed(3) = igen/10
iseed(4) = mod(igen,10)
c
inits = .false.
end if
c
if (ido .eq. 0) then
+1 -1
View File
@@ -331,7 +331,7 @@ c
call dlabad( unfl, ovfl )
ulp = pdlamch10( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
aitr_first = .false.
end if
c
if (ido .eq. 0) then
+1 -1
View File
@@ -120,7 +120,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+1 -1
View File
@@ -117,7 +117,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+23 -11
View File
@@ -178,7 +178,7 @@ c | Local Scalars & Arrays |
c %------------------------%
c
logical first, inits, orth
integer idist, iseed(4), iter, msglvl, jj
integer idist, iseed(4), iter, msglvl, jj, myid, igen
Real
& rnorm0
save first, iseed, inits, iter, msglvl, orth, rnorm0
@@ -216,18 +216,30 @@ c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
c
c %-----------------------------------%
c | Initialize the seed of the LAPACK |
c | random number generator |
c %-----------------------------------%
c
if (inits) then
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
inits = .false.
c
c %-----------------------------------%
c | Generate a seed on each processor |
c | using process id (myid). |
c | Note: the seed must be between 1 |
c | and 4095. iseed(4) must be odd. |
c %-----------------------------------%
c
call MPI_COMM_RANK(comm, myid, ierr)
igen = 1000 + 2*myid + 1
if (igen .gt. 4095) then
write(0,*) 'Error in p_getv0: seed exceeds 4095!'
end if
c
iseed(1) = igen/1000
igen = mod(igen,1000)
iseed(2) = igen/100
igen = mod(igen,100)
iseed(3) = igen/10
iseed(4) = mod(igen,10)
c
inits = .false.
end if
c
if (ido .eq. 0) then
+1 -1
View File
@@ -120,7 +120,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+1 -1
View File
@@ -117,7 +117,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+4 -4
View File
@@ -200,8 +200,8 @@ c
Double precision
& pdznorm2 , dlapy2
Complex*16
& zdotc
external zdotc , pdznorm2 , dlapy2
& zzdotc
external zzdotc , pdznorm2 , dlapy2
c
c %-----------------%
c | Data Statements |
@@ -331,7 +331,7 @@ c
c
first = .FALSE.
if (bmat .eq. 'G') then
cnorm_buf = zdotc (n, resid, 1, workd, 1)
cnorm_buf = zzdotc (n, resid, 1, workd, 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_DOUBLE_COMPLEX , MPI_SUM, comm, ierr )
cnorm = buf2(1)
@@ -393,7 +393,7 @@ c
end if
c
if (bmat .eq. 'G') then
cnorm_buf = zdotc (n, resid, 1, workd, 1)
cnorm_buf = zzdotc (n, resid, 1, workd, 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_DOUBLE_COMPLEX , MPI_SUM, comm, ierr )
cnorm = buf2(1)
+5 -5
View File
@@ -307,10 +307,10 @@ c | External Functions |
c %--------------------%
c
Complex*16
& zdotc
& zzdotc
Double precision
& pdlamch10, pdznorm2, zlanhs, dlapy2
external zdotc, pdznorm2, zlanhs, pdlamch10, dlapy2
external zzdotc, pdznorm2, zlanhs, pdlamch10, dlapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -576,7 +576,7 @@ c | Compute the B-norm of OP*v_{j}. |
c %-------------------------------------%
c
if (bmat .eq. 'G') then
cnorm_buf = zdotc (n, resid, 1, workd(ipj), 1)
cnorm_buf = zzdotc (n, resid, 1, workd(ipj), 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_DOUBLE_COMPLEX, MPI_SUM, comm, ierr )
cnorm = buf2(1)
@@ -653,7 +653,7 @@ c | Compute the B-norm of r_{j}. |
c %------------------------------%
c
if (bmat .eq. 'G') then
cnorm_buf = zdotc (n, resid, 1, workd(ipj), 1)
cnorm_buf = zzdotc (n, resid, 1, workd(ipj), 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_DOUBLE_COMPLEX, MPI_SUM, comm, ierr )
cnorm = buf2(1)
@@ -758,7 +758,7 @@ c | Compute the B-norm of the corrected residual r_{j}. |
c %-----------------------------------------------------%
c
if (bmat .eq. 'G') then
cnorm_buf = zdotc (n, resid, 1, workd(ipj), 1)
cnorm_buf = zzdotc (n, resid, 1, workd(ipj), 1)
call MPI_ALLREDUCE( [cnorm_buf], buf2, 1,
& MPI_DOUBLE_COMPLEX, MPI_SUM, comm, ierr )
cnorm = buf2(1)
+3 -3
View File
@@ -257,10 +257,10 @@ c | External functions |
c %--------------------%
c
Complex*16
& zdotc
& zzdotc
Double precision
& pdznorm2, pdlamch10, dlapy2
external zdotc, pdznorm2, pdlamch10, dlapy2
external zzdotc, pdznorm2, pdlamch10, dlapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -770,7 +770,7 @@ c
end if
c
if (bmat .eq. 'G') then
cmpnorm_buf = zdotc (n, resid, 1, workd, 1)
cmpnorm_buf = zzdotc (n, resid, 1, workd, 1)
call MPI_ALLREDUCE( [cmpnorm_buf], buf2, 1,
& MPI_DOUBLE_COMPLEX, MPI_SUM, comm, ierr )
cmpnorm = buf2(1)
+21 -21
View File
@@ -9,14 +9,14 @@ c Reverse communication interface for the Implicitly Restarted Arnoldi
c iteration. This is intended to be used to find a few eigenpairs of a
c complex linear operator OP with respect to a semi-inner product defined
c by a hermitian positive semi-definite real matrix B. B may be the identity
c matrix. NOTE: if both OP and B are real, then dsaupd or dnaupd should
c matrix. NOTE: if both OP and B are real, then dsaupd or dnaupd should
c be used.
c
c
c The computed approximate eigenvalues are called Ritz values and
c the corresponding approximate eigenvectors are called Ritz vectors.
c
c pznaupd is usually called iteratively to solve one of the
c pznaupd is usually called iteratively to solve one of the
c following problems:
c
c Mode 1: A*x = lambda*x.
@@ -54,11 +54,11 @@ c COMM MPI Communicator for the processor grid. (INPUT)
c
c IDO Integer. (INPUT/OUTPUT)
c Reverse communication flag. IDO must be zero on the first
c call to pznaupd . IDO will be set internally to
c call to pznaupd. IDO will be set internally to
c indicate the type of operation to be performed. Control is
c then given back to the calling routine which has the
c responsibility to carry out the requested operation and call
c pznaupd with the result. The operand is given in
c pznaupd with the result. The operand is given in
c WORKD(IPNTR(1)), the result must be put in WORKD(IPNTR(2)).
c -------------------------------------------------------------
c IDO = 0: first call to the reverse communication interface
@@ -108,8 +108,8 @@ c TOL Double precision scalar. (INPUT)
c Stopping criteria: the relative accuracy of the Ritz value
c is considered acceptable if BOUNDS(I) .LE. TOL*ABS(RITZ(I))
c where ABS(RITZ(I)) is the magnitude when RITZ(I) is complex.
c DEFAULT = pdlamch10 (comm, 'EPS') (machine precision as computed
c by the ScaLAPACK auxiliary subroutine pdlamch ).
c DEFAULT = pdlamch10(comm, 'EPS') (machine precision as computed
c by the ScaLAPACK auxiliary subroutine pdlamch10).
c
c RESID Complex*16 array of length N. (INPUT/OUTPUT)
c On INPUT:
@@ -171,7 +171,7 @@ c No longer referenced. Implicit restarting is ALWAYS used.
c
c IPARAM(7) = MODE
c On INPUT determines what type of eigenproblem is being solved.
c Must be 1,2,3; See under \Description of pznaupd for the
c Must be 1,2,3; See under \Description of pznaupd for the
c four modes available.
c
c IPARAM(8) = NP
@@ -201,7 +201,7 @@ c IPNTR(7): pointer to the (projected) ritz vector array Q
c IPNTR(8): pointer to the error BOUNDS array in WORKL.
c IPNTR(14): pointer to the NP shifts in WORKL. See Remark 5 below.
c
c Note: IPNTR(9:13) is only referenced by pzneupd . See Remark 2 below.
c Note: IPNTR(9:13) is only referenced by pzneupd. See Remark 2 below.
c
c IPNTR(9): pointer to the NCV RITZ values of the
c original system.
@@ -211,7 +211,7 @@ c IPNTR(12): pointer to the NCV by NCV upper triangular
c Schur matrix for H.
c IPNTR(13): pointer to the NCV by NCV matrix of eigenvectors
c of the upper Hessenberg matrix H. Only referenced by
c zneupd if RVEC = .TRUE. See Remark 2 below.
c zneupd if RVEC = .TRUE. See Remark 2 below.
c -------------------------------------------------------------
c
c WORKD Complex*16 work array of length 3*N. (REVERSE COMMUNICATION)
@@ -272,11 +272,11 @@ c selection of WHICH should be made with this in mind when using
c Mode = 3. When operating in Mode = 3 setting WHICH = 'LM' will
c compute the NEV eigenvalues of the original problem that are
c closest to the shift SIGMA . After convergence, approximate eigenvalues
c of the original problem may be obtained with the ARPACK subroutine pzneupd .
c of the original problem may be obtained with the ARPACK subroutine pzneupd.
c
c 2. If a basis for the invariant subspace corresponding to the converged Ritz
c values is needed, the user must call pzneupd immediately following
c completion of pznaupd . This is new starting with release 2 of ARPACK.
c values is needed, the user must call pzneupd immediately following
c completion of pznaupd. This is new starting with release 2 of ARPACK.
c
c 3. If M can be factored into a Cholesky factorization M = LL`
c then Mode = 2 should not be selected. Instead one should use
@@ -312,7 +312,7 @@ c\Data Distribution Note:
c
c Fortran-D syntax:
c ================
c Complex*16 resid(n), v(ldv,ncv), workd(3*n), workl(lworkl)
c Complex*16 resid(n), v(ldv,ncv), workd(3*n), workl(lworkl)
c decompose d1(n), d2(n,ncv)
c align resid(i) with d1(i)
c align v(i,j) with d2(i,j)
@@ -324,7 +324,7 @@ c replicated workl(lworkl)
c
c Cray MPP syntax:
c ===============
c Complex*16 resid(n), v(ldv,ncv), workd(n,3), workl(lworkl)
c Complex*16 resid(n), v(ldv,ncv), workd(n,3), workl(lworkl)
c shared resid(block), v(block,:), workd(block,:)
c replicated workl(lworkl)
c
@@ -355,12 +355,12 @@ c pp 575-595, (1987).
c
c\Routines called:
c pznaup2 Parallel ARPACK routine that implements the Implicitly Restarted
c Arnoldi Iteration.
c Arnoldi Iteration.
c zstatn ARPACK routine that initializes the timing variables.
c pivout Parallel ARPACK utility routine that prints integers.
c pivout Parallel ARPACK utility routine that prints integers.
c pzvout Parallel ARPACK utility routine that prints vectors.
c arscnd ARPACK utility routine for timing.
c pdlamch10 ScaLAPACK routine that determines machine constants.
c arscnd ARPACK utility routine for timing.
c pdlamch10 ScaLAPACK routine that determines machine constants.
c
c\Author
c Danny Sorensen Phuong Vu
@@ -570,8 +570,8 @@ c | workl(ncv*ncv+1:ncv*ncv+ncv) := the ritz values |
c | workl(ncv*ncv+ncv+1:ncv*ncv+2*ncv) := error bounds |
c | workl(ncv*ncv+2*ncv+1:2*ncv*ncv+2*ncv) := rotation matrix Q |
c | workl(2*ncv*ncv+2*ncv+1:3*ncv*ncv+5*ncv) := workspace |
c | The final workspace is needed by subroutine pzneigh called |
c | by pznaup2 . Subroutine pzneigh calls LAPACK routines for |
c | The final workspace is needed by subroutine pzneigh called |
c | by pznaup2. Subroutine pzneigh calls LAPACK routines for |
c | calculating eigenvalues and the last row of the eigenvector |
c | matrix. |
c %-------------------------------------------------------------%
@@ -619,7 +619,7 @@ c
c
c %------------------------------------%
c | Exit if there was an informational |
c | error within pznaup2 . |
c | error within pznaup2. |
c %------------------------------------%
c
if (info .lt. 0) go to 9000
+3 -3
View File
@@ -340,8 +340,8 @@ c
external dznrm2,pdlamch10,dlapy2
c
Complex*16
& zdotc
external zdotc
& zzdotc
external zzdotc
c
c %---------------------%
c | Intrinsic Functions |
@@ -743,7 +743,7 @@ c | upper triangular, thus the length of the |
c | inner product can be set to j. |
c %------------------------------------------%
c
workev(j) = zdotc(j, workl(ihbds), 1,
workev(j) = zzdotc(j, workl(ihbds), 1,
& workl(invsub+(j-1)*ldq), 1)
40 continue
c
+1 -1
View File
@@ -114,7 +114,7 @@ c %------------------%
c | Scalar Arguments |
c %------------------%
c
character*2 which
character which*2
integer ishift, kev, np
c
c %-----------------%
+3 -3
View File
@@ -1,5 +1,5 @@
F77 = $(MPIF77)
LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
# Run MPI tests with "mpirun -n 2"
LOG_COMPILER = mpirun
@@ -19,11 +19,11 @@ issue46_SOURCES= issue46.f
if ICB
icb_parpack_c_SOURCES = icb_parpack_c.c
icb_parpack_c_LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX).la $(MPI_C_LIBS)
icb_parpack_c_LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(MPI_C_LIBS)
icb_parpack_c_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir) -I$(top_srcdir)/ICB
icb_parpack_cpp_SOURCES = icb_parpack_cpp.cpp
icb_parpack_cpp_LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX).la $(MPI_CXX_LIBS)
icb_parpack_cpp_LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX)$(ITF64SUFFIX).la $(MPI_CXX_LIBS)
icb_parpack_cpp_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir) -I$(top_srcdir)/ICB
endif
+119 -106
View File
@@ -13,149 +13,167 @@
#include <stdio.h>
#include <stdlib.h>
#include "debug_c.h" // debug parpack.
#include "mpi.h"
#include "parpack.h"
#include "stat_c.h" // arpack statistics.
#include "debug_c.h" // debug parpack.
#include "stat_c.h" // arpack statistics.
/* test program to solve for the 9 largest eigenvalues of
* A*x = lambda*x where A is the diagonal matrix
* with entries 1000, 999, ... , 2, 1 on the diagonal.
* */
void dMatVec(double* x, double* y) {
void dMatVec(int start, int N, const double* x, double* y) {
int i;
for (i = 0; i < 1000; ++i) y[i] = ((double)(i + 1)) * x[i];
for (i = 0; i < N; ++i) y[i] = ((double)(start + i + 1)) * x[i];
};
int ds() {
a_int ido = 0;
char bmat[] = "I";
a_int N = 1000;
char which[] = "LM";
a_int nev = 3;
double tol = 0.000001; // small tol => more stable checks after EV computation.
const a_int N = 1000;
const a_int nev = 9;
const a_int ncv = 2 * nev + 1;
const a_int ldv = N;
const a_int ldz = N;
const a_int lworkl = ncv * (ncv + 8);
const a_int rvec = 1; // need eigenvectors
const double tol = 0.000001; // small tol => more stable checks after EV computation.
const double sigma = 0; // not referenced in this mode
double resid[N];
a_int ncv = 2 * nev + 1;
double V[ncv * N];
a_int ldv = N;
a_int iparam[11];
a_int ipntr[14];
double V[ldv * ncv];
double z[ldz * nev];
double d[nev];
double workd[3 * N];
a_int rvec = 1;
char howmny[] = "A";
double* d = (double*)malloc((nev + 1) * sizeof(double));
double workl[lworkl];
a_int select[ncv];
for (int i = 0; i < ncv; i++) select[i] = 1;
double z[(N + 1) * (nev + 1)];
a_int ldz = N + 1;
double sigma = 0;
int k;
for (k = 0; k < 3 * N; ++k) workd[k] = 0;
double workl[3 * (ncv * ncv) + 6 * ncv];
for (k = 0; k < 3 * (ncv * ncv) + 6 * ncv; ++k) workl[k] = 0;
a_int lworkl = 3 * (ncv * ncv) + 6 * ncv;
a_int info = 0;
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
iparam[0] = 1;
iparam[2] = 10 * N;
iparam[3] = 1;
iparam[4] = 0; // number of ev found by arpack.
iparam[6] = 1;
a_int iparam[11], ipntr[11];
iparam[0] = 1; // ishift
iparam[2] = 10 * N; // on input: maxit; on output: actual iteration
iparam[3] = 1; // NB, only 1 allowed
iparam[6] = 1; // mode
char bmat[] = "I";
char which[] = "LM";
char howmny[] = "A";
MPI_Fint MCW = MPI_Comm_c2f(MPI_COMM_WORLD);
while (ido != 99) {
/* call arpack like you would have, but, use dsaupd_c instead of dsaupd_ */
pdsaupd_c(MCW, &ido, bmat, N, which, nev, tol, resid, ncv, V, ldv, iparam,
/// Split problem across each process/////////////////////
int rank, nprocs;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
a_int N_local = N / nprocs;
if (rank < N % nprocs) // spread the remaining on each process
N_local = N_local + 1;
printf("rank: %d, size: %d\n", rank, N_local);
int start = rank*(N / nprocs) + ((rank < N % nprocs) ? rank : N % nprocs);
printf("rank: %d, start: %d\n", rank, start);
//////////////////////////////////////////////////////////
a_int info = 0, ido = 0;
do {
pdsaupd_c(MCW, &ido, bmat, N_local, which, nev, tol, resid, ncv, V, ldv, iparam,
ipntr, workd, workl, lworkl, &info);
dMatVec(&(workd[ipntr[0] - 1]), &(workd[ipntr[1] - 1]));
}
if (iparam[4] != nev) {printf("Error: iparam[4] %d, nev %d\n", iparam[4], nev); return 1;} // check number of ev found by arpack.
dMatVec(start, N_local, &(workd[ipntr[0] - 1]), &(workd[ipntr[1] - 1]));
} while (ido == 1 || ido == -1);
/* call arpack like you would have, but, use dseupd_c instead of dseupd_ */
pdseupd_c(MCW, rvec, howmny, select, d, z, ldz, sigma, bmat, N, which, nev,
tol, resid, ncv, V, ldv, iparam, ipntr, workd, workl, lworkl,
&info);
int i;
// check info and number of ev found by arpack.
if (info < 0 || iparam[4] < nev) {
printf("Error in saupd: iparam[4] %d, nev %d, info %d\n", iparam[4], nev, info);
return 1;
}
pdseupd_c(MCW, rvec, howmny, select, d, z, ldz, sigma, bmat, N_local, which, nev,
tol, resid, ncv, V, ldv, iparam, ipntr, workd, workl, lworkl, &info);
if (info < 0) {
printf("Error in seupd: info %d\n", info);
return 1;
}
int i; // C99 compliant.
for (i = 0; i < nev; ++i) {
double val = d[i];
double ref = (N-(nev-1)+i);
double eps = fabs(val - ref);
printf("rank %d : %f - %f - %f\n", rank, val, ref, eps);
/*eigen value order: smallest -> biggest*/
if(eps>1.e-05){
free(d);
return 1;
}
if (eps > 1.e-05) return 1;
}
free(d);
return 0;
}
void zMatVec(double _Complex* x, double _Complex* y) {
void zMatVec(int start, int N, const a_dcomplex* x, a_dcomplex* y) {
int i;
for (i = 0; i < 1000; ++i) y[i] = x[i] * (i + 1.0 + _Complex_I * (i + 1.0));
for (i = 0; i < N; ++i) y[i] = x[i] * CMPLXF(start + i + 1.0, start + i + 1.0);
};
int zn() {
a_int ido = 0;
char bmat[] = "I";
a_int N = 1000;
char which[] = "LM";
a_int nev = 1;
double tol = 0.000001; // small tol => more stable checks after EV computation.
double _Complex resid[N];
a_int ncv = 2 * nev + 1;
double _Complex V[ncv * N];
a_int ldv = N;
a_int iparam[11];
a_int ipntr[14];
double _Complex workd[3 * N];
a_int rvec = 0;
char howmny[] = "A";
double _Complex* d =
(double _Complex*)malloc((nev + 1) * sizeof(double _Complex));
const a_int N = 1000;
const a_int nev = 9;
const a_int ncv = 2 * nev + 1;
const a_int ldv = N;
const a_int ldz = N;
const a_int lworkl = ncv * (3 * ncv + 5);
const a_int rvec = 0; // eigenvectors omitted
const double tol = 0.000001; // small tol => more stable checks after EV computation.
const a_dcomplex sigma = CMPLX(0., 0.); // not referenced in this mode
a_dcomplex resid[N];
a_dcomplex V[ldv * ncv];
a_dcomplex z[ldz * nev];
a_dcomplex d[nev];
a_dcomplex workd[3 * N];
a_dcomplex workl[lworkl];
a_dcomplex workev[2 * ncv];
double rwork[ncv];
a_int select[ncv];
for (int i = 0; i < ncv; i++) select[i] = 1;
double _Complex z[(N + 1) * (nev + 1)];
a_int ldz = N + 1;
double _Complex sigma = 0. + I * 0.;
int k;
for (k = 0; k < 3 * N; ++k) workd[k] = 0. + I * 0.;
double _Complex workl[3 * (ncv * ncv) + 6 * ncv];
for (k = 0; k < 3 * (ncv * ncv) + 6 * ncv; ++k) workl[k] = 0. + I * 0.;
a_int lworkl = 3 * (ncv * ncv) + 6 * ncv;
double _Complex rwork[ncv];
double _Complex workev[2 * ncv];
a_int info = 0;
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
iparam[0] = 1;
iparam[2] = 10 * N;
iparam[3] = 1;
iparam[4] = 0; // number of ev found by arpack.
iparam[6] = 1;
a_int iparam[11], ipntr[14];
iparam[0] = 1; // ishift
iparam[2] = 10 * N; // on input: maxit; on output: actual iteration
iparam[3] = 1; // NB, only 1 allowed
iparam[6] = 1; // mode
char bmat[] = "I";
char which[] = "LM";
char howmny[] = "A";
MPI_Fint MCW = MPI_Comm_c2f(MPI_COMM_WORLD);
while (ido != 99) {
/* call arpack like you would have, but, use znaupd_c instead of znaupd_ */
pznaupd_c(MCW, &ido, bmat, N, which, nev, tol, resid, ncv, V, ldv, iparam,
/// Split problem across each process/////////////////////
int rank, nprocs;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
a_int N_local = N / nprocs;
if (rank < N % nprocs) // spread the remaining on each process
N_local = N_local + 1;
printf("rank: %d, size: %d\n", rank, N_local);
int start = rank*(N / nprocs) + ((rank < N % nprocs) ? rank : N % nprocs);
printf("rank: %d, start: %d\n", rank, start);
//////////////////////////////////////////////////////////
a_int info = 0, ido = 0;
do {
pznaupd_c(MCW, &ido, bmat, N_local, which, nev, tol, resid, ncv, V, ldv, iparam,
ipntr, workd, workl, lworkl, rwork, &info);
zMatVec(&(workd[ipntr[0] - 1]), &(workd[ipntr[1] - 1]));
zMatVec(start, N_local, &(workd[ipntr[0] - 1]), &(workd[ipntr[1] - 1]));
} while (ido == 1 || ido == -1);
// check info and number of ev found by arpack.
if (info < 0 || iparam[4] < nev) {
printf("Error in naupd: iparam[4] %d, nev %d, info %d\n", iparam[4], nev, info);
return 1;
}
if (iparam[4] != nev) {printf("Error: iparam[4] %d, nev %d\n", iparam[4], nev); return 1;} // check number of ev found by arpack.
/* call arpack like you would have, but, use zneupd_c instead of zneupd_ */
pzneupd_c(MCW, rvec, howmny, select, d, z, ldz, sigma, workev, bmat, N, which,
pzneupd_c(MCW, rvec, howmny, select, d, z, ldz, sigma, workev, bmat, N_local, which,
nev, tol, resid, ncv, V, ldv, iparam, ipntr, workd, workl, lworkl,
rwork, &info);
int i;
if (info < 0) {
printf("Error in neupd: info %d\n", info);
return 1;
}
int i; // C99 compliant.
for (i = 0; i < nev; ++i) {
double rval = creal(d[i]);
double rref = (N-(nev-1)+i);
@@ -165,13 +183,8 @@ int zn() {
double ieps = fabs(ival - iref);
printf("rank %d : %f %f - %f %f - %f %f\n", rank, rval, ival, rref, iref, reps, ieps);
/*eigen value order: smallest -> biggest*/
if(reps>1.e-05 || ieps>1.e-05){
free(d);
return 1;
}
if (reps > 1.e-05 || ieps > 1.e-05) return 1;
}
free(d);
return 0;
}
+155 -134
View File
@@ -6,190 +6,205 @@
* Just use arpack as you would have normally done but use [ae]upd instead
* of *[ae]upd_. The main advantage is that checks of the arguments are
* performed at compile time. Note: to debug parpack, call debug_c.
* This test program solves for the 9 largest eigenvalues of
* This test program solves for the 9 eigenvalues of
* A*x = lambda*x where A is the diagonal matrix
* with entries 1000, 999, ... , 2, 1 on the diagonal.
*/
#include <array>
#include <cmath>
#include <iostream>
#include <stdexcept>
#include <vector>
#include "debug_c.hpp" // debug parpack.
#include "parpack.hpp"
#include "stat_c.hpp" // arpack statistics.
#include "debug_c.hpp" // debug parpack.
#include "stat_c.hpp" // arpack statistics.
void diagonal_matrix_vector_product(float const* const x, float* const y) {
for (int i = 0; i < 1000; ++i) {
y[i] = static_cast<float>(i + 1) * x[i];
template <typename Real>
void diagonal_matrix_vector_product(int start, int nloc, const Real* x, Real* y) {
for (int i = 0; i < nloc; ++i) {
y[i] = static_cast<Real>(start + i + 1) * x[i];
}
}
void real_symmetric_runner() {
a_int N = 1000;
a_int nev = 3;
a_int ncv = 2 * nev + 1;
a_int ldz = N + 1;
a_int lworkl = 3 * (ncv * ncv) + 6 * ncv;
a_int ldv = N;
template <typename Real>
void real_symmetric_runner(double const& tol_check, arpack::which const& ritz_option) {
const a_int N = 1000;
const a_int nev = 9;
const a_int ncv = 2 * nev + 1;
const a_int ldv = N;
const a_int ldz = N;
const a_int lworkl = ncv * (ncv + 8);
const a_int rvec = 1; // need eigenvectors
a_int rvec = 1;
float tol = 0.000001; // small tol => more stable checks after EV computation.
float sigma = 0.0f;
const Real tol = 0.000001; // small tol => more stable checks after EV computation.
const Real sigma = 0.0f; // not referenced in this mode
std::array<a_int, 14> ipntr;
std::vector<Real> resid(N);
std::vector<Real> V(ldv * ncv);
std::vector<Real> z(ldz * nev);
std::vector<Real> d(nev);
std::vector<Real> workd(3 * N);
std::vector<Real> workl(lworkl);
std::vector<a_int> select(ncv); // since HOWMNY = 'A', only used as workspace here
std::vector<float> workd(3 * N, 0.0f);
std::vector<float> workl(3 * (ncv * ncv) + 6 * ncv, 0.0f);
std::vector<float> V(ncv * N);
std::vector<float> d(nev + 1);
std::vector<float> z((N + 1) * (nev + 1));
std::vector<float> resid(N);
std::vector<a_int> select(ncv);
for (int i = 0; i < ncv; i++) select[i] = 1;
a_int info = 0;
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
std::array<a_int, 11> iparam;
iparam[0] = 1;
iparam[2] = 10 * N;
iparam[3] = 1;
iparam[4] = 0; // number of ev found by arpack.
iparam[6] = 1;
a_int iparam[11], ipntr[11];
iparam[0] = 1; // ishift
iparam[2] = 10 * N; // on input: maxit; on output: actual iteration
iparam[3] = 1; // NB, only 1 allowed
iparam[6] = 1; // mode
MPI_Fint MCW = MPI_Comm_c2f(MPI_COMM_WORLD);
/// Split problem across each process/////////////////////
int rank, nprocs;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
a_int N_local = N / nprocs;
if (rank < N % nprocs) // spread the remaining on each process
N_local = N_local + 1;
std::cout<< "rank: " << rank << ", size :" << N_local << "\n";
int start = rank*(N / nprocs) + std::min(rank, N % nprocs);
std::cout<< "rank: " <<rank<< ", start:" << start<<"\n";
//////////////////////////////////////////////////////////
a_int ido = 0;
while (ido != 99) {
arpack::saupd(MCW, ido, arpack::bmat::identity, N,
arpack::which::largest_magnitude, nev, tol, resid.data(), ncv,
V.data(), ldv, iparam.data(), ipntr.data(), workd.data(),
a_int info = 0, ido = 0;
do {
arpack::saupd(MCW, ido, arpack::bmat::identity, N_local,
ritz_option, nev, tol, resid.data(), ncv,
V.data(), ldv, iparam, ipntr, workd.data(),
workl.data(), lworkl, info);
diagonal_matrix_vector_product(&(workd[ipntr[0] - 1]),
&(workd[ipntr[1] - 1]));
}
// check number of ev found by arpack.
if (iparam[4] < nev /*arpack may succeed to compute more EV than expected*/ ||
info != 0) {
std::cout << "ERROR: iparam[4] " << iparam[4] << ", nev " << nev
diagonal_matrix_vector_product(start, N_local, &(workd[ipntr[0] - 1]), &(workd[ipntr[1] - 1]));
} while (ido == 1 || ido == -1);
// check info and number of ev found by arpack.
if (info < 0 || iparam[4] < nev) { /*arpack may succeed to compute more EV than expected*/
std::cout << "ERROR in saupd: iparam[4] " << iparam[4] << ", nev " << nev
<< ", info " << info << std::endl;
throw std::domain_error("Error inside ARPACK routines");
}
arpack::seupd(MCW, rvec, arpack::howmny::ritz_vectors, select.data(),
d.data(), z.data(), ldz, sigma, arpack::bmat::identity, N,
arpack::which::largest_magnitude, nev, tol, resid.data(), ncv,
V.data(), ldv, iparam.data(), ipntr.data(), workd.data(),
d.data(), z.data(), ldz, sigma, arpack::bmat::identity, N_local,
ritz_option, nev, tol, resid.data(), ncv,
V.data(), ldv, iparam, ipntr, workd.data(),
workl.data(), lworkl, info);
if (info < 0) throw std::runtime_error("Error in seupd, info " + std::to_string(info));
for (int i = 0; i < nev; ++i) {
float val = d[i];
float ref = (N - (nev - 1) + i);
float eps = std::fabs(val - ref);
Real val = d[i];
Real ref = (N - (nev - 1) + i);
Real eps = std::fabs(val - ref);
std::cout << "rank " << rank << " : " << val << " - " << ref << " - " << eps << std::endl;
/*eigen value order: smallest -> biggest*/
if (eps > 1.) {
throw std::domain_error("Correct eigenvalues not computed");
}
if (eps > tol_check) throw std::domain_error("Correct eigenvalues not computed");
}
std::cout << "------" << std::endl;
}
template <typename Real>
void diagonal_matrix_vector_product(int start, int N_local, const std::complex<Real>* x, std::complex<Real>* y) {
for (int i = 0; i < N_local; ++i) {
// Use complex matrix (i, -i) instead of (i, i): this way "largest_magnitude"
// and "largest_imaginary" options produce different results that can be checked.
y[i] = x[i] * std::complex<Real>{Real(start + i + 1), -Real(start + i + 1)};
}
}
void diagonal_matrix_vector_product(std::complex<float> const* const x,
std::complex<float>* const y) {
for (int i = 0; i < 1000; ++i) {
y[i] = x[i] * std::complex<float>{i + 1.0f, i + 1.0f};
}
}
template <typename Real>
void complex_nonsymmetric_runner(double const& tol_check, arpack::which const& ritz_option) {
const a_int N = 1000;
const a_int nev = 9;
const a_int ncv = 2 * nev + 1;
const a_int ldv = N;
const a_int ldz = N;
const a_int lworkl = ncv * (3 * ncv + 5);
const a_int rvec = 0; // eigenvectors omitted
void complex_symmetric_runner() {
a_int N = 1000;
a_int nev = 1;
a_int ncv = 2 * nev + 1;
a_int ldv = N;
a_int ldz = N + 1;
const Real tol = 0.000001; // small tol => more stable checks after EV computation.
const std::complex<Real> sigma(0.0f, 0.0f); // not referenced in this mode
float tol = 0.000001; // small tol => more stable checks after EV computation.
a_int rvec = 0;
std::complex<float> sigma(0.0f, 0.0f);
std::vector<std::complex<Real>> resid(N);
std::vector<std::complex<Real>> V(ldv * ncv);
std::vector<std::complex<Real>> z(ldz * nev);
std::vector<std::complex<Real>> d(nev);
std::vector<std::complex<Real>> workd(3 * N);
std::vector<std::complex<Real>> workl(lworkl);
std::vector<std::complex<Real>> workev(2 * ncv);
std::vector<Real> rwork(ncv);
std::vector<a_int> select(ncv); // since HOWMNY = 'A', only used as workspace here
std::vector<std::complex<float>> resid(N);
std::vector<std::complex<float>> V(ncv * N);
std::vector<std::complex<float>> workd(3 * N);
std::vector<std::complex<float>> d(nev + 1);
std::vector<std::complex<float>> z((N + 1) * (nev + 1));
std::vector<a_int> select(ncv);
for (int i = 0; i < ncv; i++) select[i] = 1;
a_int lworkl = 3 * (ncv * ncv) + 6 * ncv;
std::vector<std::complex<float>> workl(lworkl);
std::vector<std::complex<float>> rwork(ncv);
std::vector<std::complex<float>> workev(2 * ncv);
a_int info = 0;
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
std::array<a_int, 11> iparam;
iparam[0] = 1;
iparam[2] = 10 * N;
iparam[3] = 1;
iparam[4] = 0; // number of ev found by arpack.
iparam[6] = 1;
std::array<a_int, 14> ipntr;
a_int iparam[11], ipntr[14];
iparam[0] = 1; // ishift
iparam[2] = 10 * N; // on input: maxit; on output: actual iteration
iparam[3] = 1; // NB, only 1 allowed
iparam[6] = 1; // mode
MPI_Fint MCW = MPI_Comm_c2f(MPI_COMM_WORLD);
a_int ido = 0;
while (ido != 99) {
arpack::naupd(MCW, ido, arpack::bmat::identity, N,
arpack::which::largest_magnitude, nev, tol, resid.data(), ncv,
V.data(), ldv, iparam.data(), ipntr.data(), workd.data(),
/// Split problem across each process/////////////////////
int rank, nprocs;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
a_int N_local = N / nprocs;
if (rank < N % nprocs) // spread the remaining on each process
N_local = N_local + 1;
std::cout<< "rank: "<<rank<<", size :"<<N_local<<"\n";
int start = rank * (N / nprocs) + std::min(rank, N % nprocs);
std::cout<< "rank: " << rank << ", start:" << start << "\n";
//////////////////////////////////////////////////////////
a_int info = 0, ido = 0;
do {
arpack::naupd(MCW, ido, arpack::bmat::identity, N_local,
ritz_option, nev, tol, resid.data(), ncv,
V.data(), ldv, iparam, ipntr, workd.data(),
workl.data(), lworkl, rwork.data(), info);
diagonal_matrix_vector_product(&(workd[ipntr[0] - 1]),
&(workd[ipntr[1] - 1]));
}
diagonal_matrix_vector_product(start, N_local, &(workd[ipntr[0] - 1]), &(workd[ipntr[1] - 1]));
} while (ido == 1 || ido == -1);
// check number of ev found by arpack
if (iparam[4] < nev /*arpack may succeed to compute more EV than expected*/ ||
info != 0) {
std::cout << "ERROR: iparam[4] " << iparam[4] << ", nev " << nev
// check info and number of ev found by arpack
if (info < 0 || iparam[4] < nev) { /*arpack may succeed to compute more EV than expected*/
std::cout << "ERROR in naupd: iparam[4] " << iparam[4] << ", nev " << nev
<< ", info " << info << std::endl;
throw std::domain_error("Error inside ARPACK routines");
}
arpack::neupd(MCW, rvec, arpack::howmny::ritz_vectors, select.data(),
d.data(), z.data(), ldz, sigma, workev.data(),
arpack::bmat::identity, N, arpack::which::largest_magnitude,
nev, tol, resid.data(), ncv, V.data(), ldv, iparam.data(),
ipntr.data(), workd.data(), workl.data(), lworkl, rwork.data(),
info);
arpack::bmat::identity, N_local, ritz_option,
nev, tol, resid.data(), ncv, V.data(), ldv, iparam,
ipntr, workd.data(), workl.data(), lworkl, rwork.data(), info);
if (info < 0) throw std::runtime_error("Error in neupd, info " + std::to_string(info));
for (int i = 0; i < nev; ++i) {
float rval = std::real(d[i]);
float rref = (N-(nev-1)+i);
float reps = std::fabs(rval - rref);
float ival = std::imag(d[i]);
float iref = (N-(nev-1)+i);
float ieps = std::fabs(ival - iref);
std::cout << "rank " << rank << " : " << rval << " " << ival << " - " << rref << " " << iref << " - " << reps << " " << ieps << std::endl;
if (ritz_option == arpack::which::largest_magnitude) {
for (int i = 0; i < nev; ++i) {
Real rval = std::real(d[i]);
Real rref = static_cast<Real>(N - (nev - 1) + i);
Real reps = std::fabs(rval - rref);
Real ival = std::imag(d[i]);
Real iref = -static_cast<Real>(N - (nev - 1) + i);
Real ieps = std::fabs(ival - iref);
std::cout << rval << " " << ival << " - " << rref << " " << iref << " - " << reps << " " << ieps << std::endl;
/*eigen value order: smallest -> biggest*/
if (reps > 1. || ieps > 1.) {
throw std::domain_error("Correct eigenvalues not computed");
if (reps > tol_check || ieps > tol_check) throw std::domain_error("Correct eigenvalues not computed");
}
} else if (ritz_option == arpack::which::largest_imaginary) {
for (int i = 0; i < nev; ++i) {
Real rval = std::real(d[i]);
Real rref = static_cast<Real>(nev - i);
Real reps = std::fabs(rval - rref);
Real ival = std::imag(d[i]);
Real iref = -static_cast<Real>(nev - i);
Real ieps = std::fabs(ival - iref);
std::cout << rval << " " << ival << " - " << rref << " " << iref << " - " << reps << " " << ieps << std::endl;
if (reps > tol_check || ieps > tol_check) throw std::domain_error("Correct eigenvalues not computed");
}
} else {
throw std::domain_error("The input Ritz option is not allowed in this test file.");
}
std::cout << "------" << std::endl;
}
int main() {
@@ -199,9 +214,12 @@ int main() {
try {
// parpack without debug
real_symmetric_runner();
real_symmetric_runner<float>(1., arpack::which::largest_magnitude);
real_symmetric_runner<float>(1., arpack::which::largest_algebraic);
real_symmetric_runner<double>(1.e-05, arpack::which::largest_magnitude);
real_symmetric_runner<double>(1.e-05, arpack::which::largest_algebraic);
} catch (std::domain_error& e) {
std::cout << e.what() << '\n';
std::cout << e.what() << std::endl;
MPI_Abort(MPI_COMM_WORLD, 1);
}
@@ -231,7 +249,10 @@ int main() {
1);
try {
complex_symmetric_runner();
complex_nonsymmetric_runner<float>(1., arpack::which::largest_magnitude);
complex_nonsymmetric_runner<float>(1., arpack::which::largest_imaginary);
complex_nonsymmetric_runner<double>(1.e-05, arpack::which::largest_magnitude);
complex_nonsymmetric_runner<double>(1.e-05, arpack::which::largest_imaginary);
} catch (std::domain_error& e) {
std::cout << e.what() << '\n';
MPI_Abort(MPI_COMM_WORLD, 1);
+2 -2
View File
@@ -38,8 +38,8 @@
* ...
* ... SPECIFICATIONS FOR LOCAL VARIABLES
INTEGER I, J, NDIGIT, K1, K2, LLL
CHARACTER*1 ICOL( 3 )
CHARACTER*80 LINE
CHARACTER ICOL( 3 )
CHARACTER LINE*80
* ...
* ... SPECIFICATIONS INTRINSICS
INTRINSIC MIN
+1 -1
View File
@@ -34,7 +34,7 @@
* ...
* ... SPECIFICATIONS FOR LOCAL VARIABLES
INTEGER I, NDIGIT, K1, K2, LLL
CHARACTER*80 LINE
CHARACTER LINE*80
* ...
* ... FIRST EXECUTABLE STATEMENT
*
+2 -2
View File
@@ -34,7 +34,7 @@
* ...
* ... SPECIFICATIONS FOR LOCAL VARIABLES
* .. Scalar Arguments ..
CHARACTER*( * ) IFMT
CHARACTER IFMT*( * )
INTEGER IDIGIT, LDA, LOUT, M, N
* ..
* .. Array Arguments ..
@@ -42,7 +42,7 @@
& A( LDA, * )
* ..
* .. Local Scalars ..
CHARACTER*80 LINE
CHARACTER LINE*80
INTEGER I, J, K1, K2, LLL, NDIGIT
* ..
* .. Local Arrays ..
+2 -2
View File
@@ -31,7 +31,7 @@
* ...
* ... SPECIFICATIONS FOR LOCAL VARIABLES
* .. Scalar Arguments ..
CHARACTER*( * ) IFMT
CHARACTER IFMT*( * )
INTEGER IDIGIT, LOUT, N
* ..
* .. Array Arguments ..
@@ -39,7 +39,7 @@
& SX( * )
* ..
* .. Local Scalars ..
CHARACTER*80 LINE
CHARACTER LINE*80
INTEGER I, K1, K2, LLL, NDIGIT
* ..
* .. Intrinsic Functions ..
+1 -1
View File
@@ -34,7 +34,7 @@
* ...
* ... SPECIFICATIONS FOR LOCAL VARIABLES
INTEGER I, NDIGIT, K1, K2, LLL
CHARACTER*80 LINE
CHARACTER LINE*80
* ...
* ... SPECIFICATIONS INTRINSICS
INTRINSIC MIN

Some files were not shown because too many files have changed in this diff Show More