mirror of
https://github.com/tuneinsight/lattigo.git
synced 2025-09-13 03:27:14 +00:00
Vector and Matrix now use []T and [][]T as underlying types, which makes them more versatile and easy to cast to from slices. Map still uses map[K]V as map values cannot be addressed and this is anoying to use. I also got rid of the Codec[T] type as it can be replaced with a 3-liner (i.e., equivalent to calling the Codex and checking the error). There is also a small change of the OperendQ.Encode method that now uses OperandQ.WriteTo instead of OperandQ.Encode (since it is a bit fasterfor some reason...). This is an experiment and more work on the serialization is needed.
19 lines
364 B
Go
19 lines
364 B
Go
// Package structs implements helpers to generalize vectors and matrices of structs, as well as their serialization.
|
|
package structs
|
|
|
|
type CopyNewer[V any] interface {
|
|
CopyNew() *V
|
|
}
|
|
|
|
type BinarySizer interface {
|
|
BinarySize() int
|
|
}
|
|
|
|
type Encoder interface {
|
|
Encode(p []byte) (n int, err error)
|
|
}
|
|
|
|
type Decoder interface {
|
|
Decode(p []byte) (n int, err error)
|
|
}
|