Python numpy.polynomial.legendre.legmul() Examples
The following are 30
code examples of numpy.polynomial.legendre.legmul().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
numpy.polynomial.legendre
, or try the search function
.
Example #1
Source File: test_legendre.py From coffeegrindsize with MIT License | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #2
Source File: test_legendre.py From pySINDy with MIT License | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #3
Source File: test_legendre.py From mxnet-lambda with Apache License 2.0 | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #4
Source File: test_legendre.py From mxnet-lambda with Apache License 2.0 | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #5
Source File: test_legendre.py From ImageFusion with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #6
Source File: test_legendre.py From ImageFusion with MIT License | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #7
Source File: test_legendre.py From elasticintel with GNU General Public License v3.0 | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #8
Source File: test_legendre.py From elasticintel with GNU General Public License v3.0 | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #9
Source File: test_legendre.py From coffeegrindsize with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #10
Source File: test_legendre.py From pySINDy with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #11
Source File: test_legendre.py From coffeegrindsize with MIT License | 5 votes |
def test_legpow(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) c = np.arange(i + 1) tgt = reduce(leg.legmul, [c]*j, np.array([1])) res = leg.legpow(c, j) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #12
Source File: test_legendre.py From Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #13
Source File: test_legendre.py From Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda with MIT License | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #14
Source File: test_legendre.py From twitter-stock-recommendation with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #15
Source File: test_legendre.py From twitter-stock-recommendation with MIT License | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #16
Source File: test_legendre.py From keras-lambda with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #17
Source File: test_legendre.py From keras-lambda with MIT License | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #18
Source File: test_legendre.py From Mastering-Elasticsearch-7.0 with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #19
Source File: test_legendre.py From recruit with Apache License 2.0 | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #20
Source File: test_legendre.py From recruit with Apache License 2.0 | 5 votes |
def test_legpow(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) c = np.arange(i + 1) tgt = reduce(leg.legmul, [c]*j, np.array([1])) res = leg.legpow(c, j) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #21
Source File: test_legendre.py From auto-alt-text-lambda-api with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #22
Source File: test_legendre.py From auto-alt-text-lambda-api with MIT License | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #23
Source File: test_legendre.py From vnpy_crypto with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #24
Source File: test_legendre.py From vnpy_crypto with MIT License | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #25
Source File: test_legendre.py From Computable with MIT License | 5 votes |
def test_legmul(self) : # check values of result for i in range(5) : pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5) : msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #26
Source File: test_legendre.py From Computable with MIT License | 5 votes |
def test_legdiv(self) : for i in range(5) : for j in range(5) : msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #27
Source File: test_legendre.py From recruit with Apache License 2.0 | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)
Example #28
Source File: test_legendre.py From Mastering-Elasticsearch-7.0 with MIT License | 5 votes |
def test_legdiv(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) ci = [0]*i + [1] cj = [0]*j + [1] tgt = leg.legadd(ci, cj) quo, rem = leg.legdiv(tgt, ci) res = leg.legadd(leg.legmul(quo, ci), rem) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #29
Source File: test_legendre.py From Mastering-Elasticsearch-7.0 with MIT License | 5 votes |
def test_legpow(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) c = np.arange(i + 1) tgt = reduce(leg.legmul, [c]*j, np.array([1])) res = leg.legpow(c, j) assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #30
Source File: test_legendre.py From GraphicDesignPatternByPython with MIT License | 5 votes |
def test_legmul(self): # check values of result for i in range(5): pol1 = [0]*i + [1] val1 = leg.legval(self.x, pol1) for j in range(5): msg = "At i=%d, j=%d" % (i, j) pol2 = [0]*j + [1] val2 = leg.legval(self.x, pol2) pol3 = leg.legmul(pol1, pol2) val3 = leg.legval(self.x, pol3) assert_(len(pol3) == i + j + 1, msg) assert_almost_equal(val3, val1*val2, err_msg=msg)