MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / apply_rotation

Method apply_rotation

nodedb-codec/src/vector_quant/opq.rs:163–165  ·  view source on GitHub ↗

Apply the rotation matrix to `v`, returning `R · v`.

(&self, v: &[f32])

Source from the content-addressed store, hash-verified

161
162 /// Apply the rotation matrix to `v`, returning `R · v`.
163 pub fn apply_rotation(&self, v: &[f32]) -> Vec<f32> {
164 matvec(&self.rotation, v, self.dim)
165 }
166
167 fn encode_inner(&self, v: &[f32]) -> (Vec<u8>, UnifiedQuantizedVector) {
168 let rotated = self.apply_rotation(v);

Callers 3

encode_innerMethod · 0.45
prepare_queryMethod · 0.45

Calls 1

matvecFunction · 0.85