Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small change to make svdlibc work with larger matrices on highmem machines #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions svdlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void svdResetCounters(void) {

/* Row major order. Rows are vectors that are consecutive in memory. Matrix
is initialized to empty. */
DMat svdNewDMat(int rows, int cols) {
DMat svdNewDMat(long rows, long cols) {
int i;
DMat D = (DMat) malloc(sizeof(struct dmat));
if (!D) {perror("svdNewDMat"); return NULL;}
Expand All @@ -42,7 +42,7 @@ void svdFreeDMat(DMat D) {
}


SMat svdNewSMat(int rows, int cols, int vals) {
SMat svdNewSMat(long rows, long cols, long vals) {
SMat S = (SMat) calloc(1, sizeof(struct smat));
if (!S) {perror("svdNewSMat"); return NULL;}
S->rows = rows;
Expand Down
4 changes: 2 additions & 2 deletions svdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ SVD_F_DB: dense binary
/******************************** Functions **********************************/

/* Creates an empty dense matrix. */
extern DMat svdNewDMat(int rows, int cols);
extern DMat svdNewDMat(long rows, long cols);
/* Frees a dense matrix. */
extern void svdFreeDMat(DMat D);

/* Creates an empty sparse matrix. */
SMat svdNewSMat(int rows, int cols, int vals);
SMat svdNewSMat(long rows, long cols, long vals);
/* Frees a sparse matrix. */
void svdFreeSMat(SMat S);

Expand Down