Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensor hierarchy #108

Merged
merged 31 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
758cfe7
Added implementation for field elements.
jacobdwatters Aug 14, 2024
47a857c
Began re-working tensor hierarchy.
jacobdwatters Aug 17, 2024
55a352f
Began re-working tensor hierarchy.
jacobdwatters Aug 26, 2024
5ec5139
Completed implementations for all sparse COO tensor objects.
jacobdwatters Aug 28, 2024
4d1513d
Implementation started for sparse CSR matrices.
jacobdwatters Aug 31, 2024
ec5ffe9
Implementation started for sparse CSR matrices.
jacobdwatters Aug 31, 2024
b6529f6
CSR matrix implementations completed.
jacobdwatters Sep 2, 2024
804dbd9
Refactored packages and added hashCode overrides for all arrays.
jacobdwatters Sep 2, 2024
1c0ed52
Added QR decomposition implementation for the new matrix types.
jacobdwatters Sep 2, 2024
f350aa0
Updated Cholesky and Hessenburg decompositions for new matrix types.
jacobdwatters Sep 3, 2024
9ace994
Updated Schur decompositions for new matrix types.
jacobdwatters Sep 4, 2024
e50fec4
Updated Schur decompositions for new matrix types.
jacobdwatters Sep 4, 2024
edcc5ea
Updated solvers for new matrix types.
jacobdwatters Sep 5, 2024
6cd4b80
Depreciate old complex rng.
jacobdwatters Sep 5, 2024
2c41d5d
Update old solvers and decompositions for new matrix, vector, and ten…
jacobdwatters Sep 15, 2024
f8ce430
Added cross-type arithmetic operations for dense tensors, matrices, a…
jacobdwatters Sep 17, 2024
b7369e1
Added package info for the new dense and sparse array implementations.
jacobdwatters Sep 17, 2024
8ceb3a5
Updated field matrices to store data internally as Field<T>[] instead…
jacobdwatters Sep 29, 2024
c699c8c
Updated all tests for new tensor types.
jacobdwatters Oct 3, 2024
ccd6a50
Removed duplicated code for complex tensors.
jacobdwatters Oct 6, 2024
0ef86b2
Removed duplicated code for complex tensors.
jacobdwatters Oct 6, 2024
15d07fd
Removed duplicated code for complex tensors.
jacobdwatters Oct 9, 2024
2d37f4b
WIP: Initial implementation of new tensor hierarchy.
jacobdwatters Nov 21, 2024
3f3daeb
WIP: Initial implementation of new tensor hierarchy.
jacobdwatters Nov 21, 2024
165e10f
WIP: Completed first pass implementation of new tensor hierarchy.
jacobdwatters Nov 23, 2024
4dbf2a9
WIP: Completed first pass implementation of new tensor hierarchy. Sti…
jacobdwatters Nov 28, 2024
b501f26
Fixed tests and updated code which failed tests.
jacobdwatters Dec 3, 2024
e7e4965
Fixed issue with check for complex matrices being hermitian.
jacobdwatters Dec 4, 2024
a0dacee
Large update to io package and updates to Javadoc across project.
jacobdwatters Dec 8, 2024
a1ec06f
Update git ignore.
jacobdwatters Dec 8, 2024
0fbb6f3
Update README.
jacobdwatters Dec 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 2 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/.idea/
/Flag4j.iml

/target/classes/
/target/generated-sources/
/target/generated-test-sources/
/target/maven-archiver/
/target/maven-status/
/target/surefire-reports/
/target/test-classes/

/target/jacoco.exec
/flag4j.iml
/target/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Jacob Watters
Copyright (c) 2024 Jacob Watters

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
84 changes: 48 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,56 @@
# Flag4j - Fast Linear Algebra for Java
Flag4j is a fast and easy to use linear algebra library for Java and provides operations and linear algebra routines for real/complex sparse/dense tensors, matrices, and vectors.

## State of Project as of 16-FEB-2024
Flag4j is currently in the final steps of development before an initial beta release. Nearly all features have been fully implemented or beta implementations.
## State of Project as of 7-DEC-2024
Flag4j is currently in the final steps of development before an initial beta release.
Nearly all features have been fully implemented or beta implementations.

