Skip to content

JLinAlg/JLinAlg

Repository files navigation

JLinAlg is an open source and easy to use Java library for linear algebra. It is licensed under the LGPL (changed from GPL on December, 10th 2014).

JLinAlg is an open source and easy to use Java library for linear algebra.
It is licensed under the LGPL (changed from GPL on December, 10th 2014).

[Features] [Getting Started] [Download] [Documentation] [Examples] [Project Members] [Links]

Features

  • RingElements and FieldElements with operations like addition, subtraction, multiplication and - for FieldElements - division.
  • Euclidean division and Euclidean algorithm on any RingElements (Matrix, Polynomials, Rationals, Complex numbers etc.).
  • Basic matrix and vector operations like scalar product and matrix multiplication. Also: Fast matrix multiplication using the Strassen- and the Strassen-Winograd algorithms.
  • Matrices and vectors can be filled with arbitrary field elements like rational numbers, complex numbers or even prime fields.
  • Compute the inverse or the determinant of a matrix.
  • Gauss- and Gauss-Jordan algorithm are available.
  • Calculate a solution or the solution space of a linear equation system.
  • Calculate the eigenvalues of real matrices.
  • Univariate polynomials including polynomial division and calculating the GCD
  • All operations can be done without rounding errors (except for numeric data types like DoubleWrapper).
  • Element-wise mathematical and logical operations on vectors and matrices.
  • L1 and L2 vector norms.
  • Canonical vector and matrix factory methods: identity matrix, all ones, all zeros, uniformly distributed noise, Gaussian (normally distributed) noise.
  • Application of user-defined functions to all elements of a matrix or vector (or pairs of matrices and vectors).

Getting Started

  1. Go to the Download section and get the latest version of JLinAlg.
  2. Set up your environment (We recommend to use Eclipse 2020-09 in any of the following two cases):
    • If you want to use JLinAlg as a library, use jlinalg-v0.xx.jar contained in the Zip-file. In Eclipse you can just add it to your project by going to Project -> Properties -> java build path -> libraries. There you can use "Add Jars" (drag and drop jlinalg-0.xx.jar to your project first) or "Add External Jars" and select the location of jlinalg-0.xx.jar
    • In case you want to have a look at the source code, you can find it inside the Zip-file under "JLinAlg/src". In Eclipse you can just go to File -> Import -> Existing Projects into Workspace. Now select the directory containing the downloaded Zip-file and the project JLinAlg-v0.xx should appear and be checked. Now click "finish".
  3. Get to know JLinAlg. Have a look at the examples and the documentation (both also included in the Zip-File).
  4. Do something cool with it.

Download

  • JLinAlg-v0.8: The complete source code including Eclipse project files, the API as a jar-file and javadoc in one zip-file.
  • Earlier versions: Other releases at Sourceforge.

Documentation

Examples

  • The class F2 represents an element of the modulo 2 field F2 and a factory as inner class. F2 is a field, just like the rational numbers. The examples in F2Demo.java illustrate how to create elements in F2 using the factory, how to create matrices, and to operate on them. The file F2.java shows how to implement a type and a factory.
  • LinearEquationSystemDemo.java: This example shows how to calculate a solution or its solution space.
  • MatrixOperationsDemo.java: How to calculate them for matrices over arbitrary fields.
  • EigenvaluesDemo.java: This example shows how JLinAlg can do eigenvalue computation with real matrices (matrices with DoubleWrapper entries).
  • FieldPDemo.java: This demonstration of the class FieldP shows that in vector spaces over finite fields there can be linear dependent vectors which are all orthogonal to each other.
  • Xor.java: Exclusive-Or neural net problem using JLinAlg.
  • HilbertMatrixDemo.java: This demo shows how the squared distance between the real solution of an equation system to the one that is found when using floating point arithmetic, grows exponentially when the dimension of the Hilbert matrix increases.
  • ArbitraryPrecisionDemo.java: Demonstration that shows how quickly floating point numbers can cause rounding errors and how you can avoid these using arbitrary precision (Rational).
  • PolynomialDemo.java: Some operations on polynomials (including calculating the GCD using the Euclidean algorithm).

Project Members

  • Andreas Keilhauer: Freelance software engineer and founder of JLinAlg, Germany
  • Simon D. Levy: Assoc. Professor, Washington and Lee University, USA
  • Andreas Lochbihler: Postdoc at the ETH Zurich, Switzerland
  • Safak Ökmen: Computer Scientist, TU Munich, Germany.
  • Georg Thimm: Seniour Software Architect, Germany
  • Christian Würzebesser: former Research Associate, EAWAG, Zurich, Switzerland
  • ... and perhaps you, too. Use our forums at Sourceforge and contact us!

Links

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

close