ojAlgo Documentation

repository·develop·Indexed 19 days ago

https://github.com/optimatika/ojalgo

A high-performance, dependency-free, pure Java library for mathematics, linear algebra, and optimization. It provides tools for mathematical programming (LP, QP, MIP), data science utilities including Artificial Neural Networks and clustering, statistical and stochastic tools, and advanced array classes supporting sparse or dense N-dimensional arrays.

Tokens
1.1K
Snippets
3
Records
6
Agent score
68%

What's inside ojAlgo

  1. Overview of ojAlgo capabilities

    develop

    ojAlgo is a high-performance, pure Java library with zero dependencies designed for mathematics, linear algebra, and optimization. Its core features include:

    • Linear Algebra: High-performance matrix operations (ranked highly in Java Matrix Benchmarks).
    • Mathematical Optimization: Solvers for Linear Programming (LP), Quadratic Programming (QP), and Mixed Integer Programming (MIP). It also supports integrations with third-party solvers.
    • Advanced Array Classes: Supports sparse or dense, N-dimensional arrays. These can handle complex numbers, rational numbers, and quaternions. Memory can be allocated on-heap, off-heap, or in a file.
    • Data Science Utilities: Includes Artificial Neural Networks, clustering, and data processing tools.
    • Statistical & Stochastic Tools: Time series analysis, random number generation, stochastic processes, and descriptive statistics.
  2. Build ojAlgo from source

    develop

    To build ojAlgo from the source code, you need Java 11 or higher. The project uses the Maven Wrapper (./mvnw), so you do not need a separate Maven installation. Follow these steps:

    1. Clone the repository.
    2. Navigate to the directory.
    3. Use the wrapper to compile, test, or package the project.
    git clone https://github.com/optimatika/ojAlgo.git
    cd ojAlgo
    ./mvnw compile              # Compile
    ./mvnw test                 # Run tests
    ./mvnw package -DskipTests  # Build JAR without tests
  3. Install ojAlgo via Maven

    develop

    ojAlgo is available on Maven Central. You can include it in your project using the following dependency configuration. Replace X.Y.Z with the latest available version.

    <!-- https://mvnrepository.com/artifact/org.ojalgo/ojalgo -->
    <dependency>
        <groupId>org.ojalgo</groupId>
        <artifactId>ojalgo</artifactId>
        <version>X.Y.Z</version>
    </dependency>
  4. Get commercial support for ojAlgo

    develop

    If you are using ojAlgo in a production environment and require private, prioritized, and direct support from the developers, you can purchase commercial support through Optimatika.

    Commercial support provides prioritized attention and commitment, but does not change the underlying MIT license of the library.

  5. Perform simultaneous tridiagonal decomposition

    develop

    The SimultaneousTridiagonal class is used to decompose a matrix into a tridiagonal form. It computes the orthogonal matrix Q and the tridiagonal matrix D during the decomposition process.

    To perform the decomposition, use the decompose method, passing a collectable matrix (such as an R064Store or any object implementing Access2D.Collectable). The decomposition is performed in-place on the provided matrix, which becomes the Q matrix in the resulting decomposition.

    // Assuming 'matrix' is an instance of Access2D.Collectable<Double, ? super TransformableRegion<Double>>
    SimultaneousTridiagonal decomposition = new SimultaneousTridiagonal();
    boolean success = decomposition.decompose(matrix);
    
    if (success) {
        MatrixStore<Double> D = decomposition.makeD(); // The tridiagonal matrix
        DecompositionStore<Double> Q = decomposition.makeQ(); // The orthogonal matrix
    }