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

Update course code to suite for new c++ standard and SuiteSpares type name #4

Open
wants to merge 3 commits 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
24 changes: 12 additions & 12 deletions BaseCode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

# Specify library locations here (add or remove "#" marks to comment/uncomment lines for your platform)

# Mac OS X
DDG_INCLUDE_PATH =
DDG_LIBRARY_PATH =
DDG_BLAS_LIBS = -framework Accelerate
DDG_SUITESPARSE_LIBS = -lspqr -lumfpack -lcholmod -lmetis -lcolamd -lccolamd -lcamd -lamd -ltbb -lm -lsuitesparseconfig
DDG_OPENGL_LIBS = -framework OpenGL -framework GLUT

# # Linux
# # Mac OS X
# DDG_INCLUDE_PATH =
# DDG_LIBRARY_PATH =
# DDG_BLAS_LIBS = -llapack -lblas -lgfortran
# DDG_SUITESPARSE_LIBS = -lspqr -lcholmod -lmetis -lcolamd -lccolamd -lcamd -lamd -lm
# DDG_OPENGL_LIBS = -lglut -lGL -lGLU -lX11
# DDG_BLAS_LIBS = -framework Accelerate
# DDG_SUITESPARSE_LIBS = -lspqr -lumfpack -lcholmod -lmetis -lcolamd -lccolamd -lcamd -lamd -ltbb -lm -lsuitesparseconfig
# DDG_OPENGL_LIBS = -framework OpenGL -framework GLUT

# Linux
DDG_INCLUDE_PATH =
DDG_LIBRARY_PATH =
DDG_BLAS_LIBS = -llapack -lblas -lgfortran -lumfpack
DDG_SUITESPARSE_LIBS = -lspqr -lcholmod -lmetis -lcolamd -lccolamd -lcamd -lamd -lm
DDG_OPENGL_LIBS = -lglut -lGL -lGLU -lX11

# # Windows / Cygwin
# DDG_INCLUDE_PATH = -I/usr/include/opengl -I/usr/include/suitesparse
Expand All @@ -28,7 +28,7 @@ DDG_OPENGL_LIBS = -framework OpenGL -framework GLUT
TARGET = ddg
CC = g++
LD = g++
CFLAGS = -O3 -Wall -Werror -ansi -pedantic $(DDG_INCLUDE_PATH) -I./include -I./src
CFLAGS = -O3 -Wall -Werror -ansi -pedantic $(DDG_INCLUDE_PATH) -I./include -I./src -DGL_GLEXT_PROTOTYPES
LFLAGS = -O3 -Wall -Werror -ansi -pedantic $(DDG_LIBRARY_PATH)
LIBS = $(DDG_OPENGL_LIBS) $(DDG_SUITESPARSE_LIBS) $(DDG_BLAS_LIBS)

Expand Down
1 change: 1 addition & 0 deletions BaseCode/include/DenseMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#ifndef DDG_DENSEMATRIX_H
#define DDG_DENSEMATRIX_H

#include <iostream>
#include <cholmod.h>
#include "Types.h"

Expand Down
1 change: 1 addition & 0 deletions BaseCode/include/SparseMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#ifndef DDG_SPARSE_MATRIX_H
#define DDG_SPARSE_MATRIX_H

#include <iostream>
#include <cholmod.h>
#include <vector>
#include <map>
Expand Down
12 changes: 6 additions & 6 deletions BaseCode/src/SparseMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace DDG
resize( m, n );

double* pr = (double*) cData->x;
UF_long* ir = (UF_long*) cData->i;
UF_long* jc = (UF_long*) cData->p;
SuiteSparse_long* ir = (SuiteSparse_long*) cData->i;
SuiteSparse_long* jc = (SuiteSparse_long*) cData->p;

// iterate over columns
for( int col = 0; col < n; col++ )
Expand Down Expand Up @@ -54,8 +54,8 @@ namespace DDG
resize( m, n );

double* pr = (double*) cData->x;
UF_long* ir = (UF_long*) cData->i;
UF_long* jc = (UF_long*) cData->p;
SuiteSparse_long* ir = (SuiteSparse_long*) cData->i;
SuiteSparse_long* jc = (SuiteSparse_long*) cData->p;

// iterate over columns
for( int col = 0; col < n; col++ )
Expand Down Expand Up @@ -199,8 +199,8 @@ namespace DDG
int t0 = clock();
cholmod_sparse* Ac = A.to_cholmod();
int n = Ac->nrow;
UF_long* Ap = (UF_long*) Ac->p;
UF_long* Ai = (UF_long*) Ac->i;
SuiteSparse_long* Ap = (SuiteSparse_long*) Ac->p;
SuiteSparse_long* Ai = (SuiteSparse_long*) Ac->i;
double* Ax = (double*) Ac->x;
void* Symbolic;
void* Numeric;
Expand Down
8 changes: 4 additions & 4 deletions BaseCode/src/SparseMatrix.inl
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ namespace DDG

// build compressed matrix (note that EntryMap stores entries in column-major order)
double* pr = (double*) cData->x;
UF_long* ir = (UF_long*) cData->i;
UF_long* jc = (UF_long*) cData->p;
SuiteSparse_long* ir = (SuiteSparse_long*) cData->i;
SuiteSparse_long* jc = (SuiteSparse_long*) cData->p;
int i = 0;
int j = -1;
for( const_iterator e = begin();
Expand Down Expand Up @@ -499,8 +499,8 @@ namespace DDG
int t0 = clock();
cholmod_sparse* Ac = A.to_cholmod();
int n = Ac->nrow;
UF_long* Ap = (UF_long*) Ac->p;
UF_long* Ai = (UF_long*) Ac->i;
SuiteSparse_long* Ap = (SuiteSparse_long*) Ac->p;
SuiteSparse_long* Ai = (SuiteSparse_long*) Ac->i;
double* Ax = (double*) Ac->x;
void* Symbolic;
void* Numeric;
Expand Down