Open CASCADE Technology
6.5.4
|
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx>
#include <Standard_Integer.hxx>
#include <math_DoubleTabOfReal.hxx>
#include <Standard_Real.hxx>
#include <Standard_Address.hxx>
#include <math_Vector.hxx>
#include <Standard_OStream.hxx>
#include <math_Matrix.lxx>
Data Structures | |
class | math_Matrix |
This class implements the real matrix abstract data type. Matrixes can have an arbitrary range which must be defined at the declaration and cannot be changed after this declaration math_Matrix(-3,5,2,4); //a vector with range [-3..5, 2..4] Matrix values may be initialized and retrieved using indexes which must lie within the range of definition of the matrix. Matrix objects follow "value semantics", that is, they cannot be shared and are copied through assignment Matrices are copied through assignement: math_Matrix M2(1, 9, 1, 3); ... M2 = M1; M1(1) = 2.0;//the matrix M2 will not be modified. The exception RangeError is raised when trying to access outside the range of a matrix : M1(11, 1)=0.0// --> will raise RangeError. The exception DimensionError is raised when the dimensions of two matrices or vectors are not compatible. math_Matrix M3(1, 2, 1, 2); M3 = M1; // will raise DimensionError M1.Add(M3) // --> will raise DimensionError. A Matrix can be constructed with a a pointer to "c array". It allows to carry the bounds inside the matrix. Exemple : Standard_Real tab1[10][20]; Standard_Real tab2[200]; math_Matrix A (tab1[0][0], 1, 10, 1, 20); math_Matrix B (tab2[0], 1, 10, 1, 20); More... |