SparseLib and c++
From: Joe C (cj5815_at_yahoo.com)
Date: 11/27/04
- Next message: Roman Werpachowski: "BLAS libraries for AMD Athlon 64"
- Previous message: Dan Andrews: "Re: 4400"
- Next in thread: Richard Mathar: "Re: SparseLib and c++"
- Reply: Richard Mathar: "Re: SparseLib and c++"
- Messages sorted by: [ date ] [ thread ]
Date: 27 Nov 2004 13:50:09 -0800
Can someone tell me how to use SparseLib with the cygwin c++ complier?
I installed the libaries using the make file as instructed by the readme files.
I include the references to the header files (see program below)
When I try to try to compile the programs it does not work?
Am I referencing the library correctly?
Does anyone have an sample code I code look at?
Below is program I am using and the error I am getting.
Thanks.
Joe
#include <iostream>
#include <stdlib.h>
#include "compcol_double.h"
#include "comprow_double.h"
#include "coord_double.h"
#include "iohb_double.h"
using namespace std;
int main()
double tot = 1.e-6;
int result, maxit = 160;
double val[12] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0,
7.0, 8.0, 9.0, 10.0, 11.0, 12.0};
int colind[12] = {0, 1, 4, 0, 1, 2, 1, 2, 4, 3, 0, 4};
int rowptr[6] = { 0, 3, 6, 9,10, 12};
double rowsum[5] = {6.0, 15.0, 24.0, 10.0, 23.0};
double colsum[5] = {16.0, 14.0, 14.0, 10.0, 24.0};
CompRow_Mat_double R(5,5,12,val,rowptr,colind);
return 0;
}
> $ g++ testSparse.cpp -o testSparse.exe
testSparse.cpp:4:28: compcol_double.h: No such file or directory
testSparse.cpp:5:28: comprow_double.h: No such file or directory
testSparse.cpp:6:26: coord_double.h: No such file or directory
testSparse.cpp:7:25: iohb_double.h: No such file or directory
testSparse.cpp: In function `int main()':
testSparse.cpp:14: error: parse error before `double'
testSparse.cpp:26: error: 'CompRow_Mat_double' is used as a type, but is not
defined as a type.
testSparse.cpp:40: error: parse error before `return'
- Next message: Roman Werpachowski: "BLAS libraries for AMD Athlon 64"
- Previous message: Dan Andrews: "Re: 4400"
- Next in thread: Richard Mathar: "Re: SparseLib and c++"
- Reply: Richard Mathar: "Re: SparseLib and c++"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|