Download 10.py from TestCaseGeneration/NumFEM_Eval: direct link, hf CLI and curl.
- Browser
- Download file 667 Bytes
-
https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/10.py
- Command line
-
hf download hf://datasets/TestCaseGeneration/NumFEM_Eval/10.py
-
curl -L -o 10.py https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/10.py
667 Bytes
| def lobatto_interval(count): | |
| from math import sqrt | |
| from numpy import array | |
| if count <= 2: | |
| p = array([-1.0, 1.0]) | |
| w = array([1.0, 1.0]) | |
| return p, w | |
| elif count == 3: | |
| p = array([-1.0, 0.0, 1.0]) | |
| w = array([1.0 / 3.0, 4.0 / 3.0, 1.0 / 3.0]) | |
| return p, w | |
| elif count == 4: | |
| p = array([-1.0, -1.0 / sqrt(5.0), 1.0 / sqrt(5.0), 1.0]) | |
| w = array([1.0 / 6.0, 5.0 / 6.0, 5.0 / 6.0, 1.0 / 6.0]) | |
| return p, w | |
| else: | |
| p = array([-1.0, -sqrt(3.0 / 7.0), 0.0, sqrt(3.0 / 7.0), 1.0]) | |
| w = array([1.0 / 10.0, 49.0 / 90.0, 32.0 / 45.0, 49.0 / 90.0, 1.0 / 10.0]) | |
| return p, w |