GithubHelp home page GithubHelp logo

nmoteki / block-krylov-linear-solvers Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 18 KB

License: MIT License

Makefile 8.68% C++ 91.32%
iterative-solvers krylov-subspace-methods linear-algebra matrix-equations

block-krylov-linear-solvers's Introduction

"block-Krylov linear solvers" -- C++ library for solving a systems of linear equations AX=B using the block-Krylov type methods


General Descriptions:

A collection of Block-Krylov type solvers for a system of linear equations with multiple right-hand sides AX=B. Matrix elements are assumed to be complex number of double precision. Mathematical algorithms are implemented by C++ language using Eigen. The list of solvers is:

  • bl_cocg_rq : Block Condugate Orthogonal Conjugate Gradient (COCG) method with residual orthonormalization [Gu et al. 2016]. Only for complex-symmetric matricies (i.e., A == A^T). Only one Matrix-Vector product per iteration.
  • bl_bicg_rq : Block Bi-Conjugate Grandient (BiCG) method with residual orthonormalization [Rashedi et al. 2016]. Applicable to any non-singular matricies. The Hermitian of A is also used in the solver.
  • bl_bicr_rq : Block Bi-Conjugate Residual (BiCR) method with residual orthonormalization [Tadano et al. 2014]. Applicable to any non-singular matricies. The Hermitian of A is also used in the solver.
  • bl_bicgstab_rq : Block Bi-Conjugate Gradient stabilzied (BiCGSTAB) method with residual orthonormalization [Rashedi et al. 2016; Personal communication with Dr. Andreas Frommer]. Applicable to any non-singular matricies.
  • bl_bicgstab : Block Bi-Conjugate Gradient stabilzied (BiCGSTAB) method [Guennouni et al. 2003; Tadano et al. 2009]. Applicable to any non-singular matricies.
  • bl_bicggr : Block Bi-Conjugate Gradient Gap-Reducing (BiCGGR) method [Tadano et al. 2009]. Applicable to any non-singular matricies.

Prerequisites:

  1. A C++ compiler supporting C++11. The author tested the code using the gcc version 6.2.0.
  2. A C++ library for linear algebra "Eigen" with version 3.2 or newer. The author tested the code using the Eigen version 3.2.10.

Test run:

  1. Modify the compilation parameters in "Makefile" according to your environment. In particular,please change the "CXX" (= C++ complier) and "INCLUDES" (= absolute path of Eigen folder).

  2. Compilation and linking are performed by

       make
    
  3. A test run of the solvers for a system AX=B is performed by

       ./block_iterative_solvers_test number_of_RHS_columns [number_of_rows]
    
If you skip the number_of_rows, you will be prompted to enter a filename of matrix A. If number_of_rows is entered, a random square matrix of size (number_of_rows, number_of_rows) is assumed for A. The matrix B is set to be a random rectangular matrix of size (number_of_rows, number_of_RHS_columns).  

Interface of solver:

Function interface is common to all the solvers.

    Eigen::MatrixXcd solver_name(const Eigen::MatrixXcd& A, const Eigen::MatrixXcd& B, const double& tol, const int& itermax);

The "Eigen::MatrixXcd" is a Eigen class of a dynamically-allocated matrix with type std::complex. Each solver returns a solution matrix X of size (number_of_rows, number_of_RHS_columns) in "Eigen::MatrixXcd" format.

Tolerance:

Every solver internally assures ||AX-B|| / ||B|| < 10tol , before returning the numerical solution X. Here, the "|| ||" meant Frobenius norm.

Maximum number of iterations:

The itermax sets the maximum number of iterations. If relative error does not decrease below tol until the maximum number of iteration, solver is aborted with an error message "solver_name did not converge to solution within error tolerance !".

Theory

For mathematical backgrounds, please see the references sited in the comment lines of each .cpp file.

Contact

[email protected]

Licence

Please see LICENSE.txt

block-krylov-linear-solvers's People

Contributors

nobuhiromoteki avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.