Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
VectorSpace
✓ use vector_space::VectorSpace;
Implements the VectorSpace trait for a custom 2D vector.
use vector_space::VectorSpace;
fn main() {
// Example: implementing VectorSpace for a custom type
struct MyVector(f64, f64);
impl VectorSpace for MyVector {
type Scalar = f64;
fn add(self, other: Self) -> Self {
MyVector(self.0 + other.0, self.1 + other.1)
}
fn scale(self, scalar: Self::Scalar) -> Self {
MyVector(self.0 * scalar, self.1 * scalar)
}
}
println!("VectorSpace trait implemented");
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.