Minor refactors
This commit is contained in:
		
							parent
							
								
									81e478ba49
								
							
						
					
					
						commit
						41cacd2aae
					
				| 
						 | 
				
			
			@ -83,8 +83,7 @@ let toPointSet = (
 | 
			
		|||
        pointSetDistLength: xyPointLength,
 | 
			
		||||
        kernelWidth: None,
 | 
			
		||||
      },
 | 
			
		||||
    )
 | 
			
		||||
    ->GenericDist_Types.Error.resultStringToResultError
 | 
			
		||||
    )->GenericDist_Types.Error.resultStringToResultError
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,8 +216,6 @@ module AlgebraicCombination = {
 | 
			
		|||
      secondOperandIsGreaterThanZero,
 | 
			
		||||
      secondOperandHasMassAt1,
 | 
			
		||||
    ])
 | 
			
		||||
    Js.log2("PMASS", toFloatOperation(t2, ~toPointSetFn, ~distToFloatOperation=#Pdf(1.0)))
 | 
			
		||||
    Js.log4("HIHI", items, t1, t2)
 | 
			
		||||
    switch items {
 | 
			
		||||
    | Error(r) => Some(r)
 | 
			
		||||
    | Ok([true, _, _]) => Some(Other("First input of logarithm must be fully greater than 0"))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,24 +28,9 @@ module Operation = {
 | 
			
		|||
    | Algebraic
 | 
			
		||||
    | Pointwise
 | 
			
		||||
 | 
			
		||||
  type arithmeticOperation = [
 | 
			
		||||
    | #Add
 | 
			
		||||
    | #Multiply
 | 
			
		||||
    | #Subtract
 | 
			
		||||
    | #Divide
 | 
			
		||||
    | #Power
 | 
			
		||||
    | #Logarithm
 | 
			
		||||
  ]
 | 
			
		||||
 | 
			
		||||
  let arithmeticToFn = (arithmetic: arithmeticOperation) =>
 | 
			
		||||
    switch arithmetic {
 | 
			
		||||
    | #Add => \"+."
 | 
			
		||||
    | #Multiply => \"*."
 | 
			
		||||
    | #Subtract => \"-."
 | 
			
		||||
    | #Power => \"**"
 | 
			
		||||
    | #Divide => \"/."
 | 
			
		||||
    | #Logarithm => (a, b) => log(a) /. log(b)
 | 
			
		||||
    }
 | 
			
		||||
  type arithmeticOperation = Operation.algebraicOperation
 | 
			
		||||
  let arithmeticToFn = Operation.Algebraic.toFn
 | 
			
		||||
  let arithmeticToString = Operation.Algebraic.toString
 | 
			
		||||
 | 
			
		||||
  type toFloat = [
 | 
			
		||||
    | #Cdf(float)
 | 
			
		||||
| 
						 | 
				
			
			@ -105,8 +90,8 @@ module Operation = {
 | 
			
		|||
    | ToString(ToString) => `toString`
 | 
			
		||||
    | ToString(ToSparkline(n)) => `toSparkline(${E.I.toString(n)})`
 | 
			
		||||
    | ToBool(IsNormalized) => `isNormalized`
 | 
			
		||||
    | ToDistCombination(Algebraic, _, _) => `algebraic`
 | 
			
		||||
    | ToDistCombination(Pointwise, _, _) => `pointwise`
 | 
			
		||||
    | ToDistCombination(Algebraic, operation, _) => `algebraic-${arithmeticToString(operation)}`
 | 
			
		||||
    | ToDistCombination(Pointwise, operation, _) => `pointwise-${arithmeticToString(operation)}`
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  let toString = (d: genericFunctionCallInfo): string =>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user