0:00:13 | okay thank you so |
---|
0:00:14 | is just a quick uh are just a quick introduction to |
---|
0:00:18 | to the matrix library basically what we |
---|
0:00:20 | because we need a lot of mess and we're trying to do to decide which matrix library to use a |
---|
0:00:24 | "'cause" there there are some |
---|
0:00:26 | i out then mentioned bruce and there's eigen again there's so |
---|
0:00:29 | a couple of others |
---|
0:00:30 | the john my stuff but |
---|
0:00:31 | uh most of these is they're trying to be |
---|
0:00:34 | kind of um uh like |
---|
0:00:36 | as much |
---|
0:00:37 | similar to mark lab or you know |
---|
0:00:39 | very very know |
---|
0:00:41 | trying to play like high level |
---|
0:00:43 | uh a live are so we wanted a really simple low level library |
---|
0:00:46 | i would we wouldn't do what zero avoid all operator want to you to you know avoid all automatic resizing |
---|
0:00:52 | all automatic initialisation and stuff like that |
---|
0:00:55 | i know whether it's yeah |
---|
0:00:56 | so uh |
---|
0:00:58 | that's why we decided to to build the matrix library that would |
---|
0:01:01 | we somehow based on the |
---|
0:01:03 | based on the uh |
---|
0:01:05 | and the blast routine because they're fast we used them |
---|
0:01:08 | uh in our previous projects so |
---|
0:01:10 | the the |
---|
0:01:11 | as i set the uh |
---|
0:01:13 | the the library calls |
---|
0:01:14 | uh the um at lost or or blast functions |
---|
0:01:18 | or the for the high level math operations like uh in versions so cholesky decomposition is stuff |
---|
0:01:23 | we use the lot park |
---|
0:01:26 | one of one of those implementations |
---|
0:01:28 | and for the code |
---|
0:01:30 | okay we also use um |
---|
0:01:31 | this this at is highly to automatically or uh tuned |
---|
0:01:35 | a linear algebra |
---|
0:01:37 | system i don't know |
---|
0:01:39 | yeah |
---|
0:01:39 | uh |
---|
0:01:40 | which |
---|
0:01:41 | missus some of the a lot implementations so we we we use public domain come from |
---|
0:01:46 | from the john my project too |
---|
0:01:47 | um to implement some of that stuff |
---|
0:01:50 | or is a just a |
---|
0:01:52 | quick example so it's it's it's template it |
---|
0:01:54 | uh |
---|
0:01:55 | yeah it's simply to on on doubles and floats in in |
---|
0:01:59 | E plus plus |
---|
0:02:00 | uh basically the basic the basic classes are your so yeah we have the |
---|
0:02:04 | the matrix |
---|
0:02:05 | the standard matrix rectangular of a library |
---|
0:02:08 | uh then we have the vector |
---|
0:02:10 | uh then we have something S P N T P matrices C so this is something then then mentioned before |
---|
0:02:14 | so as P user a |
---|
0:02:16 | uh |
---|
0:02:17 | symmetric fact matrix so basically uh what you what you do is that if you know that you're matrix is |
---|
0:02:22 | going to be |
---|
0:02:23 | uh a symmetric you can you can just or |
---|
0:02:25 | the the lower trying a sorry yeah you know the a lower triangle of the matrix and |
---|
0:02:30 | put the coefficients one after another and |
---|
0:02:32 | and fact that matrix in memory |
---|
0:02:34 | and uh you but you have to but S P just |
---|
0:02:37 | tells you that you know that this is going to be symmetrical the same as |
---|
0:02:40 | T P which is that like triangular back matrix |
---|
0:02:44 | just know that it's a it's so you have to treat it is a as a triangular matrix matrix with |
---|
0:02:48 | with the of |
---|
0:02:49 | what it whatever is above the |
---|
0:02:50 | the a diagonal of the matrix |
---|
0:02:53 | set to zero |
---|
0:02:54 | and i think it is that that |
---|
0:02:56 | like a uh |
---|
0:02:57 | really supports and and lastly they support these these these two kind of of matrices and and the coldest is |
---|
0:03:02 | optimized somehow |
---|
0:03:05 | um |
---|
0:03:08 | is just a quick example so the only operators that we use are are for indexing the the um |
---|
0:03:14 | the structure so |
---|
0:03:16 | uh you see that we can we can we can create a a vector of floats with the fixed size |
---|
0:03:20 | then you can |
---|
0:03:21 | you know iterate over over the elements |
---|
0:03:24 | uh |
---|
0:03:25 | you can access |
---|
0:03:26 | you can access them as i said with the we would be on |
---|
0:03:29 | we don't use |
---|
0:03:30 | a square brackets we use normal |
---|
0:03:32 | rec it's like here |
---|
0:03:33 | uh |
---|
0:03:34 | we don't use operators because they're just |
---|
0:03:36 | difficult to uh to debug and |
---|
0:03:39 | i mean that would |
---|
0:03:40 | we wanted to be as as as much |
---|
0:03:42 | C or C plus plus as possible so |
---|
0:03:44 | um |
---|
0:03:46 | everything is everything is called by functions so we see here |
---|
0:03:49 | you can add |
---|
0:03:50 | vector and vector and and and that's basically it |
---|
0:03:54 | um |
---|
0:03:56 | yeah so there's no orders resizing one uh and anything like that because you normally you have to know what |
---|
0:04:01 | you're doing so if if if there's something wrong |
---|
0:04:03 | then |
---|
0:04:06 | no no no no iterators |
---|
0:04:08 | uh that's too difficult and and |
---|
0:04:11 | maybe |
---|
0:04:14 | yeah but |
---|
0:04:16 | you can get the wonders directly yeah you can get appointed to the role we get |
---|
0:04:20 | to the to the beginning of the memory space |
---|
0:04:26 | the next example so just uh just to show you |
---|
0:04:29 | uh the format of the for the functions of god |
---|
0:04:32 | uh you the functions take some uh transcend all trans |
---|
0:04:35 | um |
---|
0:04:36 | parameters so that you know if if you wanna |
---|
0:04:38 | you want the matrix that that you |
---|
0:04:40 | you put in is a parameter if you want to transpose it or not |
---|
0:04:43 | um most of these most of these uh functions are really based on the on the |
---|
0:04:48 | blast cam function because that's that's the real one of them |
---|
0:04:52 | uh the |
---|
0:04:53 | the most used |
---|
0:04:54 | uh |
---|
0:04:55 | one two so this is this is the format of the gain functions so you you usually you have a |
---|
0:04:59 | matrix |
---|
0:04:59 | and you wanna |
---|
0:05:00 | uh at some multiplication of two other matrices to it while |
---|
0:05:05 | yeah i mean you know waiting it with the with the matrix itself so |
---|
0:05:09 | this is something this is something that that that we use a lot |
---|
0:05:12 | uh |
---|
0:05:13 | some notes about the about the naming them i guess that's all the document to didn't the |
---|
0:05:18 | in the docks to jen that that that is on the source forge |
---|
0:05:21 | uh yeah if you have |
---|
0:05:23 | i if you wanna if you wanna |
---|
0:05:25 | multiply two or make some operation on on to same might indices |
---|
0:05:28 | you use the |
---|
0:05:29 | the two there so this is just a |
---|
0:05:31 | just a |
---|
0:05:32 | naming scheme |
---|
0:05:35 | uh yet another example from the from the high level so you see that uh |
---|
0:05:40 | you can you can create a normal matrix a can christa estimate |
---|
0:05:42 | symmetrical metrical back make she's |
---|
0:05:45 | uh |
---|
0:05:47 | you can create them |
---|
0:05:49 | yeah that's are set again |
---|
0:05:52 | yeah yeah the symmetric not track here so |
---|
0:05:55 | so uh |
---|
0:05:56 | you see that |
---|
0:05:57 | uh |
---|
0:05:58 | you you really have a special functions also scatter |
---|
0:06:01 | six sorry the medics six got a really knows that it it is a |
---|
0:06:04 | symmetrical back products so it does this |
---|
0:06:06 | think it effectively stores it effectively |
---|
0:06:09 | another thing is you can |
---|
0:06:11 | uh a you can now create a a triangle back format |
---|
0:06:14 | good for the class P |
---|
0:06:15 | stuff |
---|
0:06:16 | so you just take that that to symmetric fact |
---|
0:06:19 | matrix here |
---|
0:06:21 | this functional ring knows that |
---|
0:06:22 | it's so you know |
---|
0:06:24 | symmetric metric back so |
---|
0:06:25 | it stores it |
---|
0:06:26 | in a in a |
---|
0:06:27 | an efficient way again and it inverts sense me |
---|
0:06:32 | does either |
---|
0:06:33 | yeah |
---|
0:06:34 | so |
---|
0:06:36 | yeah |
---|
0:06:39 | uh another think that that it's a what is like sub see so it's basically just a from from the |
---|
0:06:44 | from the matrix or vector or whatever |
---|
0:06:47 | there is so uh |
---|
0:06:48 | these these classes they they you can do that exactly the same stuff |
---|
0:06:52 | as with the original |
---|
0:06:54 | matrix clause or or a vector class |
---|
0:06:56 | so they don't have any |
---|
0:06:58 | and you resizing or read |
---|
0:07:00 | reshaping being or or anything like that |
---|
0:07:02 | only they they they uh they let you do only the |
---|
0:07:05 | the uh non |
---|
0:07:07 | resizing and you know |
---|
0:07:09 | basically |
---|
0:07:10 | you're just addressing this space that was already pre located by the by the matrix so there's not not nothing |
---|
0:07:15 | like a muddy the question |
---|
0:07:21 | yeah this is an example so if you wanna if you wanna address |
---|
0:07:24 | uh |
---|
0:07:25 | a sub vector of your of your ten dimensional vector |
---|
0:07:28 | starting at at a second element then having |
---|
0:07:31 | tan |
---|
0:07:32 | elements in in and it so we can you can you can be like this |
---|
0:07:35 | here's how we how good the |
---|
0:07:37 | was are you the |
---|
0:07:39 | you know |
---|
0:07:39 | index |
---|
0:07:40 | a a matrix starting at the first |
---|
0:07:43 | uh at the first row |
---|
0:07:45 | having |
---|
0:07:46 | generals uh yeah sorry ten wasn't in total starting at the at the first column |
---|
0:07:49 | well this is the i mean the second column index and |
---|
0:07:52 | C style indexing |
---|
0:07:55 | and uh a yeah you we can just use it |
---|
0:07:57 | as you would as you with to |
---|
0:07:59 | a |
---|
0:08:01 | matrix class |
---|
0:08:03 | so it's not memory save |
---|
0:08:05 | uh but that's something that that the C programs usually |
---|
0:08:08 | C problem is usually do no like |
---|
0:08:10 | it's it's nothing that you you do a prototype or called some all you |
---|
0:08:14 | you you you you if you once you start writing in C you you have to be careful about memory |
---|
0:08:18 | so |
---|
0:08:18 | i guess that |
---|
0:08:19 | this is something |
---|
0:08:20 | this is something |
---|
0:08:24 | uh quite natural to seek C language |
---|
0:08:26 | and also there's no representation of of matrix columns like uh |
---|
0:08:31 | i think |
---|
0:08:32 | well work |
---|
0:08:36 | yeah so you you already saw the the the functionality in the example so we have a matrix inversion cholesky |
---|
0:08:42 | decomposition |
---|
0:08:43 | as P D |
---|
0:08:45 | um eigenvalue fast for transform |
---|
0:08:48 | and uh the nice thing is that uh |
---|
0:08:51 | there's there's and uh |
---|
0:08:52 | if |
---|
0:08:53 | code |
---|
0:08:54 | uh |
---|
0:08:55 | included in the pack it's so so whatever we do we always know that |
---|
0:08:58 | we change the code we know that that that where |
---|
0:09:06 | i |
---|
0:09:09 | i |
---|
0:09:10 | do we support spot press no we don't that's what then all pretty mentioned in the in the uh and |
---|
0:09:15 | the first part of the talk |
---|
0:09:16 | because the speech stuff is not |
---|
0:09:18 | we we don't use spar makes that much |
---|
0:09:20 | no |
---|
0:09:21 | and the |
---|
0:09:22 | i |
---|
0:09:23 | if you want to at yeah you're welcome yeah please |
---|
0:09:32 | uh that's something that is because this library reaction than i thing about this library of which i didn't mention |
---|
0:09:37 | is is so |
---|
0:09:39 | somehow it an independent in only close the base |
---|
0:09:42 | uh a class of the of the of the call so if you don't want to use the rest of |
---|
0:09:45 | the called do you can just |
---|
0:09:46 | use this |
---|
0:09:47 | this thing |
---|
0:09:48 | and it |
---|
0:09:49 | and it uh |
---|
0:09:50 | called some some error stuff i don't then maybe you could come on that |
---|
0:09:54 | at and the base that's in the base so |
---|
0:09:58 | oh |
---|
0:10:00 | that is |
---|
0:10:00 | common to all like |
---|
0:10:02 | basic uh data types |
---|
0:10:04 | stuff like that |
---|
0:10:25 | so i think we |
---|
0:10:28 | so |
---|
0:10:29 | input output |
---|
0:10:30 | that the only operators are really |
---|
0:10:33 | um |
---|
0:10:34 | the brackets and and input out you know the the C plus plus i was stream style |
---|
0:10:40 | so we gonna have a short break can again a allow people to escape the far go through some of |
---|
0:10:44 | the script |
---|
0:10:45 | so maybe after that uh |
---|
0:10:47 | you know three to five minutes for starting yeah |
---|