Skip to content

Commit a5e765b

Browse files
authored
Adds missing .gitmodules file (#71)
* Adds missing .gitmodules file As discussed in #69, the benchmark and googletest libs were missing corresponding .gitmodules file. * Adds missing .gitmodules file As discussed in #69, the benchmark and googletest libs were missing corresponding .gitmodules file. * Updates README.md
1 parent c5f3271 commit a5e765b

File tree

2 files changed

+67
-57
lines changed

2 files changed

+67
-57
lines changed

.gitmodules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[submodule "lib/benchmark"]
2+
path = lib/benchmark
3+
url = https://github.com/google/benchmark/
4+
5+
[submodule "lib/googletest"]
6+
path = lib/googletest
7+
url = https://github.com/google/googletest/

README.md

Lines changed: 60 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
# Matrix
22

3-
## Table of Contents
3+
## Table of Contents
4+
45
1. [Installation](#installation)
56

67
2. [Development](#development)
78

8-
2.1. [Linux](#linux)
9-
10-
2.2. [Windows](#windows)
9+
2.1. [Linux](#linux)
10+
11+
2.2. [Windows](#windows)
1112

1213
3. [Benchmarking](#benchmarking)
1314

1415
4. [Quick Start Guide](#quick-start-guide)
15-
16-
4.1. [Initializers](#initializers)
17-
18-
4.2. [Slicing](#slicing)
19-
20-
4.3. [Printing/Viewing](#printingviewing)
21-
22-
4.4. [Minimum, Maximum](#minimum-maximum)
23-
24-
4.5. [Broadcasting](#broadcasting)
25-
26-
4.6. [Indexing](#indexing)
27-
28-
4.7. [Mathematical Operations](#mathematical-operations)
29-
30-
4.8. [Statistical Operations](#statistical-operations)
31-
32-
4.9. [Matrix Algebra](#matrix-algebra)
33-
34-
4.10. [Miscellaneous](#miscellaneous)
3516

17+
4.1. [Initializers](#initializers)
18+
19+
4.2. [Slicing](#slicing)
20+
21+
4.3. [Printing/Viewing](#printingviewing)
22+
23+
4.4. [Minimum, Maximum](#minimum-maximum)
24+
25+
4.5. [Broadcasting](#broadcasting)
26+
27+
4.6. [Indexing](#indexing)
28+
29+
4.7. [Mathematical Operations](#mathematical-operations)
30+
31+
4.8. [Statistical Operations](#statistical-operations)
32+
33+
4.9. [Matrix Algebra](#matrix-algebra)
34+
35+
4.10. [Miscellaneous](#miscellaneous)
3636

3737
## Installation
3838

@@ -41,7 +41,10 @@ need git and cmake installed.
4141

4242
```bash
4343
# Check out the library.
44-
$ git clone https://github.com/mlcpp/Matrix.git
44+
$ git clone https://github.com/mlcpp/Matrix.git && cd Matrix
45+
46+
# Pull git submodules
47+
$ git submodule update --init
4548

4649
# Make a build directory to place the build output.
4750
$ cmake -E make_directory "build"
@@ -53,6 +56,7 @@ $ cmake -E chdir "build" cmake -DCMAKE_BUILD_TYPE=Release ../
5356
$ cmake -DCMAKE_BUILD_TYPE=Release -S . -B "build"
5457

5558
```
59+
5660
On a unix system, the build directory should now look something like this:
5761

5862
```
@@ -73,13 +77,16 @@ On a unix system, the build directory should now look something like this:
7377
1. C++ compiler (gcc or clang)
7478
2. git
7579
3. clang-format
76-
5. make (for Makefiles)
77-
4. cmake (version 3.13 or higher)
80+
4. make (for Makefiles)
81+
5. cmake (version 3.13 or higher)
7882

7983
```bash
8084
# Check out the library.
8185
$ git clone https://github.com/mlcpp/Matrix.git && cd Matrix
8286

87+
# Pull git submodules
88+
$ git submodule update --init
89+
8390
# Create build directory.
8491
$ mkdir build
8592

@@ -103,17 +110,20 @@ $ make <file_name_without_extension>
103110
1. C++ compiler (mingw-gcc)
104111
2. git (msysgit)
105112
3. clang-format
106-
5. mingw-make or mingw32-make (for Makefiles)
107-
4. cmake (version 3.13 or higher)
113+
4. mingw-make or mingw32-make (for Makefiles)
114+
5. cmake (version 3.13 or higher)
108115

109-
Add these tools to PATH.
116+
Add these tools to PATH.
110117

111-
__Note__: Run the following commands in msysgit terminal.
118+
**Note**: Run the following commands in msysgit terminal.
112119

113120
```bash
114121
# Check out the library.
115122
$ git clone https://github.com/mlcpp/Matrix.git && cd Matrix
116123

124+
# Pull git submodules
125+
$ git submodule update --init
126+
117127
# Create build directory.
118128
$ mkdir build
119129

@@ -130,7 +140,6 @@ $ mingw-make # use mingw32-make if usin
130140
$ mingw-make <file_name_without_extension> # use mingw32-make if using 32-bit Windows
131141
```
132142

133-
134143
## Benchmarking
135144

136145
To compile benchmarking binaries:
@@ -149,13 +158,13 @@ More detailed information about how to use these methods and functions is availa
149158

150159
Many initializer functions are provided that return `Matrix` object.
151160

152-
| **Function** | **Parameters** | **Return value** | **Description** |
153-
| :--------------: | :--------------------------------------------------------------------------------------------------------------: | :--------------: | :--------------------------------------------------------------------------------: |
154-
| `matrix.init()` | <p>_1 Parameter:_<br>Type: `std::vector<std::vector<double>>`<br>Job: vector of vector of type string/double</p> | `Matrix` object | Creates a `Matrix` object of same dimensions and values as the 2D vector provided. |
155-
| `matrix.eye()` | <p>_1 Parameter:_<br>Type: `int`<br>Job: Size of the identity matrix</p> | `Matrix` object | Creates an identity `Matrix` object of the size given as parameters. |
156-
| `matrix.zeros()` | <p>_2 Parameters:_<br>Type: `int`; `int`<br>Job: Number of rows; Number of columns</p> | `Matrix` object | Creates a `Matrix` object of all elements `0` of the size given as parameters. |
157-
| `matrix.ones()` | <p>_2 Parameters:_<br>Type: `int`; `int`<br>Job: Number of rows; Number of columns</p> | `Matrix` object | Creates a `Matrix` object of all elements `1` of the size given as parameters. |
158-
| `matrix.genfromtxt()` | <p>_2 Parameters:_<br>Type: `std::string`;`char`<br>Job: Path of the `.csv` file</p> | `Matrix` object | Creates a `Matrix` object with data elements of type `std::string`. |
161+
| **Function** | **Parameters** | **Return value** | **Description** |
162+
| :-------------------: | :--------------------------------------------------------------------------------------------------------------: | :--------------: | :--------------------------------------------------------------------------------: |
163+
| `matrix.init()` | <p>_1 Parameter:_<br>Type: `std::vector<std::vector<double>>`<br>Job: vector of vector of type string/double</p> | `Matrix` object | Creates a `Matrix` object of same dimensions and values as the 2D vector provided. |
164+
| `matrix.eye()` | <p>_1 Parameter:_<br>Type: `int`<br>Job: Size of the identity matrix</p> | `Matrix` object | Creates an identity `Matrix` object of the size given as parameters. |
165+
| `matrix.zeros()` | <p>_2 Parameters:_<br>Type: `int`; `int`<br>Job: Number of rows; Number of columns</p> | `Matrix` object | Creates a `Matrix` object of all elements `0` of the size given as parameters. |
166+
| `matrix.ones()` | <p>_2 Parameters:_<br>Type: `int`; `int`<br>Job: Number of rows; Number of columns</p> | `Matrix` object | Creates a `Matrix` object of all elements `1` of the size given as parameters. |
167+
| `matrix.genfromtxt()` | <p>_2 Parameters:_<br>Type: `std::string`;`char`<br>Job: Path of the `.csv` file</p> | `Matrix` object | Creates a `Matrix` object with data elements of type `std::string`. |
159168

160169
### Slicing
161170

@@ -257,21 +266,15 @@ Similarly, if we want to assign the value to index (5,3) we can do this by:
257266

258267
### Miscellaneous
259268

260-
| **Function** | **Parameters** | **Return value** | **Description** |
261-
| :-------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------: | :-------------------------------------------------------------------------: |
262-
| `matrix.concatenate()` | <p>_3 Parameters:_<br>Type: `Matrix`; `Matrix`; `std::string`<br>Job: `Matrix` to concatenate on; `Matrix` which is to be concatenated; Dimension on which to concatenate</p> | `Matrix` object | Method to concatenate/join two `Matrix` objects |
263-
| `Matrix.get()` | <p>_0 Parameters_ | `std::vector<std::vector<double>>` | Method to get the `Matrix` object as a 2D vector |
264-
| `Matrix.get_row()` | <p>_1 Parameter:_<br>Type: `int`<br>Job: row index</p> | `std::vector<double>` | Method to get a row of a `Matrix` object in the form of a vector |
265-
| `Matrix.get_col()` | <p>_1 Parameter:_<br>Type: `int`<br>Job: column index</p> | `std::vector<double>` | Method to get a column of a `Matrix` object in the form of a vector |
266-
| `matrix.delete_()` | <p>_3 Parameters:_<br>Type: `Matrix`; `int`; `std::string`<br>Job: `Matrix` to delete row/column of; index to be deleted; Dimension on which to delete</p> | `Matrix` object | Method to delete a row or column of a `Matrix` object |
267-
| `matrix.reciprocal()` | <p>_1 Parameter:_<br>Type: `Matrix`<br>Job: `Matrix` object to apply method on</p> | `Matrix` object | Method to calculate reciprocal of all elements in the `Matrix` object |
268-
| `Matrix.row_length()` | <p>_0 Parameters_ | `int` | Method to get the number of rows in a `Matrix` object |
269-
| `Matrix.col_length()` | <p>_0 Parameters_ | `int` | Method to get the number of columns in a `Matrix` object |
270-
| `Matrix.to_double()` | <p>_0 Parameters_ | `void` | Method convert the elements of a `Matrix` object from std::string to double |
271-
| `Matrix.to_string()` | <p>_0 Parameters_ | `void` | Method convert the elements of a `Matrix` object from double to std::string |
272-
273-
274-
275-
276-
277-
269+
| **Function** | **Parameters** | **Return value** | **Description** |
270+
| :--------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------: | :-------------------------------------------------------------------------: |
271+
| `matrix.concatenate()` | <p>_3 Parameters:_<br>Type: `Matrix`; `Matrix`; `std::string`<br>Job: `Matrix` to concatenate on; `Matrix` which is to be concatenated; Dimension on which to concatenate</p> | `Matrix` object | Method to concatenate/join two `Matrix` objects |
272+
| `Matrix.get()` | <p>_0 Parameters_ | `std::vector<std::vector<double>>` | Method to get the `Matrix` object as a 2D vector |
273+
| `Matrix.get_row()` | <p>_1 Parameter:_<br>Type: `int`<br>Job: row index</p> | `std::vector<double>` | Method to get a row of a `Matrix` object in the form of a vector |
274+
| `Matrix.get_col()` | <p>_1 Parameter:_<br>Type: `int`<br>Job: column index</p> | `std::vector<double>` | Method to get a column of a `Matrix` object in the form of a vector |
275+
| `matrix.delete_()` | <p>_3 Parameters:_<br>Type: `Matrix`; `int`; `std::string`<br>Job: `Matrix` to delete row/column of; index to be deleted; Dimension on which to delete</p> | `Matrix` object | Method to delete a row or column of a `Matrix` object |
276+
| `matrix.reciprocal()` | <p>_1 Parameter:_<br>Type: `Matrix`<br>Job: `Matrix` object to apply method on</p> | `Matrix` object | Method to calculate reciprocal of all elements in the `Matrix` object |
277+
| `Matrix.row_length()` | <p>_0 Parameters_ | `int` | Method to get the number of rows in a `Matrix` object |
278+
| `Matrix.col_length()` | <p>_0 Parameters_ | `int` | Method to get the number of columns in a `Matrix` object |
279+
| `Matrix.to_double()` | <p>_0 Parameters_ | `void` | Method convert the elements of a `Matrix` object from std::string to double |
280+
| `Matrix.to_string()` | <p>_0 Parameters_ | `void` | Method convert the elements of a `Matrix` object from double to std::string |

0 commit comments

Comments
 (0)