Decode decodes the byte array into a vector and returns any remaining bytes.
(b []byte)
| 124 | |
| 125 | // Decode decodes the byte array into a vector and returns any remaining bytes. |
| 126 | func Decode(b []byte) (remaining []byte, ret T, err error) { |
| 127 | var n uint32 |
| 128 | b, n, err = encoding.DecodeUint32Ascending(b) |
| 129 | if err != nil { |
| 130 | return nil, nil, err |
| 131 | } |
| 132 | ret = make(T, n) |
| 133 | for i := range ret { |
| 134 | b, ret[i], err = encoding.DecodeUntaggedFloat32Value(b) |
| 135 | if err != nil { |
| 136 | return nil, nil, err |
| 137 | } |
| 138 | } |
| 139 | return b, ret, nil |
| 140 | } |
| 141 | |
| 142 | // L1Distance returns the L1 (Manhattan) distance between t and t2. |
| 143 | func L1Distance(t T, t2 T) (float64, error) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…