Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Assignment 4] Part 2, finding K and b #63

Open
yichangC opened this issue Apr 8, 2019 · 2 comments
Open

[Assignment 4] Part 2, finding K and b #63

yichangC opened this issue Apr 8, 2019 · 2 comments

Comments

@yichangC
Copy link

yichangC commented Apr 8, 2019

Hi Prof. and TA,

I'm trying to find the K and b for the lease-squares error in quadratic from:
S^T K s + S^T b + c

The way to solve it is explained in this issue:
danielepanozzo/gp#13

My questions are:

  1. In the issue, it's mentioned that "the "G" matrix I believe you refer to, which can be computed by igl::grad, holds the G_t for each triangle t (but not directly stacked: it chooses to place row i of G_t in G.row(i * #F + t))"
    I don't really understand what it means, could you provide more explanation?

  2. According to @jpanetta, the expression could be written as: E_1(s) = s^T G^T G s - 2 s^T G^T u + const, however, G^T (3F * V) * u (F * 3) cannot produce a valid matrix. Am I missing anything?

Thanks.

@jiangzhongshi
Copy link
Collaborator

Hi,

  1. The gradient of a scalar function on the mesh (G*f) will have three components for each triangle, say (Gf)_x, (Gf)_y, (Gf)_z, each has size |F| * |V| and is then stacked together. Each row i of G_t corresponds to a coordinate (x/y/z), so the stack rule you wrote, corresponds to stacking, vertically, (Gf)_x, (Gf)_y, (Gf)_z together.

  2. After understanding what G means, the three columns of u, is just the x/y/z component, and you would like to put them in correspondence of three components of G. Therefore, just flatten u into a (3F1) vector will suffice. Also, G is 3FV, so G^T should be V*3F

@LihengGong
Copy link

LihengGong commented Apr 18, 2019

Hi Zhongshi,
Quick questions:

  1. By stacking, vertically, (Gf)_x, (Gf)_y, (Gf)_z together. do you mean that all x coordinates are stacked together(forming the first #F rows), followed by all y coordinates(forming the second #F rows), then followed by all z coordinates(forming the last #F rows)?

  2. By the three columns of u, is just the x/y/z component, you would like to put them in correspondence of three components of G do you mean that we stack matrix u into a vector such that the first #F rows are the first column, the second #F rows are the second column and the last #F rows are the third column?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants