def __init__(self): plotocc.__init__(self) self.compound = TopoDS_Compound() self.builder = BRep_Builder() self.builder.MakeCompound(self.compound) mmat = math_Matrix(1, 4, 1, 3, 0.0) mmat.SetDiag(1.0) print(mmat.Determinant()) print(mmat.DumpToString()) mvec = math_Vector(1, 3) print(mvec.Norm()) print(mvec.DumpToString())
def test_Standard_Real_by_ref_passed_returned(self) -> None: ''' Check getters and setters for method that take/return Standard_Real by reference. Ref github Issue #710 ''' # create a 2*2 matrix # | -1. -2. | # m = | 4. 5.5 | # lower indices are 0, to comply with python list indexing mat = math_Matrix(0, 1, 0, 1) mat.SetValue(0, 0, -1) mat.SetValue(0, 1, -2) mat.SetValue(1, 0, 4) mat.SetValue(1, 1, 5.5) # the returned value should be the same self.assertEqual(mat.GetValue(0, 0), -1) self.assertEqual(mat.GetValue(0, 1), -2) self.assertEqual(mat.GetValue(1, 0), 4) self.assertEqual(mat.GetValue(1, 1), 5.5)