Having troubles in performing matrix operations (using dnAnalytics library)

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
Hi there:
Im having trouble performing matrix operations. Im using dnAnalytics library; however Im sure that you experts can catch the mistake, which I believe is not due to the dnAnalytics, but due to my code.
Heres a piece of my code.


<div style="color:Black;background-color:White; <pre>
            <span style="color:Blue; #region Arrowhead Calculations            

            List<Vector> displacementUnitVector = <span style="color:Blue; new List<Vector>();

            List<Matrix> orthogonal = <span style="color:Blue; new List<Matrix>();

            List<Matrix> orthogonalArrowHead0 = <span style="color:Blue; new List<Matrix>();

            System.Windows.Media.Matrix identity = <span style="color:Blue; new System.Windows.Media.Matrix(1, 0, 0, 1, 0, 0);

            <span style="color:Blue; for (<span style="color:Blue; int i = 0; i < a.Nodes.Count(); i++)
            {
                Vector tempDisplacementUnitVector = <span style="color:Blue; new SparseVector(3);                

                <span style="color:Blue; for (<span style="color:Blue; int j = 0; j < 3; j++)
                {
                    tempDisplacementUnitVector[j] = a.Nodes.ElementAt(i).Displacement[j] / displacement.ElementAt(i);
                    displacementUnitVector.Add(tempDisplacementUnitVector);
                }

                Matrix tempOrthogonal = <span style="color:Blue; new SparseMatrix(3, 3);

                Matrix tempDotProduct = <span style="color:Blue; new SparseMatrix(3, 3);

                tempOrthogonal = identity - tempDotProduct.Multiply(displacementUnitVector.ElementAt(i), displacementUnitVector.ElementAt(i)); <span style="color:Green; //ERROR ERROR ERROR
            }

            <span style="color:Blue; #endregion   
[/code]
The error is as follows
Error<span style="white-space:pre 1<span style="white-space:pre
Operator - cannot be applied to operands of type System.Windows.Media.Matrix and void<span style="white-space:pre
C:UsersadityatanDesktopPurdue UniversityspecsClassesClassesForm1.cs<span style="white-space:pre
660<span style="white-space:pre 34<span style="white-space:pre
CEFormApplication
Any idea? Thanks in advance.
Aditya


<br/>


View the full article
 
Back
Top