netflix.ocelli.functions.Functions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ocelli-core Show documentation
Show all versions of ocelli-core Show documentation
ocelli-core developed by Netflix
package netflix.ocelli.functions;
import rx.functions.Func1;
public abstract class Functions {
public static Func1 log() {
return new Func1() {
@Override
public Integer call(Integer t1) {
return (int)Math.ceil(Math.log(t1));
}
};
}
public static Func1 log_log() {
return new Func1() {
@Override
public Integer call(Integer t1) {
return (int)Math.ceil(Math.log(Math.log(t1)));
}
};
}
public static Func1 identity() {
return new Func1() {
@Override
public Integer call(Integer t1) {
return t1;
}
};
}
public static Func1 sqrt() {
return new Func1() {
@Override
public Integer call(Integer t1) {
return (int)Math.ceil(Math.sqrt((double)t1));
}
};
}
public static Func1 root(final double pow) {
return new Func1() {
@Override
public Integer call(Integer t1) {
return (int)Math.ceil(Math.pow((double)t1, 1/pow));
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy