mirror of
https://github.com/kmc7468/cs220.git
synced 2025-12-17 23:48:45 +00:00
polish
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user