GithubHelp home page GithubHelp logo

laclib's Introduction

Simple Linear Algebra Library

Laclib implements basic linear algebra functions, wrapping OpenBLAS or Intel MKL. It also wraps MUMPS or Intel Direct Sparse Solver (DSS, e.g., PARDISO) for the solution of large linear systems with sparse matrices.

Examples

The following code shows how to solve a linear system with a (large) sparse matrix:

auto coo = read_matrix_market("my-matrix.mtx");
auto options = MumpsOptions::make_new(is_symmetric(coo->layout));
auto solver = SolverMumps::make_new(options);
auto rhs = vector<double>(coo->n, 1.0);
auto x = vector<double>(coo->n, 0.0);
solver->analyze_and_factorize(coo);
solver->solve(x, rhs);

See ex_solver_mumps.cpp for a complete code.

Use laclib in your project

After installation (explained below), you may clone https://github.com/cpmech/use-laclib to bootstrap a project using laclib.

Docker image

The docker image is convenient with Visual Code remote development tools (but containerized; "not really remote").

./build-docker-image.bash

Ubuntu/Linux 22.04+

First, follow the procedures from https://github.com/cpmech/script-install-mumps

Then, execute

./install-deps.bash
./install.bash

which will compile and install the header files in /usr/local/include/laclib and the library files in /usr/local/lib/laclib.

Directory structure

├── benchmarks   # tests for computational performance
├── data         # auxiliary data for unit tests
├── examples     # examples of usage
├── src          # this is the "main library"
│   ├── analysis # analysis, stats, and reporting
│   ├── check    # functions for unit/integration tests
│   ├── linalg   # basic linear algebra functions
│   ├── sparse   # sparse matrix and solvers tools
│   └── util     # some utilities for file/string manipulations
└── zscripts     # auxiliary "internal" bash scripts

We suggest looking at the sparse directory first.

Intel MKL Installation

From: https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-download.html

Installing MKL on Linux

Select Linux → APT Package Manager and follow the instructions, or use the script below:

bash ./zscripts/install-intel-mkl-linux.bash

Installing MKL on Windows

Select Windows → Online Installer and follow the instructions.

laclib's People

Contributors

cpmech avatar

Watchers

 avatar  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.