Add files
This commit is contained in:
0
python/test/zero_dim/__init__.py
Normal file
0
python/test/zero_dim/__init__.py
Normal file
41
python/test/zero_dim/basics.py
Normal file
41
python/test/zero_dim/basics.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import pybertini as pb
|
||||
|
||||
import unittest
|
||||
|
||||
class ZeroDimBasicsTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
||||
x, y, z = pb.Variable('x'), pb.Variable('y'), pb.Variable('z')
|
||||
|
||||
f1 = x**2 + y**2 - 1
|
||||
f2 = x+y
|
||||
|
||||
sys = pb.System()
|
||||
sys.add_function(f1)
|
||||
sys.add_function(f2)
|
||||
|
||||
sys.add_variable_group(pb.VariableGroup([x,y]))
|
||||
|
||||
solver = pb.nag_algorithm.ZeroDimCauchyAdaptivePrecisionTotalDegree(sys)
|
||||
|
||||
self.sys = sys
|
||||
|
||||
self.solver = solver
|
||||
def test_can_solve_multiple_times(self):
|
||||
"""
|
||||
This test is here because multiple calls to solver.solve() during
|
||||
performance testing caused a crash with message
|
||||
|
||||
```
|
||||
Assertion failed: ((bertini::Precision(x(0))==DoublePrecision() || bertini::Precision(x(0)) == Precision()) && "precision of input vector must match current working precision of patch during rescaling"), function RescalePointToFitInPlace, file patch.hpp, line 405.
|
||||
```
|
||||
|
||||
"""
|
||||
|
||||
self.solver.solve()
|
||||
self.solver.solve()
|
||||
self.solver.solve()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main();
|
||||
12
python/test/zero_dim/test_zero_dim.py
Normal file
12
python/test/zero_dim/test_zero_dim.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import zero_dim.basics as basics
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
mods = (basics,)
|
||||
suite = unittest.TestSuite();
|
||||
for tests in mods:
|
||||
thissuite = unittest.TestLoader().loadTestsFromModule(tests);
|
||||
suite.addTests(thissuite)
|
||||
#
|
||||
unittest.TextTestRunner(verbosity=2).run(suite)
|
||||
Reference in New Issue
Block a user