All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jscl.engine.Graph Maven / Gradle / Ivy

The newest version!
package jscl.engine;

import jscl.math.Generic;
import jscl.math.JSCLVector;
import jscl.math.NotFunctionException;
import jscl.math.Function;

public class Graph implements jscl.editor.rendering.Plot {
	private final Function f;

	private Graph(final Function f) {
		this.f = f;
	}

	public double apply(final double value) {
		return f.apply(value);
	}

	public static Object apply(Generic expr) {
		if (expr instanceof Function) {
			return new Graph((Function) expr);
		} else if (expr instanceof JSCLVector) {
			Generic a[] = ((JSCLVector) expr).elements();
			Graph s[] = new Graph[a.length];
			for(int i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy