I C bin mit ++ von Randelementmethode zu lösen, die ich habe ein Problem mit meinem Code:GSL C++ in Cygwin Problem
#include <stdio.h>
#include <math.h>
#include <gsl/gsl_linalg.h>
using namespace std;
string STRING;
int i,q,s;
int const nodes = 16;
double A[nodes][nodes];
double b[nodes];
int main(){
for (i=0;i<nodes;i++)
{
{
A[q][i] = 1.;
b[q] = 1.;
}
}
Sobald A und B eingebaut sind, müssen wir das System Ax lösen = b durch die
Berechnung der inversen von x = A^(- 1) * b
gsl_matrix_view m = gsl_matrix_view_array (*A, nodes, nodes); for(q=0;q<nodes;q++)
gsl_matrix_view b = gsl_matrix_view_array (b, nodes, nodes);
gsl_vector *x = gsl_vector_alloc (nodes);
gsl_permutation * p = gsl_permutation_alloc (nodes);
gsl_linalg_LU_decomp (&m.matrix, p, &s);
gsl_linalg_LU_solve (&m.matrix, p, &b.vector, x);
return 0;
}
Wenn ich in cygwin kompilieren Verwendung
g++ test.cpp -lm -lgsl -o bem.out -L/usr/bin
bekomme ich folgende Fehlermeldung:
test.cpp: In function 'int main()':
test.cpp:39:59: error: cannot convert 'gsl_matrix_view' to 'double*' for argument '1' to '_gsl_matrix_view gsl_matrix_view_array(double*, size_t, size_t)'
test.cpp:43:39: error: 'struct gsl_matrix_view' has no member named 'vector'
ich das gleiche Beispiel gefolgt, dass der GSL Tutorial ausgesetzt, aber ich diese Fehler immer bin. Könnte jemand aushelfen? Ich würde es sehr schätzen.
Danke!