Matrix multiplication with custom types

Welcome to Julia!

So the error you’re running into is that it wants a zero function defined, which it uses at some point during the matrix multiplication algorithm. So it wants you to define a function zero(::Point) = ... that returns a zero object for the Point type, i.e. something so that that x + zero(Point) == x whenever x is a Point (in other words, zero(T) should return the additive identity for things of type T, but it doesn’t know what this is for Points, so it wants you to define the method).

Formatting tips: PSA: how to quote code with backticks

General posting tips: Please read: make it easier to help you

1 Like