C + + implementation of Grid watermark Debug Notes (III.)--Initial results

Source: Internet
Author: User

Error:

Error C2338:the_bracket_operator_is_only_for_vectors__use_the_parenthesis_operator_instead

This error does not directly navigate to the line, you have to slowly look at the code, to find out the incorrect access.

Cause: Using [] access caused by error,access to the matrix ineigen is not used []

Workaround: will be [] instead ()

After the error is modified, the compilation is passed, but the runtime is interrupted.

Problems when debugging, encountering code that does not jump

when the code runs in debug mode to Eigendef.callapmatrix () , it does not jump into the function, after setting breakpoints in VS, the breakpoint is consistently unreachable, the heart of the breakpoint is programmed with a hollow yellow, and an exclamation point

Solution: in the tool à Options à Debug à remove the "Require source file to match original version exactly" check in the general

However, after modifying this setting may result in modified vs code, even if rebuilt, but the results of the operation is still the last time the result, this inexplicable problem once bothered me for a long, with the help of senior, understand the problem of the PDB, and then

Solution : This time can be common sense to format the code, shortcut keys are: Ctrl + K and then CTRL + F

error : R6010–abort () has been called

Error occurs when assigning a value to V_matrix

The reason is that the matrix has no initialization size before use

workaround : You can use the following statement to set the size of the matrix and set its initial value to 0

Error:the error message in MATLAB code is as follows

The corresponding MATLAB code is as follows:

This problem debugging for a long time did not find out the cause of the error, and then copied a copy of the file, and then modify the file name and function name and the output matrix name, and then you can, perhaps the matrix can not be used as a variable name and function name?

FIX: modify file name and function name

/////////////////////////////////////////////////////////////////////////////////

After correcting the above errors, the result is much worse than expected, so start modifying some of the logical errors.

The initial estimate is that there was an error in solving the equation. Prepare to check if the matrix assignment is incorrect.

Left: Top 10 vertex coordinates, right: incoming vertex coordinates in MATLAB

The following assignment statement is the modified result, and the assigned value of the vertex data is correct after the modification.

As well as the E-matrix: (Picture for correct result)

R Matrix:

Results obtained after the modification

Input:

Output:

And the first 10 vertices before and after modifying the coordinate values:

The naked eye has no way of seeing what's changed in the model.

C + + implementation of Grid watermark Debug Notes (III.)--Initial results

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.