-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from marvin-hansen/main
Updated dependencies
- Loading branch information
Showing
8 changed files
with
55 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) "2023" . The DeepCausality Authors. All Rights Reserved. | ||
|
||
mod errors; | ||
mod extensions; | ||
mod types; | ||
mod utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) "2023" . The DeepCausality Authors. All Rights Reserved. | ||
|
||
use deep_causality::utils::math_utils; | ||
|
||
#[test] | ||
fn test_sum_float() { | ||
let v = vec![1.0, 2.0, 3.0, 4.0]; | ||
let res = math_utils::sum(v); | ||
|
||
assert_eq!(res, 10.0); | ||
} | ||
|
||
#[test] | ||
fn test_sum_int() { | ||
let v = vec![1, 2, 3, 4]; | ||
let res = math_utils::sum(v); | ||
|
||
assert_eq!(res, 10); | ||
} | ||
|
||
#[test] | ||
fn test_abs_num_neg() { | ||
let n = -1.0; | ||
let res = math_utils::abs_num(n); | ||
assert_eq!(res, 1.0); | ||
} | ||
|
||
#[test] | ||
fn test_abs_num_pos() { | ||
let n = 1.0; | ||
let res = math_utils::abs_num(n); | ||
assert_eq!(res, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters