Är det någon här som sitter på kod för inversen av en triangulär matris?
Det skulle vara mycket skönt om man slapp skriva en och koncentrera sig på resten.

Man brukar nog ofta använda http://www.cs.berkeley.edu/~knight/knig ... poster.pdf
De skulle annars vara perfekt, men lyckas inte bli av med dessa errors.source/blas1_s.o: In function `snrm2':
/home/korken/Programming/KFly_STM32F4/source/blas1_s.cundefined reference to `sqrt'
source/blas1_s.o: In function `srotg':
/home/korken/Programming/KFly_STM32F4/source/blas1_s.cundefined reference to `sqrt'
source/linpack_s.o: In function `schdc':
/home/korken/Programming/KFly_STM32F4/source/linpack_s.c:249: undefined reference to `sqrt'
source/linpack_s.o: In function `schdd':
/home/korken/Programming/KFly_STM32F4/source/linpack_s.c:421: undefined reference to `sqrt'
/home/korken/Programming/KFly_STM32F4/source/linpack_s.c:431: undefined reference to `sqrt'
source/linpack_s.o:/home/korken/Programming/KFly_STM32F4/source/linpack_s.c:431: more undefined references to `sqrt' follow
/usr/local/CodeBench_1802_EABI/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text+0x1c): undefined reference to `_exit'
/usr/local/CodeBench_1802_EABI/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text+0x16): undefined reference to `_write'
/usr/local/CodeBench_1802_EABI/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text+0x12): undefined reference to `_close'
/usr/local/CodeBench_1802_EABI/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text+0x14): undefined reference to `_fstat'
/usr/local/CodeBench_1802_EABI/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text+0x12): undefined reference to `_isatty'
/usr/local/CodeBench_1802_EABI/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text+0x16): undefined reference to `_lseek'
/usr/local/CodeBench_1802_EABI/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text+0x16): undefined reference to `_read'
Kod: Markera allt
public static float[][] MultiplyULMatrix(float a[][], float b[][]) {
int n = a.length;
float[][] resultant = new float[n][n];
/* *
*
* Illustration why we don't have to multiply and add every element:
* x is some number in the matrix, but the x:es are not necessarily the same.
*
* | x x x x x | | x 0 0 0 0 |
* | 0 x x x x | | x x 0 0 0 |
* | 0 0 x x x | * | x x x 0 0 | = ...
* | 0 0 0 x x | | x x x x 0 |
* | 0 0 0 0 x | | x x x x x |
*
* Many zeroes that don't have to be taken into account when multiplying!
*
* */
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
for(int k = j; k < n; k++) { /* Now it will not multiply with half of the 0s */
resultant[i][j] += a[i][k] * b[k][j];
}
}
}
return resultant;
}
Kod: Markera allt
if (j < i)
k = i;
else
k = j;