This commit is contained in:
张壹 2024-11-18 20:38:48 +08:00
parent b425fe89af
commit a1ab16834b
3 changed files with 4 additions and 4 deletions

View File

@ -32,8 +32,8 @@
int main(int argc, char const *argv[]) int main(int argc, char const *argv[])
{ {
gctl::array<double> x(NUM), y(NUM), z(NUM*NUM); gctl::array<double> x(NUM), y(NUM), z(NUM*NUM);
gctl::sequence(x, -2.0*GCTL_Pi, 0.04*GCTL_Pi); x.sequence(-2.0*GCTL_Pi, 0.04*GCTL_Pi);
gctl::sequence(y, -2.0*GCTL_Pi, 0.04*GCTL_Pi); y.sequence(-2.0*GCTL_Pi, 0.04*GCTL_Pi);
for (size_t i = 0; i < NUM; i++) for (size_t i = 0; i < NUM; i++)
{ {

View File

@ -33,7 +33,7 @@ int main(int argc, char const *argv[])
{ {
gctl::array<double> x(NUM), y(NUM); gctl::array<double> x(NUM), y(NUM);
gctl::sequence(x, -2.0*GCTL_Pi, 0.04*GCTL_Pi); x.sequence(-2.0*GCTL_Pi, 0.04*GCTL_Pi);
for (size_t i = 0; i < NUM; i++) for (size_t i = 0; i < NUM; i++)
{ {
y[i] = sin(x[i]); y[i] = sin(x[i]);

View File

@ -61,7 +61,7 @@ int gctl::mathgl_plot::Draw(mglGraph *gr)
x_d.Set(x_.get(), x_.size()); x_d.Set(x_.get(), x_.size());
y_d.Set(ys_.get(), ys_.size()); y_d.Set(ys_.get(), ys_.size());
double mean = gctl::mean(ys_); double mean = ys_.mean();
double mini = ys_.front(), maxi = ys_.front(); double mini = ys_.front(), maxi = ys_.front();
for (size_t i = 1; i < ys_.size(); i++) for (size_t i = 1; i < ys_.size(); i++)
{ {