MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / transform

Function transform

source/matplot/util/common.cpp:102–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 std::vector<double> iota(double d1, double d2) { return iota(d1, 1., d2); }
101
102 std::vector<double> transform(const std::vector<double> &x,
103 std::function<double(double)> fn) {
104 std::vector<double> y(x.size());
105 for (size_t i = 0; i < y.size(); ++i) {
106 y[i] = fn(x[i]);
107 }
108 return y;
109 }
110
111 double truncate(double x, double lower_bound, double upper_bound) {
112 if (x <= lower_bound) {

Callers 15

run_colormap_commandMethod · 0.85
fimplicitMethod · 0.85
wordcloudMethod · 0.85
paretoMethod · 0.85
compassMethod · 0.85
polarhistogramMethod · 0.85
quiverMethod · 0.85
quiver3Method · 0.85
fmeshMethod · 0.85
fsurfMethod · 0.85
rectangleMethod · 0.85

Calls 2

minFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected