This commit is contained in:
jungin.rhee
2023-08-22 05:16:34 +00:00
parent d40d4eb562
commit afe2c7b2d2
27 changed files with 312 additions and 192 deletions

View File

@@ -3,9 +3,7 @@
//! The primary goal of this assignment is to understand generics, traits, and lifetimes.
//!
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-06.sh` works fine.
//! See `assignment06_grade.rs` and `/scripts/grade-06.sh` for the test script.
use std::{collections::HashMap, fmt::Debug};
//! See `assignment06/*_grade.rs` and `/scripts/grade-06.sh` for the test script.
pub mod semiring;
pub mod symbolic_differentiation;

View File

@@ -156,7 +156,7 @@ impl<C: Semiring> From<C> for Polynomial<C> {
/// - In `x^n` and `ax^n`, it is guaranteed that `n >= 2`.
/// - All terms have unique degrees.
///
/// Consult `assignment06_jaemin_choi_grade.rs` for example valid strings.
/// Consult `assignment06/grade.rs` for example valid strings.
///
/// Hint: `.split`, `.parse`, and `Polynomial::term`
impl<C: Semiring> std::str::FromStr for Polynomial<C> {

View File

@@ -79,8 +79,8 @@ pub trait Differentiable: Clone {
fn diff(&self) -> Self;
}
/// HINT: Consult <https://en.wikipedia.org/wiki/Differentiation_rules#Constant_term_rule>
impl Differentiable for Rational {
/// HINT: Consult <https://en.wikipedia.org/wiki/Differentiation_rules#Constant_term_rule>
fn diff(&self) -> Self {
todo!()
}
@@ -122,7 +122,7 @@ impl Differentiable for SingletonPolynomial {
}
}
/// Expoential function.
/// Expoential function.(`e^x`)
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Exp;