cmplx
复数标量生成。
函数接口声明如下:
float型数的操作:
vsip_cscalar_f vsip_cmplx_f(float r, float i);
参数
参数名 |
描述 |
取值范围 |
输入/输出 |
---|---|---|---|
r |
生成复数的实部。 |
不限 |
输入 |
i |
生成复数的虚部。 |
不限 |
输出 |
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include "kvsip.h" #include "vsip.h" #include "vsip_type.h" void CmplxExample() { float r = 1.1f; float i = -1.2f; vsip_cscalar_f dst = vsip_cmplx_f(r, i); printf("alpha: %.2f %.2f\n", r, i); printf("dst: %.2f %.2f\n", dst.r, dst.i); } int main(void) { CmplxExample(); return 0; } |
运行结果:
1 2 | alpha: 1.10 -1.20 dst: 1.10 -1.20 |
父主题: 标量运算函数