Hacker News new | ask | show | jobs
by Jeff_Brown 1807 days ago
EDIT: I'm leaving this here to help anyone else who might have been confused by this, which I imagine is likely.

What confused me is that the author is not treating the matrix as a function from vectors to vectors, as is the customary way to treat matrices as functions. Rather, they're using the matrix to represent a sparse, regular sampling of a function from vectors to scalars.

---

This article makes no sense right off the bat. Here's the first substantive passage:

"[Laplace's Equation means] Find me a function f where every value everywhere is the average of the values around it ... In this post, when we talk about a function f we mean a 2D matrix where each element is some scalar value like temperature or pressure or electric potential ... If it seems weird to call a matrix a function, just remember that all matrices map input coordinates (i,j) to output values f(i,j). Matrices are functions that are just sparsely defined. This particular matrix does satisfy Laplace's equation because each element [of the matrix] is equal to the average of its neighbors."

The values of a function are the outputs it maps its inputs to. The elements of the matrix are neither inputs nor outputs.

4 comments

The matrix is the function. The elements are the outputs. The coordinates are the inputs.

Take, for example, f(x) = x*x. Its matrix would be: f = [0, 1, 4, 9, 16].

A matrix can be seen as the discrete representation of a function…
Think of the matrix as a precomputed lookup table.

Given the arguments to the function, locate the cell in the matrix and use its value as the result of the function.

Poisson's Equation takes another function as an input, the matrix is the representation of the output of said function