Comments (4)
Can you write out what the value is at this line
When lup.c
file returns 0, then the inv.c
returns 0 as well.
Edit:
I did a quick check. I found the issue
/*
============================================================================
Name : inv.c
Author : Daniel Mårtensson
Version : 1.0
Copyright : MIT
Description : Turn A into inverse A^(-1)
============================================================================
*/
#include "CControl/Headers/Functions.h"
int main() {
// Matrix A
float A[2*2] = {1, 1, 1, 1};
clock_t start, end;
float cpu_time_used;
start = clock();
int status = inv(A, 2);
printf("Status on matrix A(1 == success, 0 == fail): %d\n", status);
end = clock();
cpu_time_used = ((float) (end - start)) / CLOCKS_PER_SEC;
printf("\nTotal speed was %f\n", cpu_time_used);
// Print A
printf("A^(-1)\n");
print(A, 2, 2);
return EXIT_SUCCESS;
}
Output:
Status on matrix A(1 == success, 0 == fail): 1
Total speed was 0.000000
A^(-1)
1.#INF00000000000000 -1.#INF00000000000000
-1.#INF00000000000000 1.#INF00000000000000
The issue is here:
Question: Can you be so kind to do an if-statement and check if we are dividing with 0
? If we are dividing with zero, then the static function should return uint8_t
or bool
as 0
or false
. As a check only. Can you do this? Send me then a pull request?
Edit:
I have fixed the issue.
Please re-open the issue if the issue still occurs.
from ccontrol.
Aha. Great! Thanks @DanielMartensson. Works perfectly now.
from ccontrol.
Aha. Great! Thanks @DanielMartensson. Works perfectly now.
Thank you @ooaj for finding this issue.
If you want, you could help me implement a Kernel Density Estimation algorithm. It's very easy.
K is the gaussian propability density function.
https://en.wikipedia.org/wiki/Kernel_density_estimation#Definition
The theory: See between 0:0 to 2:00 https://www.youtube.com/watch?v=DCgPRaIDYXA&t=1s&ab_channel=KimberlyFessel
Assume that you have a mesurement float my_measurement[100]
and you want to find the correct value, because it's a nonlinear measurement. If you plot float my_measurement[100]
you can see two gaussian curves, but which one should you select? Just use KDE algorithm as above.
Can you do that?
from ccontrol.
Sure. I can try to implement it. I have a very busy weekend, so if that's not a problem I can start working on it on Monday. I imagine you are going to be using it for your Particle Filter, right?
from ccontrol.
Related Issues (7)
- Missing License File HOT 1
- Memory leak in inv() HOT 3
- Error in Kalman Filter? HOT 1
- eig.c function, indexing error? HOT 11
- std function causes redefinition error while linking HOT 1
- Cat function HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccontrol.