## ~mht

#### ~mht/public-inbox

Last active 6 months ago

#### ~mht/plyers

Last active 2 years ago

#### ~mht/testing

Last active 5 years ago

### Recent activity

#### Re: Regarding "Efficient Simulation Through Linear Algebra" 6 months ago

From martin to ~mht/public-inbox

```> I really enjoyed your post https://mht.wtf/post/sparse-solves/

Thank you! I'm happy to hear that.

> When I once encountered a similar problem I solved it using the
> Conjugate Gradient method. Since I only have to evaluate the matrix (H
> in your case) for CG, I could also reduce the "dense" part to a few dot
> products, although once for each CG iteration.

That's interesting. For the same project mentioned in the post I experimented a bunch with different solvers. I knew that CG was pretty widely used, but for whatever reason the implementation I used (Eigen) was either not very good, or somehow didn't fit any of the problems I applied it to (even though the docs made it sound like it would be a pretty good match).

> I think it can also be applied recursively if there are multiple
> overlapping rank-1 dense blocks.```

#### Re: [_]struct within [_]struct (was comptime map) 1 year, 10 months ago

From martin to ~andrewrk/ziglang

```Hey Peter!

I've followed your thread for the past few weeks, and while I certainly can appreciate your concrete questions, I'm not sure I understand what your overall goal is. (i.e., maybe we've got an XY-problem at hand, where you ask for something that's awkward to do in Zig but the problem you're having could be solved by something different, which would be easy to do in Zig)  It looks like you have a bunch of states that each have a slice of other states that they'd want to invoke somehow, from an event or something. Could you be a little more descriptive?

I hope I can offer some insight on tuples though, because it's actually really simple; a tuple is just an anonymous struct, in which the struct fields have the names `0`, `1`, ...

For instance,

const std = @import("std");
​pub fn main() !void {
const foo = .{ 10, -2, 99 };
std.debug.print("{}\n", .{ foo.@"1" });
}```