This commit is contained in:
2025-07-25 12:24:15 +08:00
parent 27aff7e2f5
commit bf14ada539
5 changed files with 21 additions and 11 deletions

View File

@@ -71,13 +71,13 @@ int main(int argc, char const *argv[]) try
*/
array<double> x(201), y(301);
x.sequence(-1.0, 0.01);
y.sequence(0.0, 0.01);
sequence(x, -1.0, 0.01);
sequence(y, 0.0, 0.01);
kde2d k(0.1, 0.1, x, y);
array<double> a(10000), b(10000);
a.random_float(0, 0.2, RdNormal, 0);
b.random_float(1.5, 0.3, RdNormal, 0);
random_float(a, 0.0, 0.2, RdNormal, 0);
random_float(b, 1.5, 0.3, RdNormal, 0);
gaussian_para2d g1(0, 1.5, 0.2, 0.3, 0);

View File

@@ -33,7 +33,7 @@ using namespace gctl;
int main(int argc, char const *argv[]) try
{
_2d_matrix m(5, 4);
m.sequence(1.0, 1.0, 0.1);
sequence2d(m, 1.0, 1.0, 0.1);
m.show();
m.resize(2, 10);
@@ -43,10 +43,17 @@ int main(int argc, char const *argv[]) try
m2.show();
_1d_array a, a2;
m.export_array(a);
m2.export_array(a2);
export_array(m, a, RowMajor);
export_array(m, a2, ColMajor);
a.show();
a2.show();
random_float(m2, 0.0, 1.0);
m2.show();
_2i_matrix m3(5, 5);
random_int(m3, 0, 10);
m3.show();
return 0;
}
catch(std::exception &e)

View File

@@ -25,6 +25,7 @@
* Also add information on how to contact you by electronic and paper mail.
******************************************************/
#include "gctl/core.h"
#include "gctl/poly.h"
#include "gctl/math.h"
@@ -40,7 +41,7 @@ int main(int argc, char const *argv[]) try
//ml.init(xs, std);
array<double> x(201);
x.sequence(0.1, 0.001);
sequence(x, 0.1, 0.001);
for (size_t i = 0; i < x.size(); i++)
{