diff --git a/TcMatrix/TcMatrix/POUs/Array2DStaticMatrix.TcPOU b/TcMatrix/TcMatrix/POUs/Array2DStaticMatrix.TcPOU index 1aab141..06d3330 100644 --- a/TcMatrix/TcMatrix/POUs/Array2DStaticMatrix.TcPOU +++ b/TcMatrix/TcMatrix/POUs/Array2DStaticMatrix.TcPOU @@ -1,16 +1,10 @@  - + - - - - + - + - + - - - - - - - - - - - - - - - + - @@ -491,7 +482,7 @@ END_VAR VAR_INPUT NewRows : UINT; NewCols : UINT; - RetainVals : BOOL;//retains + RetainVals : BOOL; //< retains ClearVals : BOOL; END_VAR VAR @@ -689,7 +680,7 @@ END_IF - - @@ -743,8 +734,6 @@ Shrink := AsShrunk(Temp,Row,Col);]]> diff --git a/TcMatrix/TcMatrix/POUs/ExternalStaticMatrix.TcPOU b/TcMatrix/TcMatrix/POUs/ExternalStaticMatrix.TcPOU index 10ee3f2..7218494 100644 --- a/TcMatrix/TcMatrix/POUs/ExternalStaticMatrix.TcPOU +++ b/TcMatrix/TcMatrix/POUs/ExternalStaticMatrix.TcPOU @@ -1,13 +1,9 @@  - + - @@ -44,7 +42,7 @@ END_IF]]> - diff --git a/TcMatrix/TcMatrix/POUs/Functions/Arrays/Array2D_To_Matrix.TcPOU b/TcMatrix/TcMatrix/POUs/Functions/Arrays/Array2D_To_Matrix.TcPOU index e411490..2fa68c2 100644 --- a/TcMatrix/TcMatrix/POUs/Functions/Arrays/Array2D_To_Matrix.TcPOU +++ b/TcMatrix/TcMatrix/POUs/Functions/Arrays/Array2D_To_Matrix.TcPOU @@ -1,12 +1,12 @@  - + - + - + - + ZeroReference_ : LREAL; // Numbers below this are considered zero for the purposes of avoiding near-divide-by-zero floating point issues +END_VAR]]> @@ -51,7 +37,7 @@ END_VAR - - - + - - @@ -118,16 +99,14 @@ END_VAR - @@ -135,19 +114,18 @@ END_VAR - @@ -155,19 +133,18 @@ END_VAR - @@ -175,19 +152,18 @@ END_VAR - @@ -195,12 +171,10 @@ END_VAR - - - @@ -282,12 +253,12 @@ SubMatrix.FillFrom(M);]]> - @@ -311,14 +282,15 @@ END_FOR]]> - [!NOTE] +/// > If this matrix does not meet the requirements 0 is returned +METHOD PUBLIC GetDeterminant : LREAL //< The determinant of this matrix, if the prerequisites are met. Otherwise, returns 0. VAR_INPUT END_VAR VAR @@ -335,16 +307,17 @@ END_IF - [!NOTE] +/// > If the supplied index is out of bounds the value 0 is returned and a warning is generated in the Error List +METHOD PUBLIC ABSTRACT GetI : LREAL //< The value of the element at the specified index, or 0 if an invalid index is supplied VAR_INPUT - I : UINT;//The index of the element which should have its value returned + I : UINT; //< The index of the element which should have its value returned END_VAR ]]> @@ -352,18 +325,19 @@ END_VAR - [!NOTE] +/// > If the supplied or or column is out of bounds then a warning message is generated in the Error List and the value 0 is returned +METHOD PUBLIC GetRC : LREAL //< The value of the element at the specified row and column, or 0 if an invalid index is supplied VAR_INPUT - Row : UINT;//The row of the element to fetch - Col : UINT;//The column of the element to fetch + Row : UINT; //< The row of the element to fetch + Col : UINT; //< The column of the element to fetch END_VAR ]]> @@ -395,15 +369,16 @@ END_VAR - [!NOTE] +/// > If an invalid dimension is supplied then a warning is generated in the Error List and the value 0 is returned +METHOD PUBLIC GetSize : UINT //< The length of the matrix in the specified dimension, or 0 if the dimension specified is invalid VAR_INPUT - Dim : UINT;//The dimension of the matrix for which the size should be returned. 0=Rows, 1=Cols + Dim : UINT; //< The dimension of the matrix for which the size should be returned. 0=Rows, 1=Cols END_VAR ]]> @@ -418,10 +393,8 @@ END_IF]]> - - + - - [!NOTE] +/// > If this matrix is empty or is not a vector, 0 is returned METHOD PUBLIC GetVectorMagnitude : LREAL//The vector magnitude of this matrix if it is a vector, otherwise 0 -VAR_INPUT -END_VAR VAR Res : LREAL; END_VAR]]> @@ -514,10 +484,10 @@ Row := (Index - Col) / ColCount;]]> - @@ -530,14 +500,14 @@ END_FOR]]> - @@ -545,7 +515,7 @@ END_VAR - - - [!NOTE] +/// > Two empty matricies are considered equal. +METHOD PUBLIC IsEqual : BOOL //< TRUE if the two matricies are equal, FALSE if they are not VAR_IN_OUT CONSTANT - M : Matrix;//The other matrix to compare to this one + M : Matrix; //< The other matrix to compare to this one END_VAR ]]> @@ -620,12 +591,13 @@ IsEqual := TRUE;]]> - [!NOTE] +/// > Two empty matricies are considered the same size. +METHOD PUBLIC IsEqualSize : BOOL //< True if this matrix is the same size as the supplied matrix VAR_IN_OUT CONSTANT - M : Matrix;//The matrix which should have its size compared to the size of this matrix + M : Matrix; //< The matrix which should have its size compared to the size of this matrix END_VAR ]]> @@ -633,16 +605,17 @@ END_VAR - [!NOTE] +/// > Note that two empty matricies are considered equal +METHOD PUBLIC IsNearlyEqual : BOOL //< TRUE if the two matricies are nearly equal, FALSE if they are not VAR_IN_OUT CONSTANT - M : Matrix;//The other matrix to compare to this one + M : Matrix; //< The other matrix to compare to this one END_VAR VAR_INPUT - Precision : LREAL;//Deviation between two elements larger than this value makes them unequal + Precision : LREAL; //< Deviation between two elements larger than this value makes them unequal END_VAR ]]> @@ -673,10 +646,10 @@ IsNearlyEqual := TRUE;]]> - @@ -684,7 +657,7 @@ END_VAR - - - - @@ -731,10 +704,10 @@ END_VAR - @@ -742,10 +715,10 @@ END_VAR - @@ -753,10 +726,10 @@ END_VAR - @@ -764,7 +737,7 @@ END_VAR - - - - [!WARNING] +/// > Many values of exponent could easily cause all of the elements to turn into NaN! METHOD PUBLIC Power VAR_INPUT Exponent : LREAL;//Power with which to raise every element of the matrix @@ -874,11 +843,11 @@ END_FOR]]> - @@ -886,12 +855,12 @@ END_VAR - @@ -899,7 +868,7 @@ END_VAR - - @@ -922,13 +891,13 @@ END_VAR - @@ -936,16 +905,16 @@ END_VAR - @@ -964,10 +933,10 @@ END_IF]]> - - - - @@ -1113,13 +1080,13 @@ END_VAR]]> - - - + - - diff --git a/TcMatrix/TcMatrix/POUs/MatrixAccessors/ShrunkMatrixAccessor.TcPOU b/TcMatrix/TcMatrix/POUs/MatrixAccessors/ShrunkMatrixAccessor.TcPOU index d5ed128..de665d3 100644 --- a/TcMatrix/TcMatrix/POUs/MatrixAccessors/ShrunkMatrixAccessor.TcPOU +++ b/TcMatrix/TcMatrix/POUs/MatrixAccessors/ShrunkMatrixAccessor.TcPOU @@ -1,11 +1,7 @@  - + - - - + - - - + - - - + - @@ -24,7 +18,7 @@ END_VAR - -