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