- 阅读权限
- 255
- 威望
- 0 级
- 论坛币
- 50288 个
- 通用积分
- 83.6306
- 学术水平
- 253 点
- 热心指数
- 300 点
- 信用等级
- 208 点
- 经验
- 41518 点
- 帖子
- 3256
- 精华
- 14
- 在线时间
- 766 小时
- 注册时间
- 2006-5-4
- 最后登录
- 2022-11-6
|
Generate a Van der Monde matrix.
- Examples
- >>>
- >>> x = np.array([1, 2, 3, 5])
- >>> N = 3
- >>> np.vander(x, N)
- array([[ 1, 1, 1],
- [ 4, 2, 1],
- [ 9, 3, 1],
- [25, 5, 1]])
- >>>
- >>> np.column_stack([x**(N-1-i) for i in range(N)])
- array([[ 1, 1, 1],
- [ 4, 2, 1],
- [ 9, 3, 1],
- [25, 5, 1]])
- >>>
- >>> x = np.array([1, 2, 3, 5])
- >>> np.vander(x)
- array([[ 1, 1, 1, 1],
- [ 8, 4, 2, 1],
- [ 27, 9, 3, 1],
- [125, 25, 5, 1]])
- >>> np.vander(x, increasing=True)
- array([[ 1, 1, 1, 1],
- [ 1, 2, 4, 8],
- [ 1, 3, 9, 27],
- [ 1, 5, 25, 125]])
- The determinant of a square Vandermonde matrix is the product of the differences between the values of the input vector:
- >>>
- >>> np.linalg.det(np.vander(x))
- 48.000000000000043
- >>> (5-3)*(5-2)*(5-1)*(3-2)*(3-1)*(2-1)
- 48
复制代码
|
|