M
MSnews
Hi there.
I hope somebody can help me out here as I don't feel I get this done without
spending weeks on debugging. I have a bunch of functions that have been
written in AnsiC and that I like to call from a VB.Net App. I already
managed to get a Windows C-Dll but don't know how to correctly call/declare
them in VB.NET. Also do I use DECLARE or do I need to go with DLLimport.
It would be of tremendous help to me if somebody could provide me with the
correct declare statements. Thx in advance.
irk
Here are the stubs taken from the header file:
/* Chapter 2 */
double CALL clusterdistance (int nrows, int ncolumns, double** data, int**
mask,
double weight[], int n1, int n2, int index1[], int index2[], char dist,
char method, int transpose);
/* Chapter 3 */
void CALL initran(void);
/* Chapter 4 */
CALL double** distancematrix (int ngenes, int ndata, double** data,
int** mask, double* weight, char dist, int transpose);
/* Chapter 5 */
void CALL randomassign (int nclusters, int ngenes, int clusterid[]);
void getclustermean (int nclusters, int nrows, int ncolumns,
double** data, int** mask, int clusterid[], double** cdata, int** cmask,
int transpose);
void getclustermedian (int nclusters, int nrows, int ncolumns,
double** data, int** mask, int clusterid[], double** cdata, int** cmask,
int transpose);
void getclustermedoid(int nclusters, int nelements, double** distance,
int clusterid[], int centroids[], double errors[]);
void CALL kcluster (int nclusters, int ngenes, int ndata, double** data,
int** mask, double weight[], int transpose, int npass, char method, char
dist,
int clusterid[], double** cdata, double* error, int* ifound);
void CALL kmedoids (int nclusters, int nelements, double** distance,
int npass, int clusterid[], double* error, int* ifound);
/* Chapter 6 */
void CALL treecluster (int nrows, int ncolumns, double** data, int** mask,
double weight[], int applyscale, int transpose, char dist, char method,
int result[][2], double linkdist[], double** distmatrix);
void cuttree (int nelements, int tree[][2], int nclusters, int clusterid[]);
/* Chapter 7 */
void CALL somcluster (int nrows, int ncolumns, double** data, int** mask,
const double weight[], int transpose, int nxnodes, int nynodes,
double inittau, int niter, char dist, double*** celldata,
int clusterid[][2]);
/* Chapter 8 */
void CALL svd(int m, int n, double** u, double w[], double** v, int* ierr);
/* Utility routines, currently undocumented */
void CALL sort(int n, const double data[], int index[]);
double CALL mean(int n, double x[]);
double CALL median (int n, double x[]);
I hope somebody can help me out here as I don't feel I get this done without
spending weeks on debugging. I have a bunch of functions that have been
written in AnsiC and that I like to call from a VB.Net App. I already
managed to get a Windows C-Dll but don't know how to correctly call/declare
them in VB.NET. Also do I use DECLARE or do I need to go with DLLimport.
It would be of tremendous help to me if somebody could provide me with the
correct declare statements. Thx in advance.
irk
Here are the stubs taken from the header file:
/* Chapter 2 */
double CALL clusterdistance (int nrows, int ncolumns, double** data, int**
mask,
double weight[], int n1, int n2, int index1[], int index2[], char dist,
char method, int transpose);
/* Chapter 3 */
void CALL initran(void);
/* Chapter 4 */
CALL double** distancematrix (int ngenes, int ndata, double** data,
int** mask, double* weight, char dist, int transpose);
/* Chapter 5 */
void CALL randomassign (int nclusters, int ngenes, int clusterid[]);
void getclustermean (int nclusters, int nrows, int ncolumns,
double** data, int** mask, int clusterid[], double** cdata, int** cmask,
int transpose);
void getclustermedian (int nclusters, int nrows, int ncolumns,
double** data, int** mask, int clusterid[], double** cdata, int** cmask,
int transpose);
void getclustermedoid(int nclusters, int nelements, double** distance,
int clusterid[], int centroids[], double errors[]);
void CALL kcluster (int nclusters, int ngenes, int ndata, double** data,
int** mask, double weight[], int transpose, int npass, char method, char
dist,
int clusterid[], double** cdata, double* error, int* ifound);
void CALL kmedoids (int nclusters, int nelements, double** distance,
int npass, int clusterid[], double* error, int* ifound);
/* Chapter 6 */
void CALL treecluster (int nrows, int ncolumns, double** data, int** mask,
double weight[], int applyscale, int transpose, char dist, char method,
int result[][2], double linkdist[], double** distmatrix);
void cuttree (int nelements, int tree[][2], int nclusters, int clusterid[]);
/* Chapter 7 */
void CALL somcluster (int nrows, int ncolumns, double** data, int** mask,
const double weight[], int transpose, int nxnodes, int nynodes,
double inittau, int niter, char dist, double*** celldata,
int clusterid[][2]);
/* Chapter 8 */
void CALL svd(int m, int n, double** u, double w[], double** v, int* ierr);
/* Utility routines, currently undocumented */
void CALL sort(int n, const double data[], int index[]);
double CALL mean(int n, double x[]);
double CALL median (int n, double x[]);