-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from jaurentz/development
Development
- Loading branch information
Showing
46 changed files
with
247 additions
and
1,773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
include ../../make.inc | ||
include ../make.inc | ||
|
||
TESTS := $(wildcard ./*.cu) | ||
TESTS := $(TESTS:.cu=) | ||
EXS := $(wildcard ./*.cu) | ||
EXS := $(EXS:.cu=) | ||
|
||
CUCHEBINCS := -I $(INSTALLDIR)/cucheb/include | ||
CUCHEBLIBS := -L $(INSTALLDIR)/cucheb/lib -lcucheb | ||
|
||
all: $(TESTS) | ||
all: $(EXS) | ||
|
||
%:: %.cu | ||
$(CUC) $(CUFLAGS) -o $@ $< $(CUCHEBINCS) $(CUCHEBLIBS) $(INCS) $(LIBS) | ||
|
||
clean: | ||
@rm -f $(TESTS) | ||
@rm -f $(EXS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <cucheb.h> | ||
|
||
/* driver */ | ||
int main(){ | ||
|
||
// compute variables | ||
cuchebmatrix ccm; | ||
cucheblanczos ccl; | ||
|
||
// variables to parse file | ||
string matname; | ||
double lbnd, ubnd; | ||
int bsize; | ||
|
||
// initialize matrix | ||
matname = "/path/to/Ge87H76.mtx"; | ||
cuchebmatrix_init(matname, &ccm); | ||
|
||
// set interval and block size | ||
lbnd = -0.645; | ||
ubnd = -0.0053; | ||
bsize = 3; | ||
|
||
// call filtered lanczos for an interval | ||
cuchebmatrix_filteredlanczos(lbnd, ubnd, bsize, &ccm, &ccl); | ||
|
||
// print matrix | ||
cuchebmatrix_print(&ccm); | ||
|
||
// print eigenvalues and residuals | ||
printf("\nComputed eigenvalues and residuals:\n"); | ||
for(int ii=0;ii<ccl.nconv;ii++){ | ||
printf(" eig[%d] = %+e, res[%d] = %e\n", | ||
ii,ccl.evals[ccl.index[ii]],ii,ccl.res[ccl.index[ii]]); | ||
} | ||
|
||
// print first 10 entries of first eigenvector | ||
printf("\nFirst 10 entries of first eigenvector:\n"); | ||
for(int ii=0;ii<10;ii++){ | ||
printf(" vec[%d] = %+e\n",ii,ccl.vecs[ccl.index[ii]*ccl.n+ii]); | ||
} | ||
|
||
// destroy ccl | ||
cucheblanczos_destroy(&ccl); | ||
|
||
// destroy ccm | ||
cuchebmatrix_destroy(&ccm); | ||
|
||
// return | ||
return 0; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.