Skip to content

Commit 3cc6763

Browse files
committed
Add Prerequisites page
1 parent 339f03f commit 3cc6763

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

docs/prerequisites.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Prerequisites
3+
layout: default
4+
nav_order: 1.7
5+
---
6+
7+
# Prerequisites
8+
9+
## `dae-cpp` header file
10+
11+
The main header file of the library is `dae-cpp/solver.hpp`. It contains all the necessary classes, solvers, and utilities. To include `dae-cpp` into the project, use
12+
13+
```cpp
14+
#include <dae-cpp/solver.hpp>
15+
```
16+
17+
## `dae-cpp` namespace
18+
19+
All classes and solvers exposed to the user are defined in the `daecpp` namespace. This means that all names from the `dae-cpp` library should be prefixed with `daecpp::`. Alternatively, use
20+
21+
```cpp
22+
using namespace daecpp;
23+
```
24+
25+
## `dae-cpp` types
26+
27+
| Type | Equivalent to | Note |
28+
| ---- | ------------- | ---- |
29+
| `daecpp::int_type` | `uint32_t` (default), <br> `uint64_t` if `DAECPP_LONG` is defined | Unsigned integer type, used for sparse matrix indices |
30+
| `daecpp::float_type` | `double` (default), <br> `float` if `DAECPP_SINGLE` is defined | Floating point scalar, used for sparse matrix coefficients |
31+
| `daecpp::state_vector` | `std::vector<float_type>` | State vector, used, for example, to define the initial condition |
32+
| `daecpp::state_type` | `autodiff::VectorXreal` | State vector, used for the [vector function](vector-function.html) definition so that it can be automatically (algorithmically) differentiated using `autodiff` package |

docs/sparse-matrix.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ nav_order: 2
77
# Sparse Matrix class
88

99
Sparse Matrix class `daecpp::sparse_matrix` defines sparse matrix holder in [three-array format](#three-array-format).
10-
It is used to define the mass matrix and, optionally, the Jacobian matrix of the DAE system.
11-
The class provides a set of helper tools for the user to allocate memory, define and convert sparse matrices in a very straightforward way, e.g.:
10+
It is used to define the [mass matrix](mass-matrix.html) and, optionally, the [Jacobian matrix](jacobian-matrix.html) of the DAE system.
11+
The class provides a set of helper tools for the user to allocate memory, define and convert sparse matrices, etc., in a very straightforward way, e.g.:
1212

1313
```cpp
1414
sparse_matrix M; // Creates empty sparse matrix M

0 commit comments

Comments
 (0)