{"id":189,"date":"2017-01-27T00:15:02","date_gmt":"2017-01-26T23:15:02","guid":{"rendered":"http:\/\/www.gianlucamancusi.com\/?p=189"},"modified":"2017-07-14T12:51:35","modified_gmt":"2017-07-14T10:51:35","slug":"c-matrix-computation-library","status":"publish","type":"post","link":"https:\/\/www.gianlucamancusi.com\/wordpress\/2017\/01\/27\/c-matrix-computation-library\/","title":{"rendered":"[C] Matrix Computation Library"},"content":{"rendered":"<h3 style=\"text-align: center; padding-left: 60px;\"><strong><a id=\"37eebf09a1307af1b1fc797d55d59fea-db295fc5e1c3199fd62f24facca71347ceeec335\" class=\"js-navigation-open\" title=\"matrixcomp.c\" href=\"https:\/\/github.com\/GianlucaMancusi\/matrix_computation\/blob\/master\/matrixcomp.c\">matrixcomp.c<\/a><\/strong><\/h3>\n<p style=\"text-align: center;\"><a href=\"https:\/\/github.com\/GianlucaMancusi\/matrix_computation\">https:\/\/github.com\/GianlucaMancusi\/matrix_computation<\/a><\/p>\n<p>This github project is created by\u00a0Gianluca Mancusi, Daniele Manicardi, Gianmarco Lusvardi &#8211; from the &#8220;Enzo Ferrari&#8221; Department of Engineering.\u00a0Some useful Matrix Calculation tools optimized for each system.<\/p>\n<p>This C library is designed to <strong>perform calculations on matrix<\/strong>. Here are some of the cool features:<\/p>\n<ul>\n<li><strong>Determinant<\/strong> of a square matrix (Laplace&#8217;s method)<\/li>\n<li>Possibility to reduce a matrix in <strong>rowEchelonForm<\/strong><\/li>\n<li>In-situ <strong>matrix transposition<\/strong> (uses a lightweight auxiliary table to perform it on rectangular matrices)<\/li>\n<li>Fast matrix row edits (matrices are stored by rows)<\/li>\n<li>Matrix multiplication<\/li>\n<\/ul>\n<p>We are pleased to receiving support!<\/p>\n<h5>\/\/====== Useful functions =======<\/h5>\n<p>Calculates the <strong>determinant<\/strong> of any squared matrix of any dimension (NxN):<\/p>\n<pre>extern double det(const struct matrix *matr);<\/pre>\n<p>Reduce a matrix in<strong> row echelon form<\/strong>. For more information see\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Row_echelon_form\">Wikipedia<\/a><\/p>\n<pre>extern void rowEchelonForm(struct matrix *matr);<\/pre>\n<p><strong>Transpose<\/strong> the input matrix (very fast):<\/p>\n<pre>extern void transposeMatrix(struct matrix *matr);<\/pre>\n<p><strong>Multiply<\/strong>\u00a0two compatible\u00a0matrices:<\/p>\n<pre class=\"\">extern struct matrix *mulmatr(const struct matrix *lhs, const struct matrix *rhs);<\/pre>\n<p>Creates a <strong>new<\/strong> matrix in the single pointer format:<\/p>\n<pre>extern struct matrix *creatematr(size_t rows, size_t cols);<\/pre>\n<p>Create a <strong>new empty<\/strong> matrix in the single pointer format:<\/p>\n<pre>extern struct matrix *createemptymatr(size_t rows, size_t cols);<\/pre>\n<p>Create a <strong>new &#8220;cloned from other&#8221;<\/strong> matrix in the single pointer format:<\/p>\n<pre>extern struct matrix *creatematrfrom(const double* matr, size_t row, size_t col);<\/pre>\n<p><strong>Clone<\/strong> a matrix:<\/p>\n<pre>extern struct matrix *clonematr(const struct matrix* matr);<\/pre>\n<p>This feature allows you to find the <strong>complementary minor<\/strong> given rows and columns:<\/p>\n<pre>extern struct matrix* matrcompminor(const struct matrix *matr, int row, int col);<\/pre>\n<p>Change an entire row:<\/p>\n<pre>extern int matrrow(const struct matrix* matr, size_t rowid, const double *row);<\/pre>\n<p>Destroy and free memory of an allocated matrix:<\/p>\n<pre>extern void destroymatr(struct matrix* matr);<\/pre>\n<p>Fast way to <strong>access an element<\/strong> of a matrix without thinking too much about it:<\/p>\n<pre>extern double *elementAt(struct matrix *matr, size_t rowIndex, size_t colIndex);<\/pre>\n<p>&nbsp;<\/p>\n<p>Print to File a matrix (to print on screen use &#8220;stdout&#8221; standard file):<\/p>\n<pre>extern void printMatrix(struct matrix *matr, FILE *f);<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>matrixcomp.c https:\/\/github.com\/GianlucaMancusi\/matrix_computation This github project is created by\u00a0Gianluca Mancusi, Daniele Manicardi, Gianmarco Lusvardi &#8211; from the &#8220;Enzo Ferrari&#8221; Department of Engineering.\u00a0Some useful Matrix Calculation tools optimized for each system. This C library is designed to perform calculations on matrix. Here are some of the cool features: Determinant of a square matrix (Laplace&#8217;s method) Possibility to&hellip;<\/p>\n","protected":false},"author":1,"featured_media":213,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"footnotes":""},"categories":[12,4],"tags":[45,13,46,7],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/posts\/189"}],"collection":[{"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":11,"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":259,"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/posts\/189\/revisions\/259"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/media\/213"}],"wp:attachment":[{"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gianlucamancusi.com\/wordpress\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}