pub trait Vecu8 {
Show 13 methods fn dotpu8(self, v: &[u8]) -> u64;
fn cosineu8(self, v: &[u8]) -> f64;
fn vsubu8(self, v: &[u8]) -> Vec<f64>;
fn vaddu8(self, v: &[u8]) -> Vec<f64>;
fn vdistu8(self, v: &[u8]) -> f64;
fn cityblockdu8(self, v: &[u8]) -> f64;
fn vdistsqu8(self, v: &[u8]) -> u64;
fn pdfu8(self) -> Vec<f64>;
fn entropyu8(self) -> f64;
fn jointpdfu8(self, v: &[u8]) -> Vec<Vec<u32>>;
fn jointentropyu8(self, v: &[u8]) -> f64;
fn dependenceu8(self, v: &[u8]) -> f64;
fn independenceu8(self, v: &[u8]) -> f64;
}
Expand description

Methods specialised to, or more efficient for &[u8]

Required methods

Scalar product of two (positive) u8 slices.
Must be of the same length - no error checking (for speed)

Cosine between two (positive) u8 slices.

Vector subtraction (converts results to f64 as they can be negative)

Vector addition ( converts results to f64, as they can exceed 255 )

Euclidian distance between self &u8 and v:&u8.
Faster than vsub followed by vmag, as both are done in one loop

cityblock distance

Euclidian distance squared, the arguments are both of &u8 type

Probability density function of bytes data

Information (entropy) of &u8 (in nats)

Joint probability density function (here just co-occurence counts) of paired values in two vectors of bytes of the same length. Needs n^2 x 32bits of memory.

Joint entropy of &u8,&u8 (in nats)

Statistical pairwise dependence of two &u8 variables in the range [0,1]

Independence in the range [1,2] of two &u8 variables

Implementations on Foreign Types

Scalar product of two (positive) u8 slices.
Must be of the same length - no error checking (for speed)

Cosine between two (positive) u8 slices.

Vector subtraction (converts results to f64 as they can be negative)

Vector addition ( converts results to f64, as they can exceed 255 )

Euclidian distance between self &u8 and v:&u8.
Faster than vsub followed by vmag, as both are done in one loop

cityblock distance

Euclidian distance squared, the arguments are both of &u8 type

Probability density function of bytes data

Information (entropy) of &u8 (in nats)

Joint probability density function (here just co-occurence counts) of successive pairs of values from two vectors of bytes of the same lenghts n. Needs 4*256^2=262144 bytes of heap memory, which will be sparse except for long input vectors.

Joint entropy of &u8,&u8 (in nats)

Statistical pairwise dependence in range [0,1] of two &u8 variables returns 0 iff they are statistically pairwise independent returns 1 if they are identical or all values are unique

Independence in the range [1,2] of two &u8 variables e.g. 2 is returned iff they are statistically pairwise independent returns 1 if they are identical or all values are unique

Implementors