Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8 from aparupalli/patch-1
We edited the constructor with the array inside of it (Team Parka- Kelse...
  • Loading branch information
mathnathan committed Jul 23, 2012
2 parents b1fc71b + 6c3db91 commit 1c04afc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Matrix.cpp
Expand Up @@ -17,10 +17,21 @@ for (i=0; i<num_elements;i++)

// CONSTRUCTOR
Mat::Mat( int n, int m, double* input_array ) {
rows = n;
cols = m;
num_elements = n*m;
data = new double[num_elements];

if(sizeof(num_elements)!= n*m)
cout << "error";
for(int i=0; i<num_elements; i++) {
data[i] = input_array[i]
}

}



// CONSTRUCTOR
Mat::Mat( int n, int m, double value ) {
rows = n;
Expand Down

0 comments on commit 1c04afc

Please sign in to comment.