C + + implementation of Grid watermark debug Note (iv)--complete embedding

Source: Internet
Author: User

The next problem is that when the model is symmetric, the result is expected, but when the model is asymmetrical, the result is wrong, as follows:

Input: Vertex: 233

Output:

What the hell is this? , Where's my horse!!!

There seems to be a logical error.

Note that the debug information for the C + + output is as follows:

The error message is: Input to EIG must not contain NaN, then a bunch of hot hot ...

There is also a hint: Matrix is close to singular or badly scaled. Results may inaccurate. Rcond = 8.367225e-021.

The initial estimate is that MATLAB calculates the model eigenvalue with an error. It's always confusing. My place is, why do I enter a symmetric model, the result of the calculation is not a problem, when the input of an asymmetric model, but the above results appear?

Then I looked at the MATLAB code that computed the matrix eigenvalues before,

Among them, Eigs is the method of the characteristic decomposition of matrix in MATLAB. As you can see in the Eigs function of Matlab, there is an error in the 94th line of the functions, MATLAB can continue to see the errors in the further calls, and it should be summed up that there are some invalid values in the matrix of the input. Then I examined the method of calculating the Laplace matrix. I used the form to be the first in the formula,

In other words, the area information is used. When an area of 0 is present, 0 is the divisor. In this paper, the original Laplace matrix is calculated by l= D–a, where D is the diagonal matrix, the diagonal element is the vertex degree, and A is the adjacency matrix. Thinking again and again, decided to re-write the Laplace matrix calculation method and eigenvalue decomposition algorithm.

The matrices are obtained in the following ways:

and the code for MATLAB eigenvalue decomposition

Modified the output of the code: (Of course, first of all see my horse =.) =

Comparison of two models:

The line outlines the model after embedding the watermark.

The following two pictures are some details

And then look at the rabbit. Input: Vertex 1187

Finally, verify with the first cylinder. Vertices: 1180, two models are almost coincident with the naked eye.

From the above results, the first part of the watermark embedded work should be completed. The next step is to extract the watermark.

C + + implementation of Grid watermark debug Notes (iv)--complete embedding

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.