CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly...
Transcript of CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly...
![Page 1: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/1.jpg)
CompA: Complex Analyzer
Xiping Liu(xl2639) Jianshuo Qiu(jq2253) Tianwu Wang(tw2576) Yingshuang Zheng(yz3083) Zhanpeng Su(zs2329)
![Page 2: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/2.jpg)
Introduction
CompA is a strongly typed language supports complex number and matrix computations. The frequent use of matrix and complex number in engineering related problems inspire us to built this language that is good at complex arithmetic and matrix manipulation.
![Page 3: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/3.jpg)
Our Goal
Design a imperative language specialized in complex arithmetic and matrix manipulation
Simplicity of treating a complex number as a tuple
Matrix data type for matrix functions and manipulation
Complex data type for complex arithmetic
A sufficient rich library of complex functions and functions of matrix manipulation
![Page 4: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/4.jpg)
Overview
C-like syntax
Main Data Type: matrix, complex
Rich complex-oriented standard library
Compiles to the LLVM
![Page 5: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/5.jpg)
Basics
Primitive Types:
int, float, bool, string
Data Types:
complex, matrix
Declaration and Initialization:
cx a;
a= (1.2, 2.4);
int[2][3] m;
populate_2D_int(%%m, 1, 2, 3);
Function Declaration:
void populate_2D_int(int[ ][ ] x, int a, int h, int w) { int i; for (i = 0; i < (h*w); i = i + 1) { #x = a; x = ++x; }}
![Page 6: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/6.jpg)
Simple Tutorial
Function NameFunction Return Type
Parameters
Parameter Type
Declare Complex Variable
Imaginary Part and Read Part Assignment
Return Statement
![Page 7: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/7.jpg)
Generic Type Printing
![Page 8: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/8.jpg)
Matrix Addition & Printing
Output
![Page 9: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/9.jpg)
Semantic Check
Error Message
![Page 10: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/10.jpg)
Semantic Check
Error Message
![Page 11: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/11.jpg)
Built-In Functions
sqrt, sin, cos, powi, pow, exp, log, log10, fabs, min, max
Output
![Page 12: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/12.jpg)
Demo
![Page 13: CompA Complex Analyzersedwards/classes/2017/4115-fall/... · 2017. 12. 22. · CompA is a strongly typed language supports complex number and matrix computations. The frequent use](https://reader033.fdocuments.net/reader033/viewer/2022052011/60279c17717b9c67ec3e0fd4/html5/thumbnails/13.jpg)
Q & A
Thank you!