Libraries.Compute.MatrixTransform.Reshape Documentation

This is a MatrixTransform class to reshape the size of a Matrix and fill empty values. Attribute Returns A new matrix after the operation is performed. Attribute Parameter offsetRow The row offset for the first element in the new matrix. Attribute Parameter offsetColumn The column offset for the first element in the new matrix. Attribute Parameter rows The number of rows to extract. Attribute Parameter columns The number of columns to extract. Attribute Parameter fillValue The value to fill in any undefined cells in the new matrix. Attribute Returns A new matrix after the operation is performed.

Example Code

use Libraries.Compute.Matrix
    use Libraries.Compute.MatrixTransform.Reshape

    class Main 
        action Main
            Matrix matrix
            matrix:Fill(4, 4, 0.0)
            matrix:SetColumn(0, 1.1)
            matrix:SetColumn(1, 2.1)
            matrix:SetColumn(2, 3.1)
            matrix:SetColumn(3, 4.1)
            Reshape reshape
            reshape:SetValues(1, 1, 6, 6, 0.0)
            Matrix result = reshape:Transform(matrix)
            output result:ToText()
        end
    end

Inherits from: Libraries.Language.Object, Libraries.Compute.MatrixTransform.MatrixTransform

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetColumns()This method get the number of columns for the matrix transform.
GetFillValue()This method returns the FillValue of the matrix transform.
GetHashCode()This action gets the hash code for an object.
GetOffsetColumn()This method gets the offsetColumn for the matrix transform.
GetOffsetRow()This method gets the offsetRow for the matrix transform.
GetRows()This method gets the number of rows for the matrix transform.
SetColumns(integer columns)This method sets the columns for the matrix transform.
SetFillValue(number fillValue)This method sets the FillValue of the matrix transform.
SetOffsetColumn(integer offsetColumn)This method sets the offsetColumn for the matrix transform.
SetOffsetRow(integer offsetRow)This method sets the offsetRow for the matrix transform.
SetRows(integer rows)This method sets the rows for the matrix transform.
SetValues(integer offsetRow, integer offsetColumn, integer rows, integer columns, number fillValue)This method sets all the value parameters for the matrix transform.
Transform(Libraries.Compute.Matrix matrix)This method applies the transform to the Matrix.

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetColumns()

This method get the number of columns for the matrix transform. Attribute Returns The number of columns to extract.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetColumns(6)
                output reshape:GetColumns()
            end
        end

Return

integer:

GetFillValue()

This method returns the FillValue of the matrix transform. Attribute Returns The FillValue of the matrix transform.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetFillValue(0.0)
                output reshape:GetFillValue()
            end
        end

Return

number:

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetOffsetColumn()

This method gets the offsetColumn for the matrix transform. Attribute Returns The column offset for the first element in the new matrix.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetOffsetColumn(1)
                output reshape:GetOffsetColumn()
            end
        end

Return

integer:

GetOffsetRow()

This method gets the offsetRow for the matrix transform. Attribute Returns The row offset for the first element in the new matrix.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetOffsetRow(1)
                output reshape:GetOffsetRow()
            end
        end

Return

integer:

GetRows()

This method gets the number of rows for the matrix transform. Attribute Returns The number of rows to extract.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetRows(6)
                output reshape:GetRows()
            end
        end

Return

integer:

SetColumns(integer columns)

This method sets the columns for the matrix transform. Attribute Parameter columns The number of columns to extract.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetColumns(6)
                output reshape:GetColumns()
            end
        end

Parameters

SetFillValue(number fillValue)

This method sets the FillValue of the matrix transform. Attribute Parameter The FillValue of the matrix transform.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetFillValue(0.0)
                output reshape:GetFillValue()
            end
        end

Parameters

SetOffsetColumn(integer offsetColumn)

This method sets the offsetColumn for the matrix transform. Attribute Parameter offsetColumn The column offset for the first element in the new matrix.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetOffsetColumn(1)
                output reshape:GetOffsetColumn()
            end
        end

Parameters

SetOffsetRow(integer offsetRow)

This method sets the offsetRow for the matrix transform. Attribute Parameter offsetRow The row offset for the first element in the new matrix.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetOffsetRow(1)
                output reshape:GetOffsetRow()
            end
        end

Parameters

SetRows(integer rows)

This method sets the rows for the matrix transform. Attribute Parameter rows The number of rows to extract.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetRows(6)
                output reshape:GetRows()
            end
        end

Parameters

SetValues(integer offsetRow, integer offsetColumn, integer rows, integer columns, number fillValue)

This method sets all the value parameters for the matrix transform. Attribute Parameter offsetRow The row offset for the first element in the new matrix. Attribute Parameter offsetColumn The column offset for the first element in the new matrix. Attribute Parameter rows The number of rows to extract. Attribute Parameter columns The number of columns to extract. Attribute Parameter fillValue The value to fill in any undefined cells in the new matrix.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Reshape reshape
                reshape:SetValues(1, 1, 6, 6, 0.0)
            end
        end

Parameters

Transform(Libraries.Compute.Matrix matrix)

This method applies the transform to the Matrix. Attribute Parameter The matrix to transform. Attribute Returns A new matrix after the operation is performed.

Example Code

use Libraries.Compute.Matrix
        use Libraries.Compute.MatrixTransform.Reshape

        class Main 
            action Main
                Matrix matrix
                matrix:Fill(4, 4, 0.0)
                matrix:SetColumn(0, 1.1)
                matrix:SetColumn(1, 2.1)
                matrix:SetColumn(2, 3.1)
                matrix:SetColumn(3, 4.1)
                Reshape reshape
                reshape:SetValues(1, 1, 6, 6, 0.0)
                Matrix result = reshape:Transform(matrix)
                output result:ToText()
            end
        end

Parameters

Return

Libraries.Compute.Matrix: