Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
- `DynamicNumber`:
  - Added `sin` and `cos`.

- test: ^1.25.8
- coverage: ^1.8.0
  • Loading branch information
gmpassos committed Jul 26, 2024
1 parent 5e8492d commit 39d24ec
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.1.1

- `DynamicNumber`:
- Added `sin` and `cos`.

- test: ^1.25.8
- coverage: ^1.8.0

## 1.1.0

- sdk: '>=3.3.0 <4.0.0'
Expand Down
6 changes: 6 additions & 0 deletions lib/src/statistics_decimal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,12 @@ class Decimal implements DynamicNumber<Decimal> {
@override
DynamicInt operator ~() => ~toDynamicInt();

@override
Decimal get sin => Decimal.fromDouble(math.sin(toDouble()));

@override
Decimal get cos => Decimal.fromDouble(math.cos(toDouble()));

@override
Decimal get square => this * this;

Expand Down
12 changes: 12 additions & 0 deletions lib/src/statistics_dynamic_int.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ abstract class DynamicNumber<T extends DynamicNumber<T>>
/// Euclidean modulo for [DynamicInt] [n2].
T moduloDynamicInt(DynamicInt n2);

/// The sine of this number.
Decimal get sin;

/// The cosine of this number.
Decimal get cos;

/// The square of this number.
T get square;

Expand Down Expand Up @@ -815,6 +821,12 @@ abstract class DynamicInt implements DynamicNumber<DynamicInt> {
@override
DynamicInt moduloDynamicInt(DynamicInt other);

@override
Decimal get sin => Decimal.fromDouble(math.sin(toInt()));

@override
Decimal get cos => Decimal.fromDouble(math.cos(toInt()));

@override
DynamicInt get square => (this * this).toDynamicInt();

Expand Down
2 changes: 1 addition & 1 deletion lib/src/statistics_forecast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ abstract class EventForecaster<T, V, F> {
if (dependencyNotificationRatio >= 1 ||
_random.nextDouble() < dependencyNotificationRatio) {
var dependentObservations =
combination.map((id) => observationsByID[id]).whereNotNull();
combination.map((id) => observationsByID[id]).nonNulls;

_notifyConclusion(source, dependentObservations, event, value,
dependency: true);
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: statistics
description: Statistics package for easy and efficient data manipulation with built-in Bayesian Network (Bayes Net), many mathematical functions and tools.
version: 1.1.0
version: 1.1.1
homepage: https://github.com/gmpassos/statistics

environment:
Expand All @@ -13,9 +13,9 @@ dependencies:

dev_dependencies:
lints: ^3.0.0
test: ^1.25.2
test: ^1.25.8
dependency_validator: ^3.2.3
coverage: ^1.7.2
coverage: ^1.8.0

#dependency_overrides:
# data_serializer:
Expand Down

0 comments on commit 39d24ec

Please sign in to comment.