Skip to content

Conversation

@normen662
Copy link
Contributor

@normen662 normen662 commented Oct 14, 2025

  • contains a new package called half:
    • contains a modified version of the Half class as provided in Half4J.
  • contains a new package called linear:
    • RealVector as well as three implementations HalfRealVector, FloatRealVector, DoubleRealVector in linear
    • operations on vectors
    • linear operator
    • RealMatrix as dense matrix, various implementations, operations on matrices
    • Metrics as implementation of different kinds of metrics
    • FhtKacRotator to create random orthogonal matrices as needed by rabitq
    • QRDecomposition using Householder reflections to create random orthogonal matrices
  • contains a new package called rabitq:
    • rabitq implementation (extended version): quantizer and estimator, encodings
    • EncodedRealVector as implementation of RealVector as drop in for any RealVector

@normen662 normen662 added the enhancement New feature or request label Oct 14, 2025
Copy link
Collaborator

@alecgrieser alecgrieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a more detailed look at the new linear package. This combines my feedback in #3598

@normen662 normen662 force-pushed the vector-basics branch 8 times, most recently from 77bb148 to a6e867d Compare October 20, 2025 21:08
* <p>
* This method iterates through the input vector, converting each {@code double} element into its 16-bit short
* representation. It then serializes this short into eight bytes, placing them sequentially into the resulting byte
* array. The final array's length will be {@code 8 * vector.size()}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am reading this correctly, each one of the Vector implementations requires the underlying byte representation to have a descriptor of the actual precision (line 106).

Is this correct? if so, why is it necessary to add this information, shouldn't the consumer of the vector array already know the type if the vector it is reading from disk?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline.

Copy link
Collaborator

@alecgrieser alecgrieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for responding to the various suggestions I left. I think I like how the linear algebra section looks now. I've left a few things that we could probably be delayed until a follow up with the idea that we want to get the ball rolling, in particular with things like #3691


public interface RealMatrix extends LinearOperator {
@Nonnull
double[][] getData();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be removed? I ask because there's a discussion about using explicit calls to toRowMajor() and toColumnMajor() on a matrix prior to calling .getData() so that the user doesn't get confused about whether getData() returns data in a row-major or column-major orientation. I think that makes sense, but if RealMatrix still has a getData method on it, then the user can forget to make that call, whereas if the method is only on RowMajorRealMatrix and ColumnMajorRealMatrix, the compiler will force them to do that (or make a cast)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good suggestion. I think I will do that.

@normen662 normen662 merged commit 326de14 into FoundationDB:main Oct 23, 2025
8 checks passed
normen662 added a commit to normen662/fdb-record-layer that referenced this pull request Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants