Click here to Skip to main content
15,893,337 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: Preprocessor Directives in C Program Pin
Peter_in_278023-Apr-19 12:15
professionalPeter_in_278023-Apr-19 12:15 
GeneralRe: Preprocessor Directives in C Program Pin
leon de boer23-Apr-19 14:43
leon de boer23-Apr-19 14:43 
GeneralRe: Preprocessor Directives in C Program Pin
Richard MacCutchan23-Apr-19 21:14
mveRichard MacCutchan23-Apr-19 21:14 
QuestionThe GOD Pin
hbtalha21-Apr-19 7:30
hbtalha21-Apr-19 7:30 
AnswerRe: The GOD Pin
Gerry Schmitz21-Apr-19 7:51
mveGerry Schmitz21-Apr-19 7:51 
QuestionVector of Class with Array Pin
T Bones Jones19-Apr-19 10:21
T Bones Jones19-Apr-19 10:21 
AnswerRe: Vector of Class with Array Pin
CPallini19-Apr-19 10:32
mveCPallini19-Apr-19 10:32 
GeneralRe: Vector of Class with Array Pin
T Bones Jones19-Apr-19 11:04
T Bones Jones19-Apr-19 11:04 
Here is the code section that actually crashes:
for (unsigned i=0; i<frames; i++)
    {
     Matrix F(4,4); // functional alignment matrix
     double angle;
     F=BA.inverse() * Jtertiary.at(i) * MA; // tertiary axis functional alignment
     //Remove Tertiary Translation
     trans(x)=F(x,3);   trans(y)=F(y,3); trans(z)=F(z,3);
     trans(tertiaryaxis)=0;

     if (tertiaryaxis==X)
      {
       angle=ExtractX(F.inner(), RotationSequence);
       F=(Xrot(angle).transpose() * F.inner()).homogeneous();
       F(x,3)=0; F(y,3)=trans(y); F(z,3)=trans(z);
       F3.at(i)(1)=trans(x);   F3.at(i)(2)=trans(y); F3.at(i)(3)=trans(z);
     }
     else if (tertiaryaxis==Y)
      {
       angle=ExtractY(F.inner(), RotationSequence);
       F=(Yrot(angle).transpose() * F.inner()).homogeneous();
       F(x,3)=trans(x); F(y,3)=0; F(z,3)=trans(z);
       F3.at(i)(1)=trans(x);   F3.at(i)(2)=trans(y); F3.at(i)(3)=trans(z);
     }
     else if (tertiaryaxis==Z)
      {
       angle=ExtractY(F.inner(), RotationSequence);
       F=(Zrot(angle).transpose() * F.inner()).homogeneous();
       F(x,3)=trans(x); F(y,3)=trans(y); F(z,3)=0;
       F3.at(i)(1)=trans(x);   F3.at(i)(2)=trans(y); F3.at(i)(3)=trans(z);
     }
     else
        throw("ERROR: Tertiary Axis designation invalid for Three Axis Functional Alignment.\n");
     F3.at(i)(0)=degrees(angle);  //sets rotation about axis value into the final answer vector
     E.push_back(BA * F * MA.inverse()); // revised J matrix without tertiary rotation

     if (angle<minangle) minangle=angle;
     if (angle>maxangle) maxangle=angle;
    }


When it crashes it typically crashes at
E.push_back(BA * F * MA.inverse());


E is another vector of Matrix that was passed by reference to this function. My matrix class contains a number of functions that allows for matrix algebra.

I know I could probably re-write the Matrix class to use vectors, but I've been using it for over 10 years (written before I knew about vectors) and I figured if it ain't broke don't fix it. But maybe it is broke, and it just took this long for it to become a problem. If it is broken, can you tell me where?
GeneralRe: Vector of Class with Array Pin
Richard MacCutchan19-Apr-19 21:53
mveRichard MacCutchan19-Apr-19 21:53 
GeneralRe: Vector of Class with Array Pin
CPallini20-Apr-19 4:17
mveCPallini20-Apr-19 4:17 
GeneralRe: Vector of Class with Array Pin
T Bones Jones20-Apr-19 6:31
T Bones Jones20-Apr-19 6:31 
GeneralRe: Vector of Class with Array Pin
CPallini20-Apr-19 7:18
mveCPallini20-Apr-19 7:18 
GeneralRe: Vector of Class with Array Pin
Richard MacCutchan20-Apr-19 22:12
mveRichard MacCutchan20-Apr-19 22:12 
GeneralRe: Vector of Class with Array Pin
T Bones Jones22-Apr-19 4:52
T Bones Jones22-Apr-19 4:52 
GeneralRe: Vector of Class with Array Pin
Richard MacCutchan22-Apr-19 5:52
mveRichard MacCutchan22-Apr-19 5:52 
GeneralRe: Vector of Class with Array Pin
Gerry Schmitz22-Apr-19 8:54
mveGerry Schmitz22-Apr-19 8:54 
QuestionConcept of namespace Pin
Aakashdata16-Apr-19 21:14
Aakashdata16-Apr-19 21:14 
AnswerRe: Concept of namespace Pin
Richard MacCutchan16-Apr-19 22:19
mveRichard MacCutchan16-Apr-19 22:19 
AnswerRe: Concept of namespace Pin
CPallini17-Apr-19 2:06
mveCPallini17-Apr-19 2:06 
AnswerRe: Concept of namespace Pin
harshalipatel17-Apr-19 2:19
harshalipatel17-Apr-19 2:19 
GeneralRe: Concept of namespace Pin
leon de boer20-Apr-19 0:11
leon de boer20-Apr-19 0:11 
GeneralRe: Concept of namespace Pin
Richard MacCutchan20-Apr-19 1:32
mveRichard MacCutchan20-Apr-19 1:32 
GeneralRe: Concept of namespace Pin
jschell21-Apr-19 7:33
jschell21-Apr-19 7:33 
QuestionPopularity Of C among developer Pin
Aakashdata14-Apr-19 21:31
Aakashdata14-Apr-19 21:31 
QuestionRe: Popularity Of C among developer Pin
Richard MacCutchan14-Apr-19 21:32
mveRichard MacCutchan14-Apr-19 21:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.