chandra/std/log.rs
1use std::marker::PhantomData;
2
3use chandra_kernel::ChandraFunction;
4
5use crate::core::{type_traits::Calculatable, operation::{Operation, OperationWrapper}, types::{Value, Void}, operations::{get::{Get, self}, noop::Noop, function::{Function, self}, var::Variable, scope::Scope, instruction_list::InstructionList, returns::returns}};
6
7
8#[derive(Clone, Debug)]
9pub struct Log<R: Calculatable, V: Operation<R>> {
10 value: V,
11 _0: PhantomData<R>
12}
13
14impl<R: Calculatable, V: Operation<R>> Operation<R> for Log<R, V> {
15 fn evaluate(&self, _context: &mut crate::core::processor::cpu::DifferentiatedCPUContext) -> R {
16 todo!()
17 }
18}
19
20//pub struct TestLN<R: Calculatable> {
21// scope: Function<R, (Variable<R>,), Log<R, OperationWrapper<R, Get<R>>>, InstructionList<Void, Void, Noop, Noop>>
22//}
23//
24//impl<R: Calculatable> TestLN<R> {
25// pub fn new(inputs: (Variable<R>, )) -> Self {
26// Self {
27// scope: function::function("TestLN", inputs, |v| {
28// Scope::new().returns(returns(Log::<R, OperationWrapper<R, Get<R>>> { value: get::get(&v.0), _0: PhantomData }))
29// })
30// }
31// }
32//}
33
34
35//#[ChandraFunction]
36//pub fn ln<T: Calculatable>(val: &T) -> T {
37// Log::<T, OperationWrapper<T, Get<T>>> { value: val, _0: PhantomData }
38//}