CMatrix:Members CMatrix:Remove

CMatrix:Normalize


The Normalize method normalizes the CMatrix to a volume of 1.0.

Syntax

CMatrix:Normalize()

Remarks

This method computes a scale factor to adjust the matrix values to a total sum of 1.0. This factor is applied to the CMatrix. If any matrix members are not numbers, the results are probably not meaningful.

Example

The following script fragment normalizes the CMatrix:

 

M = CMatrix:new()

-- create a CMatrix

   ...

-- set the matrix weights

M:Normalize()

-- compute and apply the normalization factor

Printf("Vol = %lg", M:Volume())

-- result: Vol = 1

Related Topics

CMatrix, Init