DiscussionsIssue archiveOCCT:Foundation Classes

Archived issue #0029289

Wrong derivatives in math_TrigonometricFunctionRoots.cxx file

CommunityOCCT:Foundation Classesclosed27 public notes

Search issues

Description

Hallo, in OCC 7.2.0 it seems that the derivatives implemented in MyTrigoFunction::Derivative() and MyTrigoFunction::Derivatives() are wrong (see file math_TrigonometricFunctionRoots.cxx). In fact it seems that in MyTrigoFunction::Derivative() the code "D-=CC*SN+DD*CN;" should be corrected to "D+=-CC*SN+DD*CN;", while in MyTrigoFunction::Derivatives() the code "D = -AACN*SN + BB*(CN*CN+SN*SN);" should be corrected to "D = -AACN*SN + BB*(CN*CN-SN*SN);". Please, can you check?

Author

Steps to reproduce

Test case
bugs modalg_7 bug29289

Public activity

27 archived notes

Participants are labeled by their role within this record.

01Commenter 1
I completely agree
02Commenter 2
I have attached the picture from the old repository where this code has been changed last time (20 years ago).
03Commenter 3
Dear Igor, please take care of this bug.
04Commenter 4
Besides, I have run tests with the fix applied, and observed no differences from master. It seems that this functional is almost never used.
05Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: ifv
Date: Thu Nov 9 17:20:10 2017 +0300

    0029289: Wrong derivatives in math_TrigonometricFunctionRoots.cxx file
    
    Class MyTrigoFunction is removed from file math_TrigonometricFunctionRoots.cxx.
    New class math_TrigonometricEquationFunction with the same functionality is created to provide possibilities
    for individual testing.
    Expressions for derivatives are corrected.
    New Draw command "intconcon" for intersection 2d conic curves is created.
    Test command OCC29289 (file QABugs_20.cxx) is created for individual testing math_TrigonometricEquationFunction.
    It is used in tests/bugs/modalg_7/bug29289
06Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
07Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
08Commenter 8
Branches CR29289 and CR29289_prod are ready for review.
Test results in jenkins CR29289-CR29289_prod-IFV
09Commenter 9
Remarks:

src/GeomliteTest/GeomliteTest_API2dCommands.cxx
- 433 and others. It is unsafe to assign pointer to the address of the local variable, at this pointer having longer life cycle than the variable. It is needed to use operator new to allocate memory, and use std::auto_ptr to store the pointer.
- 490: incorrect indent and using tab character.

src/math/math_TrigonometricEquationFunction.hxx
- rename private class members like AA -> myAA.
10Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
11Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
12Commenter 12
CR29289 is updated according to remarks
13Commenter 13
Reviewed.
14Commenter 1
Combination -
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 20668.26000000056 / 20769.880000000467 [-0.49%]
Products
Total CPU difference: 7860.150000000077 / 7901.260000000098 [-0.52%]
Windows-64-VC10:
OCCT
Total CPU difference: 18482.28087539841 / 18481.95327329852 [+0.00%]
Products
Total CPU difference: 7854.291547699987 / 7874.587277799976 [-0.26%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

New test case is OK
15Commenter 1
I created IR-WEEK47 for branches with status TESTED.
CR29289 rebased on all others branches caused problem of compilation on all platforms.
I removed CR29289 from IR-WEEK47.
Problems are here:
http://jenkins-test-10.nnov.opencascade.com/view/IR-WEEK47-INV/view/OCCT%20compile/job/IR-WEEK47-INV-OCCT-Windows-64-VC10-opt-compile/3/parsed_console/
16Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: ifv
Date: Thu Nov 23 13:34:52 2017 +0300

    Fix for compilation problems with auto_ptr

17Commenter 17
CR29289 is updated to fix compilation problems
18Commenter 1
19Commenter 19
Dear Igor,
1. Please correct the code of the new command intconcon so that to put information message in console with each "return 1".
2. See the example of usage of unique_ptr in OSD_Parallel.hxx.
20Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
21Commenter 21
CR29289 is updated to fix problem with unique/auto_ptr
22Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
23Commenter 1
24Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
25Commenter 25
Correct version of the branch has been restored.
26Commenter 1
27Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records