repo update

This commit is contained in:
2022-04-04 15:41:31 -05:00
parent 1156c003f9
commit 16003d1715
20 changed files with 13101 additions and 13046 deletions

View File

@@ -1,25 +1,25 @@
# lab3 Makefile
CC = g++
CFLAGS = -c -MMD -g
LFLAGS =
# Change w/ every new project
SOURCES = main.cpp row.cpp matrix.cpp
OBJECTS = $(SOURCES:.cpp=.o)
# Change w/ every new project
EXECUTABLE = Lab3
all: $(EXECUTABLE) $(SOURCES)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LFLAGS) -o $@ $(OBJECTS)
-include *.d
%.o:%.cpp
$(CC) $(CFLAGS) $<
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
# lab3 Makefile
CC = g++
CFLAGS = -c -MMD -g
LFLAGS =
# Change w/ every new project
SOURCES = main.cpp row.cpp matrix.cpp
OBJECTS = $(SOURCES:.cpp=.o)
# Change w/ every new project
EXECUTABLE = Lab3
all: $(EXECUTABLE) $(SOURCES)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LFLAGS) -o $@ $(OBJECTS)
-include *.d
%.o:%.cpp
$(CC) $(CFLAGS) $<
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f *.d

View File

@@ -1,51 +1,51 @@
#ifndef row_h
#define row_h
class Row{
public:
/* Parameterized constructor
* Takes in length and creates a row matrix with values cleared
* to zero
*/
Row(unsigned int length);
/* Copy constructor
* Create a new row matrix with the same size and values as the
* from matrix
*/
Row(const Row& from);
/* Destructor
* Correctly delete any heap memory
*/
~Row();
/* Access operator (const version)
* Allow access to row matrix data
* Should return an exception if column is too large
*/
double operator[](unsigned int column) const;
/* Access operator (non const version)
* Allow access to row matrix data
* Should return an exception if column is too large
*/
double& operator[] (unsigned int column);
/* Assignment operator
* 1. Check if two sides are the same object
* 2. Delete the current row matrix
* 3. Create a new row matrix with the same size and values as
* the rhs matrix
*/
Row& operator= (const Row& rhs);
/* Clear all data values to zero
*/
void clear();
private:
// Row matrix data
double * row_data;
// Size of row matrix
unsigned int length;
};
#endif
#ifndef row_h
#define row_h
class Row{
public:
/* Parameterized constructor
* Takes in length and creates a row matrix with values cleared
* to zero
*/
Row(unsigned int length);
/* Copy constructor
* Create a new row matrix with the same size and values as the
* from matrix
*/
Row(const Row& from);
/* Destructor
* Correctly delete any heap memory
*/
~Row();
/* Access operator (const version)
* Allow access to row matrix data
* Should return an exception if column is too large
*/
double operator[](unsigned int column) const;
/* Access operator (non const version)
* Allow access to row matrix data
* Should return an exception if column is too large
*/
double& operator[] (unsigned int column);
/* Assignment operator
* 1. Check if two sides are the same object
* 2. Delete the current row matrix
* 3. Create a new row matrix with the same size and values as
* the rhs matrix
*/
Row& operator= (const Row& rhs);
/* Clear all data values to zero
*/
void clear();
private:
// Row matrix data
double * row_data;
// Size of row matrix
unsigned int length;
};
#endif