Updates:
- The QR, Hessenburg and Schur decompositions have had a complete overall.
- QR/Hessenburg/Schur: The way reflectors are computed and applied has been significantly improved in terms of performance, stability, and sensitivity to over(under)flow issues.
- Schur: Some correctness issues have been ironed out and significant performance enhancements have been made. The decomposition uses an implicit double shifted QR algorithm.
This means computing eigenvalues should be more accurate/correct and significantly faster in most cases.
- Tensor Solver: Added a solver which can solve tensor equations of the form $A \cdot X = B$ where $A, \ X$, and $B$ are tensors of arbitrary rank and shape as long as the shapes are conducive to
computing the tensor dot product `B = A.dot(X)`.
- Tensor Inverse: Added ability to compute the inverse of an arbitrary invertible tensor $A$, $A^{-1}$ relative to a specified tensor product.
### Recent Updates:
- I/O Improvements:
- All tensors, vectors, and matrices may be serialized.
- Added support for reading/writing from/to Matrix Market Exchange file formats.
- Currently only supports a subset including real/complex/integer dense general matrices
and real/complex/integer coordinate general matrices
- Added support for reading/writing from/to csv files for real and complex matrices (i.e. `Matrix` and `CMatrix`).
- Improved API: There have been significant changes to the API specifically with the inheritance hierarchy of arrays (tensors,
matrices, vectors). This was in part to serve the creation of general field/ring/semiring tensors.
- New Algebraic Structures and Generic Tensors:
- Added `Field`, `Ring`, and `Semiring` interfaces representing the mathematical objects.
- Complex numbers are now implemented as a `Field`. There are now 64-bit and 128-bit variants of complex numbers.
- Several reference implementations of the interfaces are provided, e.g. `Bool`, `RealInt16`, `Complex128`.
- Added generic `FieldMatrix<T extends Field<T>>` for creating matrices for a generic field. This allows users
to easily create a matrix for a custom field which implements the `Field` interface. Support for generic
ring and semiring matrices are planed.
___

## Features and Functionality

### Algebraic Objects
- Complex Numbers
- Complex numbers, fields, rings, and semirings.
- Vectors
- Real/Complex Dense Vector
- Real/Complex Sparse Vector
- Real/complex/field dense vector
- Real/complex/field sparse vector
- Matrices
- Dense Matrices
- Real/Complex Dense Matrix
- Real/complex/field dense dense matrix
- Sparse Matrices
- Real/Complex COO Matrix
- Real/Complex CSR Matrix
- Real/Complex Symmetric Tri-diagonal Matrix.
- Permutation Matrix
- Real/complex/field COO matrix
- Real/complex/field CSR matrix
- Real/complex/field symmetric tri-diagonal matrix.
- Permutation matrix
- Tensors
- Real/Complex Dense Tensor
- Real/Complex Sparse COO Tensor
- Real/complex/field dense tensor
- Real/complex/field sparse COO tensor

### Operations
- Basic Arithmetic Operations: Add, subtract, scalar/element multiply, scalar/element divide, etc.
- Basic Properties: Tensor/matrix/vector shape, non-zero entries, etc.
- Basic Manipulations: Insert, join/stack/augment, extract, etc.
- Basic Comparisons: Equal, same shape, etc.
- Vector Operations
- Arithmetic: Inner/outer/cross product, vector norms, etc.
- Basic Arithmetic Operations: add, subtract, scalar/element multiply, scalar/element divide, etc.
- Basic Properties: tensor/matrix/vector shape, non-zero entries, etc.
- Basic Manipulations: insert, join/stack/augment, extract, etc.
- Basic Comparisons: equal, same shape, etc.
- Vector Operations:
- Arithmetic: inner/outer/cross product, vector norms, etc.
- Comparisons: Parallel, orthogonal, etc.
- Matrix Operations
- Matrix Operations:
- Arithmetic: Matrix multiplication, transpose, matrix norms, inverse, pseudo-inverse, etc.
- Features: Matrix rank, symmetric, definiteness, eigenvalues and vectors, singularity, triangular, etc.
- Comparisons: Similar, etc.
Expand All @@ -55,23 +64,24 @@ ___
- Comparisons: Tensor rank/dimension, etc.

### Matrix Decompositions
- LU Decompositions
- LU Decompositions (real/complex)
- No pivoting
- Partial Pivoting
- Full Pivoting
- QR Decomposition
- QR Decomposition (real/complex)
- Householder Reflectors
- Full/Reduced
- Cholesky Decomposition
- Hessenburg Decomposition
- Eigen/Schur Decompositions
- Singular Value Decomposition
- Cholesky Decomposition (real/complex)
- Hessenburg Decomposition (real/complex)
- General and specialized symmetric and Hermitian implementations are provided.
- Eigen/Schur Decompositions (real/complex)
- Singular Value Decomposition (real/complex)

### Linear Solvers
- Exact solution for well determined matrix systems
- General systems
- Triangular systems
- Exact solution for well determined tensor equations
- Exact solution for well determined tensor or matrix equations
- Least Squares solution

### Linear and Homography Transformations
Expand All @@ -90,5 +100,7 @@ ___
- Random Vectors
- Random Tensors

### I/O
- Read/Write tensors, matrices, and vectors to/from a file.
### I/O: Read/write tensors, matrices, and vectors to/from a file.
- Serialization (all types)
- Matrix Market Exchange Format (all real/complex dense and sparse matrix types)
- CSV format (only supported for `Matrix` and `CMatrix`)
Loading
Loading