Matrix Toolkit Java

Matrix Toolkit Java (MTJ) is an open-sourceJavasoftware library for performing numerical linear algebra. The library contains a full set of standard linear algebra operations for dense matrices based on BLAS and LAPACK code. Partial set of sparse operations is provided through the Templates project. The library can be configured to run as a pure Java library or use BLAS machine-optimized code through the Java Native Interface.

MTJ was originally developed by Bjørn-Ove Heimsund, who has taken a step back due to other commitments. The project webpage states that "(The new maintainers are) primarily concerned with keeping the library maintained, and fixing bugs as they are discovered. There is no road plan for future releases".[1]

Several citations for MTJ can be found in scientific literature, including [2] which uses its LU preconditioner. Performance of MTJ has been compared to other libraries, which can be found at Java Matrix Benchmark's site.[3]

Capabilities

The following is an overview of MTJ's capabilities, as listed on the project's website:

  • Datastructures for dense and structured sparse matrices in the following formats:
    • Dense, column major.
    • Banded matrices, which store only a few diagonals.
    • Packed matrices, storing only half the matrices (for triangular or symmetric matrices).
    • Tridiagonal and symmetric tridiagonal matrices.
  • Transparent support for symmetric and triangular storage.
  • Datastructures for unstructured sparse matrices in these formats:
    • Compressed row or column storage (CRS/CCS).
    • Flexible CRS/CCS, using growable sparse vectors.
    • Compressed diagonal storage (CDS).
  • The dense and structured sparse matrices are built on top of BLAS and LAPACK, and include the following intrinsic operations:
    • Matrix/vector multiplication.
    • Matrix/matrix multiplication.
    • Rank updates by matrices or vectors.
    • Direct matrix solvers.
  • The unstructured sparse matrices supports the same operations as the structured ones, except they do not have direct solvers. However, their matrix/vector multiplication methods are optimised for use in iterative solvers.
  • Matrix decompositions of dense and structured sparse matrices:
    • LU and Cholesky.
    • Eigenvalue decompositions for unsymmetrical dense matrices.
    • Singular value decompositions for unsymmetrical dense matrices.
    • Eigenvalue decompositions for symmetrical matrices (tridiagonal, banded, packed and dense).
    • Orthogonal matrix decompositions for dense matrices (QR, RQ, LQ, and QL).
  • Iterative solvers for unstructured sparse matrices from the Templates project:
    • BiConjugate gradients.
    • BiConjugate gradients stabilized.
    • Conjugate gradients.
    • مربع التدرجات المترافقة.
    • تكرار تشيبيشيف.
    • البواقي الدنيا المعممة (GMRES).
    • التحسين التكراري (طريقة ريتشاردسون).
    • المتبقي شبه الأدنى.
  • مجموعة مختارة من المُهيئات الجبرية:
    • التكييف المسبق القطري.
    • استرخاء متتابع متناظر.
    • تشوليسكي غير مكتمل.
    • وحدة منطقية غير مكتملة.
    • LU غير مكتمل مع ملء الفراغات باستخدام العتبة.
    • الشبكة المتعددة الجبرية عن طريق التجميع المُنعم.

أمثلة على الاستخدام

مثال على تحليل القيم المفردة (SVD):

SVD svd = new SVD ( matA.numRows ( ) , matA.numColumns ( ) ) ; SVD s = svd.factor ( matA ) ; DenseMatrix U = s.getU ( ) ; DenseMatrix S = s.getS ( ) ; DenseMatrix Vt = s.getVt ( ) ;

مثال على ضرب المصفوفات:

DenseMatrix result = new DenseMatrix ( matA.numRows ( ) , matB.numColumns ( ) ) ; matA.mult ( matB , result ) ;

انظر أيضاً

مراجع

  1. "صفحة مشروع MTJ" . MTJ . تم الاطلاع عليها بتاريخ 30 نوفمبر 2012 .
  2. ماكماهون، إتش بي؛ جوردون، جي جي (2005). "التخطيط السريع والدقيق في عمليات اتخاذ القرار ماركوف" (ملف PDF) . وقائع المؤتمر الدولي الخامس عشر حول التخطيط والجدولة الآليين (ICAPS-05) .
  3. "معيار أداء مصفوفة جافا" . تم الاطلاع عليه في 6 ديسمبر 2012 .