https://github.com/pythonista7/matrix-lib-for-c
A header file for matrices in C
https://github.com/pythonista7/matrix-lib-for-c
Last synced: 10 months ago
JSON representation
A header file for matrices in C
- Host: GitHub
- URL: https://github.com/pythonista7/matrix-lib-for-c
- Owner: Pythonista7
- Created: 2018-02-03T12:47:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-26T15:08:40.000Z (almost 8 years ago)
- Last Synced: 2025-02-07T11:52:18.236Z (12 months ago)
- Language: C
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Matrix-Lib-for-C
This a header file for C which gives varible like functionalities to 2D matrices.
All functions will accept pointers as input and return pointer/value depending on function.
The following are the propossed functions for this project,
1)sum(X,Y) //Currently under the name of MsumV1.c
Input
X -type(pointer to 2D array)
Y -type(pointer to 2D array)
Return
A pointer pointing to a 2D array containing the sum of X and Y.
2)diff(X,Y)
Input
X -type(pointer to 2D array)
Y -type(pointer to 2D array)
Return
A pointer pointing to a 2D array containing the difference of X and Y.(i.e X - Y)
3)prod(X,Y)
Input
X -type(pointer to 2D array)
Y -type(pointer to 2D array)
Return
A pointer pointing to a 2D array containing the product of X and Y.
Note:
* Dimensions of X and Y need to be compatible for multiplication.
4)div(X,Y)
Input
X -type(pointer to 2D array)
Y -type(pointer to 2D array)
Return
A pointer pointing to a 2D array containing the divident of X and Y.
Note:
* Works as X * Y^-1{i.e - prod(X,inverse(Y)) }
* Divion by 0 may throw errors.
5)inverse(X)
Input
X -type(pointer to 2D array)
Return
A pointer pointing to a 2D array containing inverse of X.
6)transpose(X)
Input
X -type(pointer to 2D array)
Return
A pointer pointing to a 2D array that is the transpose of array X.
7)adjoint(X)
Input
X -type(pointer to 2D array)
Return
A pointer pointing to a 2D array containing the adjoint of X.
8)rank(X)
Input
X -type(pointer to 2D array)
*** Return
An Integer that is rank of the matrix X.
***
9)reshape(X,g,h)
Input
X -type(pointer to a 2D array)
g -type(Interger),row size of reshaped matrix
h -type(Interger),column size of reshaped matrix
Return
A pointer pointing to the reshaped array.
Note:
* Rehape is possible only if the dimensions of the input matrix and reshape dimensions are compatible.
i.e - Consider dimesions of X to be m x n.Then if X needs to be reshaped to g x h,
g x h = m x n MUST BE TRUE.