diff --git a/docs.html b/docs.html index 472b1290..b0fa48f0 100644 --- a/docs.html +++ b/docs.html @@ -2674,11 +2674,14 @@ optionally first changing the size to specified dimensions Examples:
-mat A(5,10); A.zeros(); // or: mat A(5,10,fill::zeros); +mat A; +A.zeros(5, 10); // or: mat A(5, 10, fill::zeros); -mat B; B.zeros(10,20); +mat B; +B.zeros( size(A) ); -mat C; C.zeros( size(B) ); +mat C(5, 10, fill::randu); +C.zeros();@@ -2757,11 +2760,14 @@ optionally first changing the size to specified dimensions Examples:
-mat A(5,10); A.ones(); // or: mat A(5,10,fill::ones); +mat A; +A.ones(5, 10); // or: mat A(5, 10, fill::ones); -mat B; B.ones(10,20); +mat B; +B.ones( size(A) ); -mat C; C.ones( size(B) ); +mat C(5, 10, fill::randu); +C.ones();@@ -2806,11 +2812,14 @@ An identity matrix is generated when n_rows = n_cols Examples:
-mat A(5,5); A.eye(); // or: mat A(5,5,fill::eye); +mat A; +A.eye(5, 5); // or: mat A(5, 5, fill::eye); -mat B; B.eye(5,5); +mat B; +B.eye( size(A) ); -mat C; C.eye( size(B) ); +mat C(5, 5, fill::randu); +C.eye();@@ -2939,11 +2948,14 @@ To change the RNG seed, use arma_rng::set_seed(value) or arma_rng::set Examples:
-mat A(5,10); A.randu(); // or: mat A(5,10,fill::randu); +mat A; +A.randu(5, 10); // or: mat A(5, 10, fill::randu); -mat B; B.randu(10,20); +mat B; +B.randu( size(A) ); -mat C; C.randu( size(B) ); +mat C(5, 10, fill::zeros); +C.randu(); arma_rng::set_seed_random(); // set the seed to a random value@@ -3043,7 +3055,7 @@ std::mt19937 engine; // Mersenne twister random number engine std::uniform_real_distribution<double> distr(0.0, 1.0); -mat A(4,5); +mat A(4, 5, fill:none); A.imbue( [&]() { return distr(engine); } ); @@ -3392,11 +3404,14 @@ To explicitly preserve data while changing the size, use