Skip to content

Commit

Permalink
Merge pull request #120 from VsSekorin/frmd
Browse files Browse the repository at this point in the history
#119 fix README
  • Loading branch information
vssekorin committed Mar 15, 2018
2 parents 641cfde + 7b8ae19 commit 5c68570
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions README.md
Expand Up @@ -6,7 +6,7 @@ Extension of [Cactoos](https://github.com/yegor256/cactoos) ([my blog post about
**Motivation**:

- Math classes is overkill for Cactoos, but it can be useful and interesting.
- It is generally accepted that functional programming is suitable for mathematics, not OOP.
- It is generally accepted that FP, rather than OOP, is more suitable for math.
- Practice in OOP.

**Principles**.
Expand Down Expand Up @@ -51,6 +51,11 @@ Fibonacci number:
new BiSeq<>(0, 1, (fst, snd) -> fst + snd)
```

Lucas number:
```java
new BiSeq<>(2, 1, fst -> snd -> snd + fst)
```

## Matrix

Identity matrix:
Expand All @@ -64,28 +69,10 @@ new MatrixOf<>(

The sum of two matrices:

```java
new MatrixAdd<>(
new MatrixOf<>(
new Integer[][]{
{1, 2},
{3, 4},
}
),
new MatrixOf<>(
new Long[][]{
{9L, 8L},
{7L, 6L},
}
),
(inm, lnm) -> inm + lnm
)
```

The product of two matrices:

```java
new MatrixMult<>(
new MatrixProd<>(
new MatrixOf<>(
new Integer[][]{
{1, 2},
Expand Down

0 comments on commit 5c68570

Please sign in to comment.