mirror of https://github.com/01-edu/public.git
docs(lalgebra_vector) switch addition to var + var, instead of var plus dereferenced ptr
This commit is contained in:
parent
4aebc1576c
commit
168a3c495f
|
@ -8,10 +8,6 @@ Define the associated function `dot`, that calculates the dot product between tw
|
||||||
|
|
||||||
Note: `Vector` must implement `Debug`, `Clone`, `Eq` and `PartialEq`.
|
Note: `Vector` must implement `Debug`, `Clone`, `Eq` and `PartialEq`.
|
||||||
|
|
||||||
#### Important
|
|
||||||
|
|
||||||
Note that in the addition of vector of the example the `Rhs` is not `Self`
|
|
||||||
|
|
||||||
### Expected Functions and Structure
|
### Expected Functions and Structure
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
@ -42,7 +38,7 @@ fn main() {
|
||||||
let vector_1: Vector<i64> = Vector(vec![1, 3, -5]);
|
let vector_1: Vector<i64> = Vector(vec![1, 3, -5]);
|
||||||
let vector_2: Vector<i64> = Vector(vec![4, -2, -1]);
|
let vector_2: Vector<i64> = Vector(vec![4, -2, -1]);
|
||||||
println!("{:?}", vector_1.dot(&vector_2));
|
println!("{:?}", vector_1.dot(&vector_2));
|
||||||
println!("{:?}", vector_1 + &vector_2);
|
println!("{:?}", vector_1 + vector_2);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue